Merge branch 'dillon/74-admin-workflow-2-20250228' into vapor/development

This commit is contained in:
Dillon Ngo
2025-02-28 16:30:39 +08:00
3 changed files with 8 additions and 6 deletions
@@ -119,7 +119,7 @@ class CreateBookingPaymentProcessor
if($conversionObject->getAmount() > round($outstanding, 2)) throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.');
}
$configurations = $this->fetchBookingQuotation->execute($booking->company, $conversionObject, $voucherCode);
$configurations = $this->fetchBookingQuotation->execute($booking->company, $conversionObject, $voucherCode, null, $booking);
$paymentAttemptLimit = $this->fetchesCompanyPaymentAttemptLimit->execute($booking->company);
@@ -163,7 +163,7 @@ class CreateBookingPaymentProcessor
$transaction = $this->createsTransaction->execute($booking, $object);
// $cash_back_transaction = $this->createCashBackTransactionProcessor->execute($transaction);
$this->bookingToVoucherifyProcessor->execute($booking->company->employees()->first(), $transaction, $booking->company->id, $configurations->getSubTotal(), $configurations->getVoucherDiscountAmount(), 0, $voucherCode);
$this->bookingToVoucherifyProcessor->execute($booking->company->employees()->first(), $transaction, $booking->company->id, $configurations->getSubTotal(), $configurations->getServiceCharge(), $configurations->getVoucherDiscountAmount(), $voucherCode);
if(PaymentMethodType::PAYMENT_METHODS[$paymentMethod] == PaymentMethodType::WALLET){
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED);
+5 -4
View File
@@ -127,16 +127,17 @@ class Booking extends AbstractModel implements Documentable, Transactionable, Ke
/**
* @return MorphMany
*/
public function attributesKVP(): MorphMany
public function voucherifyEntities(): MorphMany
{
return $this->morphMany(KeyValuePair::class, 'owner');
return $this->morphMany(VoucherEntityMapping::class, 'owner');
}
/**
* @return MorphMany
*/
public function voucherifyEntities(): MorphMany
public function attributesKVP(): MorphMany
{
return $this->morphMany(VoucherEntityMapping::class, 'owner');
return $this->morphMany(KeyValuePair::class, 'owner');
}
}
+1
View File
@@ -1375,6 +1375,7 @@ Route::get('/admin-workflow/list', function () {
return view('pages.admin-workflow.list-workflow');
})->name('admin-workflow.list');
Route::get('/test-test', function () {
dd('test-test');
});