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