From 6bb478b2e1967013b8dca70a0f5f232f4dfcf557 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Tue, 5 Nov 2024 03:22:51 +0800 Subject: [PATCH 1/2] Laravel Vapor - Update custom logs retention period --- config/logging.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/logging.php b/config/logging.php index 5781d006..eabe9a64 100644 --- a/config/logging.php +++ b/config/logging.php @@ -145,7 +145,7 @@ return [ 'secret' => env('AWS_CW_SECRET') ] ], - 'retention' => env('APP_ENV') === 'production' ? 90 : 6, + 'retention' => env('APP_ENV') === 'production' ? 90 : 14, 'level' => 'debug', 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), ], @@ -163,7 +163,7 @@ return [ 'secret' => env('AWS_CW_SECRET') ] ], - 'retention' => env('APP_ENV') === 'production' ? 90 : 6, + 'retention' => env('APP_ENV') === 'production' ? 90 : 14, 'level' => 'debug', 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), ], @@ -181,7 +181,7 @@ return [ 'secret' => env('AWS_CW_SECRET') ] ], - 'retention' => env('APP_ENV') === 'production' ? 90 : 6, + 'retention' => env('APP_ENV') === 'production' ? 90 : 14, 'level' => 'debug', 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), ], @@ -199,7 +199,7 @@ return [ 'secret' => env('AWS_CW_SECRET') ] ], - 'retention' => env('APP_ENV') === 'production' ? 90 : 6, + 'retention' => env('APP_ENV') === 'production' ? 90 : 14, 'level' => 'debug', 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), ], From 525fbded327784fcc2b6f3bb8576fad9327c5633 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 7 Nov 2024 03:34:30 +0800 Subject: [PATCH 2/2] Laravel Vapor - Fix issues reported by Josephine 20241030 --- .../Eloquent/Filters/DoesNotHaveGroup.php | 22 +++++++++++++++++++ .../ControllersLogic/DeleteGroupLogic.php | 11 +++++++--- .../SupplierPendingOrdersSectionComponent.vue | 6 ++--- routes/web.php | 3 +++ 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 app/Classes/General/Eloquent/Filters/DoesNotHaveGroup.php diff --git a/app/Classes/General/Eloquent/Filters/DoesNotHaveGroup.php b/app/Classes/General/Eloquent/Filters/DoesNotHaveGroup.php new file mode 100644 index 00000000..2c82d013 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/DoesNotHaveGroup.php @@ -0,0 +1,22 @@ +whereDoesntHave('transactions', function ($transaction) use ($value) { + $transaction->whereHas('groupTransaction'); + }); + } +} diff --git a/app/Classes/Modules/Transactions/ControllersLogic/DeleteGroupLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/DeleteGroupLogic.php index 601a1530..b2f92a35 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/DeleteGroupLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/DeleteGroupLogic.php @@ -10,6 +10,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Http\Resources\GroupResource; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; class DeleteGroupLogic extends AbstractControllerLogic { @@ -61,13 +62,17 @@ class DeleteGroupLogic extends AbstractControllerLogic $bill = $item; $payment = $bill->owner; $group->transactions()->detach($bill->id); - $this->updatesTransactionStatus->execute($payment, ApprovalStatus::APPROVED); + + $trns = $payment->transactions()->with('groupTransaction')->get(); + if(count($trns) <= 1){ + $this->updatesTransactionStatus->execute($payment, ApprovalStatus::APPROVED); + } $this->deletesTransaction->execute($bill); } $group->delete(); - + return $this->resourceResponse(new GroupResource($group)); } -} \ No newline at end of file +} diff --git a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue index 2adb9a43..964bc409 100644 --- a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue +++ b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue @@ -117,13 +117,13 @@
- + -