From 9caa240fdb24ac3136295abc3c65f4832b660157 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 19 Aug 2025 17:17:46 -0700 Subject: [PATCH] Revert "Remove total qty of accessory checkouts" This reverts commit 3ffb73a5160613d4042041710ea81f888a5050cc. --- app/Models/CheckoutAcceptance.php | 12 ++++-------- .../Ui/AccessoryAcceptanceTest.php | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php index 72f7accc52..0599286f85 100644 --- a/app/Models/CheckoutAcceptance.php +++ b/app/Models/CheckoutAcceptance.php @@ -108,14 +108,10 @@ class CheckoutAcceptance extends Model $this->signature_filename = $signature_filename; $this->save(); - $qty = $this->qty ?? 1; - - foreach (range(0, $qty) as $count) { - /** - * Update state for the checked out item - */ - $this->checkoutable->declinedCheckout($this->assignedTo, $signature_filename); - } + /** + * Update state for the checked out item + */ + $this->checkoutable->declinedCheckout($this->assignedTo, $signature_filename); } /** diff --git a/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php b/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php index 8e59b5489c..c94af12664 100644 --- a/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php +++ b/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php @@ -103,6 +103,7 @@ class AccessoryAcceptanceTest extends TestCase */ public function test_all_accessory_checkouts_are_removed_when_user_declines_acceptance() { + // $this->markTestIncomplete(); $user = User::factory()->create(); @@ -180,7 +181,6 @@ class AccessoryAcceptanceTest extends TestCase // four rows from `accessories_checkout` should be removed $this->assertEquals($originalAccessoryCheckoutCount - 4, AccessoryCheckout::count()); - // @todo: // ensure existing checkouts for the user are not affected. // in other words, make sure the removal of rows from `accessories_checkout` is not too eager, especially around legacy behavior. // ie...if a user accepted previous accessories then those should not be touched.