23 lines
547 B
PHP
23 lines
547 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace App\Queries\Timeslots;
|
||
|
|
|
||
|
|
use Domain\Models\ValueObjects\PickupTimeSlot;
|
||
|
|
use Webmozart\Assert\Assert;
|
||
|
|
|
||
|
|
final readonly class GetAvailableTimeslotsQueryOutput
|
||
|
|
{
|
||
|
|
/** @param PickupTimeSlot[] $timeslotList */
|
||
|
|
public function __construct(
|
||
|
|
public array $timeslotList,
|
||
|
|
) {
|
||
|
|
Assert::allInArray(
|
||
|
|
$this->timeslotList,
|
||
|
|
fn ($value) => $value instanceof PickupTimeSlot,
|
||
|
|
'All elements of $timeslotList must be instances of PickupTimeSlot'
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|