|
|
|
@@ -14,12 +14,14 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
|
|
|
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
|
|
|
|
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
|
|
|
|
use App\Classes\Modules\Bookings\Services\FetchesBookingQuotation;
|
|
|
|
|
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
|
|
|
|
use App\Classes\Modules\Transactions\ControllersLogic\UpdateRefundTransactionStatusLogic;
|
|
|
|
|
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
|
|
|
|
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
|
|
|
|
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
|
|
|
|
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionRefundCalculationObject;
|
|
|
|
|
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
|
|
|
|
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
|
|
|
|
|
|
|
|
|
class CreateBookingRefundLogic extends AbstractControllerLogic
|
|
|
|
|
{
|
|
|
|
@@ -52,6 +54,9 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
|
|
|
|
/** @var UpdateRefundTransactionStatusLogic */
|
|
|
|
|
private $updateRefundTransactionStatusLogic;
|
|
|
|
|
|
|
|
|
|
/** @var CreateRemarkProcessor */
|
|
|
|
|
private $createRemarkProcessor;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CreateBookingPaymentLogic constructor.
|
|
|
|
|
* @param FetchesBookingQuotation $fetchBookingQuotation
|
|
|
|
@@ -60,8 +65,9 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
|
|
|
|
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
|
|
|
|
* @param CreatesTransaction $createsTransaction
|
|
|
|
|
* @param UpdateRefundTransactionStatusLogic $updateRefundTransactionStatusLogic
|
|
|
|
|
* @param CreateRemarkProcessor $createRemarkProcessor
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(FetchesBookingQuotation $fetchBookingQuotation, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CreatesTransaction $createsTransaction, UpdateRefundTransactionStatusLogic $updateRefundTransactionStatusLogic)
|
|
|
|
|
public function __construct(FetchesBookingQuotation $fetchBookingQuotation, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CreatesTransaction $createsTransaction, UpdateRefundTransactionStatusLogic $updateRefundTransactionStatusLogic, CreateRemarkProcessor $createRemarkProcessor)
|
|
|
|
|
{
|
|
|
|
|
$this->fetchBookingQuotation = $fetchBookingQuotation;
|
|
|
|
|
$this->fetchesTransaction = $fetchesTransaction;
|
|
|
|
@@ -69,6 +75,7 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
|
|
|
|
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
|
|
|
|
$this->createsTransaction = $createsTransaction;
|
|
|
|
|
$this->updateRefundTransactionStatusLogic = $updateRefundTransactionStatusLogic;
|
|
|
|
|
$this->createRemarkProcessor = $createRemarkProcessor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -132,6 +139,11 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($request->input('refundRemark')){
|
|
|
|
|
$remarkObject = new RemarkObject($request->input('refundRemark'), Auth()->user()->id);
|
|
|
|
|
$this->createRemarkProcessor->execute($this->fetchesTransaction->execute(['id' => $refund_transaction->id]), $remarkObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->resourceResponse(new TransactionResource($refund_transaction));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|