Remove total qty of accessory checkouts
This commit is contained in:
@@ -108,10 +108,14 @@ class CheckoutAcceptance extends Model
|
||||
$this->signature_filename = $signature_filename;
|
||||
$this->save();
|
||||
|
||||
/**
|
||||
* Update state for the checked out item
|
||||
*/
|
||||
$this->checkoutable->declinedCheckout($this->assignedTo, $signature_filename);
|
||||
$qty = $this->qty ?? 1;
|
||||
|
||||
foreach (range(0, $qty) as $count) {
|
||||
/**
|
||||
* Update state for the checked out item
|
||||
*/
|
||||
$this->checkoutable->declinedCheckout($this->assignedTo, $signature_filename);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,7 +103,6 @@ class AccessoryAcceptanceTest extends TestCase
|
||||
*/
|
||||
public function test_all_accessory_checkouts_are_removed_when_user_declines_acceptance()
|
||||
{
|
||||
// $this->markTestIncomplete();
|
||||
|
||||
$user = User::factory()->create();
|
||||
|
||||
@@ -181,6 +180,7 @@ 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.
|
||||
|
||||
Reference in New Issue
Block a user