diff --git a/app/Classes/Modules/Transactions/ControllersLogic/DeleteTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/DeleteTransactionLogic.php new file mode 100644 index 00000000..56d24523 --- /dev/null +++ b/app/Classes/Modules/Transactions/ControllersLogic/DeleteTransactionLogic.php @@ -0,0 +1,52 @@ + 'Delete Transaction', + 'message' => 'You have successfully deleted the transaction' + ]; + } + + /** @var FetchesTransaction */ + private $fetchesTransaction; + + /** @var UpdatesTransactionStatus */ + private $updatesTransactionStatus; + + + /** + * SuspendTransactionLogic constructor. + * @param FetchesTransaction $fetchesTransaction + * @param UpdatesTransactionStatus $updatesTransactionStatus + */ + public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus) + { + $this->fetchesTransaction = $fetchesTransaction; + $this->updatesTransactionStatus = $updatesTransactionStatus; + } + + + public function logic(Request $request) : JsonResponse + { + $transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]); + + $transaction->delete(); + + return $this->response([]); + } +} diff --git a/app/Http/Controllers/Transactions/DeleteTransactionController.php b/app/Http/Controllers/Transactions/DeleteTransactionController.php new file mode 100644 index 00000000..a9dee9ba --- /dev/null +++ b/app/Http/Controllers/Transactions/DeleteTransactionController.php @@ -0,0 +1,21 @@ +execute($request); + } +} diff --git a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue index a5ede524..f64b006c 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue @@ -63,6 +63,14 @@ +