ldc-cocotte/app/Cqs/Actions/Orders/ApplyPickTimeSlotOutput.php

33 lines
705 B
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace App\Cqs\Actions\Orders;
use App\Enums\ApplyPickTimeSlotStatus;
use Domain\Models\ValueObjects\PickupTimeSlot;
final readonly class ApplyPickTimeSlotOutput
{
public function __construct(
public ApplyPickTimeSlotStatus $status,
public ?PickupTimeSlot $timeSlot = null,
) {
}
public static function matched(PickupTimeSlot $timeSlot): self
{
return new self(
status: ApplyPickTimeSlotStatus::MATCHED,
timeSlot: $timeSlot,
);
}
public static function unavailable(): self
{
return new self(
status: ApplyPickTimeSlotStatus::UNAVAILABLE,
);
}
}