'Retrieved Booking', 'message' => 'You have successfully retrieved a Address' ]; } /** @var CanFetchBooking */ private $canFetchBooking; /** @var FetchesBooking */ private $fetchesBooking; /** * FetchBookingLogic constructor. * @param CanFetchBooking $canFetchBooking * @param FetchesBooking $fetchesBooking */ public function __construct(CanFetchBooking $canFetchBooking, FetchesBooking $fetchesBooking) { $this->canFetchBooking = $canFetchBooking; $this->fetchesBooking = $fetchesBooking; } /** * @param Request $request * @return JsonResponse * @throws \App\Classes\Exceptions\AccessForbiddenException * @throws \App\Classes\Exceptions\RequestValidationException */ public function logic(Request $request) : JsonResponse { $this->canFetchBooking->passes(); $query = $this->fetchesBooking->execute(['marking' => $request->route('marking'), 'with_transactions' => true]); return $this->resourceResponse(new BookingResource($query)); } }