<?php

declare(strict_types=1);

namespace ImovelZapAi\Properties\Application\Actions;

use ImovelZapAi\Properties\Domain\Enums\PropertyStatus;
use ImovelZapAi\Properties\Infrastructure\Persistence\Eloquent\PropertyModel;

final class UpdatePropertyStatusAction
{
    public function execute(PropertyModel $property, PropertyStatus $status): PropertyModel
    {
        $property->update(['status' => $status]);

        return $property->fresh() ?? $property;
    }
}
