add cancel order and restore order function

This commit is contained in:
omair saleh
2021-08-27 15:19:58 +08:00
parent 42d064d07f
commit 509a681bcc
@@ -54,7 +54,7 @@ class CancelBookingLogic extends AbstractControllerLogic
{
$booking = $this->fetchesBooking->execute(['id' => $request->route('id')]);
$bookingActivePayments = $booking->transactions()->where('type', '=', TransactionType::PAYMENT)->where('status', '!=', ApprovalStatus::PENDING_SUBMISSION)->get();
$bookingActivePayments = $booking->transactions()->where('type', '=', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->get();
if(count($bookingActivePayments)){
throw new MalformedRequestException('You can\'t cancel an order with active payments');