mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 14:33:59 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into development
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Bookings\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ExpireBookingPaymentControllerLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Expire Payment',
|
||||
'message' => 'You have successfully expire the Payment'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesBooking */
|
||||
private $fetchesBooking;
|
||||
|
||||
/**
|
||||
* DeletePurchaseOrderPdfLogic constructor.
|
||||
* @param FetchesBooking $fetchesBooking
|
||||
*/
|
||||
public function __construct(fetchesBooking $fetchesBooking)
|
||||
{
|
||||
$this->fetchesBooking = $fetchesBooking;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$booking = $this->fetchesBooking->execute(['id' => $request->route('id')]);
|
||||
|
||||
$payment = $booking->transactions()
|
||||
->payments()->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->first();
|
||||
|
||||
$payment->status = ApprovalStatus::EXPIRED;
|
||||
$payment->save();
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bookings;
|
||||
|
||||
use App\Classes\Modules\Bookings\ControllersLogic\ExpireBookingPaymentControllerLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ExpireBookingPaymentController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param DeleteBookingPaymentControllerLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function expire(Request $request, ExpireBookingPaymentControllerLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -289,6 +289,22 @@
|
||||
<regenerate-booking-invoices-component :data="booking" :section="section" class="text-center"></regenerate-booking-invoices-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="row m-t-10" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col-sm col-md-auto">
|
||||
<div class="btn btn-sm btn block all-caps b-rad-none btn-danger pointer requestModal" data-type="deleteTransfer">Delete Transfer</div>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="deleteTransfer">
|
||||
<general-confirmation-form-component
|
||||
contentText="Are you sure you want to delete this Order?"
|
||||
modalType="delete"
|
||||
class="text-center"
|
||||
:apiRoute="route('api.booking.payment.expire', booking.id)"
|
||||
apiMethod="post"
|
||||
:section="section"
|
||||
>
|
||||
</general-confirmation-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-5 mt-3 mt-sm-0">
|
||||
<booking-payment-quotation-component :data="booking" :section="section"></booking-payment-quotation-component>
|
||||
|
||||
@@ -20,6 +20,7 @@ Route::group(['prefix' => 'booking', 'as' => 'booking.', 'namespace' => 'Booking
|
||||
Route::post('create', 'CreateBookingPaymentController@create')->name('create');
|
||||
Route::post('{payment_id}/verification/create', 'CreatePaymentVerificationController@create')->name('verification.create');
|
||||
Route::put('/{payment_id}/approval/{status}', 'ApprovePaymentVerificationController@approve')->where('status', 'approve|reject')->name('approval');
|
||||
Route::post('delete', 'ExpireBookingPaymentController@expire')->name('expire');
|
||||
});
|
||||
|
||||
Route::group(['prefix' => '{id}/refund', 'as' => 'refund.'], function () {
|
||||
|
||||
Reference in New Issue
Block a user