*/ final readonly class GetPickTimeSlotQuery implements Query { public function __construct( private OrderTunnelService $orderTunnelService, private MapUrlService $mapUrlService, ) { } /** * @param \App\Queries\Orders\GetPickTimeSlotQueryInput $input */ #[\Override] public function __invoke(QueryInput $input): GetPickTimeSlotQueryOutput { Assert::isInstanceOf($input, GetPickTimeSlotQueryInput::class); $shop = $this->orderTunnelService->getShopForCustomer($input->shopperId); $timeSlots = $this->orderTunnelService->getAvailableTimeSlots($shop); $shopDto = ShopDto::fromDomain($shop); $mapUrl = $this->mapUrlService->generateUrl($shopDto); return new GetPickTimeSlotQueryOutput( step: OrderTunnelStep::BOOKING, shop: $shopDto, timeSlots: $timeSlots, mapUrl: $mapUrl, ); } }