<?php

namespace App\Modules\Inventory\Services;

use App\Modules\Inventory\Models\Warehouse;
use App\Modules\Inventory\Support\InventoryLifecycleState;

final class WarehouseLifecycleService
{
    public function deactivate(Warehouse $warehouse, ?int $actorUserId): void
    {
        $warehouse->forceFill([
            'is_active' => false,
            'lifecycle_state' => InventoryLifecycleState::Inactive,
            'deactivated_at' => now(),
            'updated_by' => $actorUserId,
        ])->save();
    }
}
