'Create Perfoma Invoice Transaction', 'message' => 'You have successfully create performa invoice transaction' ]; } /** @var CanFetchBooking */ private $canFetchBooking; /** @var FetchesBooking */ private $fetchesBooking; /** @var CreatePerformaInvoiceTransactionProcessor */ private $CreatePerformaInvoiceTransactionProcessor; /** * FetchBookingLogic constructor. * @param CanFetchBooking $canFetchBooking * @param FetchesBooking $fetchesBooking * @param CreatePerformaInvoiceTransactionProcessor $CreatePerformaInvoiceTransactionProcessor */ public function __construct( CanFetchBooking $canFetchBooking, FetchesBooking $fetchesBooking, CreatePerformaInvoiceTransactionProcessor $CreatePerformaInvoiceTransactionProcessor ) { $this->canFetchBooking = $canFetchBooking; $this->fetchesBooking = $fetchesBooking; $this->CreatePerformaInvoiceTransactionProcessor = $CreatePerformaInvoiceTransactionProcessor; } /** * @param Request $request * @return JsonResponse * @throws \App\Classes\Exceptions\AccessForbiddenException * @throws \App\Classes\Exceptions\RequestValidationException */ public function logic(Request $request) : JsonResponse { $this->canFetchBooking->passes(); $booking = $this->fetchesBooking->execute(['id' => $request->route('id')]); $this->CreatePerformaInvoiceTransactionProcessor->execute($booking); return $this->resourceResponse(new BookingResource($booking)); } }