From ec5bff51c1b782df55ba78e228a0d1bc7d579dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:43:17 +0300 Subject: [PATCH 1/3] added transaction delete events --- app/Events/Banking/TransactionDeleted.php | 20 ++++++++++++++++++++ app/Events/Banking/TransactionDeleting.php | 20 ++++++++++++++++++++ app/Jobs/Banking/DeleteTransaction.php | 6 ++++++ 3 files changed, 46 insertions(+) create mode 100644 app/Events/Banking/TransactionDeleted.php create mode 100644 app/Events/Banking/TransactionDeleting.php diff --git a/app/Events/Banking/TransactionDeleted.php b/app/Events/Banking/TransactionDeleted.php new file mode 100644 index 000000000..e11ea9976 --- /dev/null +++ b/app/Events/Banking/TransactionDeleted.php @@ -0,0 +1,20 @@ +transaction = $transaction; + } +} diff --git a/app/Events/Banking/TransactionDeleting.php b/app/Events/Banking/TransactionDeleting.php new file mode 100644 index 000000000..f5a0d7b0d --- /dev/null +++ b/app/Events/Banking/TransactionDeleting.php @@ -0,0 +1,20 @@ +transaction = $transaction; + } +} diff --git a/app/Jobs/Banking/DeleteTransaction.php b/app/Jobs/Banking/DeleteTransaction.php index 7561d0a3d..8edac1325 100644 --- a/app/Jobs/Banking/DeleteTransaction.php +++ b/app/Jobs/Banking/DeleteTransaction.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\TransactionDeleting; +use App\Events\Banking\TransactionDeleted; use App\Interfaces\Job\ShouldDelete; class DeleteTransaction extends Job implements ShouldDelete @@ -11,11 +13,15 @@ class DeleteTransaction extends Job implements ShouldDelete { $this->authorize(); + event(new TransactionDeleting($this->model)); + \DB::transaction(function () { $this->model->recurring()->delete(); $this->model->delete(); }); + event(new TransactionDeleted($this->model)); + return true; } From 271b61808b1eed2139d9e3420053098c30dc4a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:51:34 +0300 Subject: [PATCH 2/3] added account events --- app/Events/Banking/AccountCreated.php | 21 +++++++++++++++++++++ app/Events/Banking/AccountCreating.php | 20 ++++++++++++++++++++ app/Events/Banking/AccountDeleted.php | 20 ++++++++++++++++++++ app/Events/Banking/AccountDeleting.php | 20 ++++++++++++++++++++ app/Events/Banking/AccountUpdated.php | 25 +++++++++++++++++++++++++ app/Events/Banking/AccountUpdating.php | 25 +++++++++++++++++++++++++ app/Jobs/Banking/CreateAccount.php | 6 ++++++ app/Jobs/Banking/DeleteAccount.php | 6 ++++++ app/Jobs/Banking/UpdateAccount.php | 6 ++++++ 9 files changed, 149 insertions(+) create mode 100644 app/Events/Banking/AccountCreated.php create mode 100644 app/Events/Banking/AccountCreating.php create mode 100644 app/Events/Banking/AccountDeleted.php create mode 100644 app/Events/Banking/AccountDeleting.php create mode 100644 app/Events/Banking/AccountUpdated.php create mode 100644 app/Events/Banking/AccountUpdating.php diff --git a/app/Events/Banking/AccountCreated.php b/app/Events/Banking/AccountCreated.php new file mode 100644 index 000000000..78570ca85 --- /dev/null +++ b/app/Events/Banking/AccountCreated.php @@ -0,0 +1,21 @@ +account = $account; + } +} \ No newline at end of file diff --git a/app/Events/Banking/AccountCreating.php b/app/Events/Banking/AccountCreating.php new file mode 100644 index 000000000..e6c500b05 --- /dev/null +++ b/app/Events/Banking/AccountCreating.php @@ -0,0 +1,20 @@ +request = $request; + } +} \ No newline at end of file diff --git a/app/Events/Banking/AccountDeleted.php b/app/Events/Banking/AccountDeleted.php new file mode 100644 index 000000000..22bf63d4a --- /dev/null +++ b/app/Events/Banking/AccountDeleted.php @@ -0,0 +1,20 @@ +account = $account; + } +} \ No newline at end of file diff --git a/app/Events/Banking/AccountDeleting.php b/app/Events/Banking/AccountDeleting.php new file mode 100644 index 000000000..016e6a618 --- /dev/null +++ b/app/Events/Banking/AccountDeleting.php @@ -0,0 +1,20 @@ +account = $account; + } +} \ No newline at end of file diff --git a/app/Events/Banking/AccountUpdated.php b/app/Events/Banking/AccountUpdated.php new file mode 100644 index 000000000..80746fa08 --- /dev/null +++ b/app/Events/Banking/AccountUpdated.php @@ -0,0 +1,25 @@ +account = $account; + $this->request = $request; + } +} \ No newline at end of file diff --git a/app/Events/Banking/AccountUpdating.php b/app/Events/Banking/AccountUpdating.php new file mode 100644 index 000000000..9949dd5b8 --- /dev/null +++ b/app/Events/Banking/AccountUpdating.php @@ -0,0 +1,25 @@ +account = $account; + $this->request = $request; + } +} \ No newline at end of file diff --git a/app/Jobs/Banking/CreateAccount.php b/app/Jobs/Banking/CreateAccount.php index 57f24383d..cca2e136c 100644 --- a/app/Jobs/Banking/CreateAccount.php +++ b/app/Jobs/Banking/CreateAccount.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\AccountCreating; +use App\Events\Banking\AccountCreated; use App\Interfaces\Job\HasOwner; use App\Interfaces\Job\HasSource; use App\Interfaces\Job\ShouldCreate; @@ -12,6 +14,8 @@ class CreateAccount extends Job implements HasOwner, HasSource, ShouldCreate { public function handle(): Account { + event(new AccountCreating($this->request)); + \DB::transaction(function () { $this->model = Account::create($this->request->all()); @@ -22,6 +26,8 @@ class CreateAccount extends Job implements HasOwner, HasSource, ShouldCreate } }); + event(new AccountCreated($this->model, $this->request)); + return $this->model; } } diff --git a/app/Jobs/Banking/DeleteAccount.php b/app/Jobs/Banking/DeleteAccount.php index 5a86a9692..c24d88e86 100644 --- a/app/Jobs/Banking/DeleteAccount.php +++ b/app/Jobs/Banking/DeleteAccount.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\AccountDeleting; +use App\Events\Banking\AccountDeleted; use App\Interfaces\Job\ShouldDelete; class DeleteAccount extends Job implements ShouldDelete @@ -11,10 +13,14 @@ class DeleteAccount extends Job implements ShouldDelete { $this->authorize(); + event(new AccountDeleting($this->model)); + \DB::transaction(function () { $this->model->delete(); }); + event(new AccountDeleted($this->model)); + return true; } diff --git a/app/Jobs/Banking/UpdateAccount.php b/app/Jobs/Banking/UpdateAccount.php index b37a7b512..de661fccb 100644 --- a/app/Jobs/Banking/UpdateAccount.php +++ b/app/Jobs/Banking/UpdateAccount.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\AccountUpdating; +use App\Events\Banking\AccountUpdated; use App\Interfaces\Job\ShouldUpdate; use App\Models\Banking\Account; @@ -12,6 +14,8 @@ class UpdateAccount extends Job implements ShouldUpdate { $this->authorize(); + event(new AccountUpdating($this->model, $this->request)); + \DB::transaction(function () { $this->model->update($this->request->all()); @@ -22,6 +26,8 @@ class UpdateAccount extends Job implements ShouldUpdate } }); + event(new AccountUpdated($this->model, $this->request)); + return $this->model; } From 9f913d0efbd433eb0560e5e259ba8b5468ccf846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 23 Aug 2023 14:45:13 +0300 Subject: [PATCH 3/3] update presets status color class.. --- presets.js | 68 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/presets.js b/presets.js index adef34885..962489ba0 100644 --- a/presets.js +++ b/presets.js @@ -251,25 +251,65 @@ module.exports = { }, 'status': { - 'success': '#F1F6EE', - 'danger': '#fae6e6', - 'sent': '#FEF5E7', - 'viewed': '#EEEEF3', - 'draft': '#ECECEC', - 'partial': '#E6F1F6', + 'success': '#F1F6EE', + 'danger': '#fae6e6', + 'warning': '#FEF5E7', + 'info': '#e6f1f6', + 'sent': '#FEF5E7', + 'viewed': '#EEEEF3', + 'draft': '#ECECEC', + 'partial': '#E6F1F6', 'canceled': '#282828', - 'warning': '#FEF5E7' + 'approved': '#F1F6EE', + 'invoiced': '#CCE0D0', + 'refused': '#fae6e6', + 'expired': '#fae6e6', + 'confirmed': '#F1F6EE', + 'issued': '#fae6e6', + 'green': '#f1f6ee', + 'purple': '#eeeef3', + 'red': '#fae6e6', + 'orange': '#fef5e7', + 'blue': '#e6f1f6', + 'black': '#ececec', + 'lilac': '#F5F7FA', + 'golden': '', + 'rose': '#ffe4e6', + 'silver': '#D4D7DC', + 'pastel_green': '#CCE0D0', + 'peach_orange': '#F0E0BE', + 'wisteria': '#D0CEE8', }, 'text-status': { - 'success': '#63914A', - 'danger': '#B80000', - 'sent': '#DD8E0A', - 'viewed': '#4D4F7D', - 'draft': '#3B3B3B', - 'partial': '#006395', + 'success': '#63914A', + 'danger': '#B80000', + 'warning': '#b87708', + 'info': '#006395', + 'sent': '#DD8E0A', + 'viewed': '#4D4F7D', + 'draft': '#3B3B3B', + 'partial': '#006395', 'canceled': '#ffffff', - 'warning': '#b87708' + 'approved': '#63914A', + 'invoiced': '#678D72', + 'refused': '#b80000', + 'expired': '#B80000', + 'confirmed': '#63914A', + 'issued': '#b80000', + 'green': '#63914a', + 'purple': '#4d4f7d', + 'red': '#b80000', + 'orange': '#dd8e0a', + 'blue': '#006395', + 'black': '#3b3b3b', + 'lilac': '', + 'golden': '', + 'rose': '#e11d48', + 'silver': '#475569', + 'pastel_green': '#678D72', + 'peach_orange': '#B78939', + 'wisteria': '#65638C' }, 'body': {