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 @@ +
+ + + + + + +
{{ expanded ? 'Cancel' : 'Make Payment' }}
diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeleteInvoiceFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeleteInvoiceFormComponent.vue new file mode 100644 index 00000000..b8c13ed8 --- /dev/null +++ b/resources/assets/vue/components/paymentsBilling/forms/DeleteInvoiceFormComponent.vue @@ -0,0 +1,31 @@ + + diff --git a/routes/transaction.php b/routes/transaction.php index 3d847135..3ae8e5d2 100644 --- a/routes/transaction.php +++ b/routes/transaction.php @@ -6,6 +6,7 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => Route::get('/list', 'ListTransactionsController@list')->name('list'); Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend'); + Route::delete('/delete/{id}', 'DeleteTransactionController@delete')->name('delete'); Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire|reject')->name('update'); Route::group(['prefix' => 'payment', 'as' => 'payment.'], function () {