From ba1355448a18fb19feb52100a3d295e5cae2e628 Mon Sep 17 00:00:00 2001 From: ncoronel Date: Wed, 26 Aug 2026 10:30:16 -0300 Subject: [PATCH] Squashed commit of the following: commit cd99a6489be225c522596c09c4426e63df7373b9 Merge: ebcbbb1 e63a036 Author: ncoronel Date: Wed Aug 26 10:12:44 2026 -0300 Merge branch 'fix/simplify_stock_reservations' of https://gitea.quo.ar/tbianchini/shopit-back into fix/simplify_stock_reservations commit ebcbbb17743a6aedecddab45ed63b7a0a981ab99 Author: ncoronel Date: Tue Aug 25 16:33:39 2026 -0300 fix(cart): reconcile expired cart mutations commit 3dd378ed0667448f08c1055d3e03853cc4cb51e1 Author: ncoronel Date: Tue Aug 25 16:10:15 2026 -0300 docs(stock): describe associated entity expiration commit 4f705175bddd0f8d733969d17b1dfe1e9a93ef01 Author: ncoronel Date: Tue Aug 25 16:10:14 2026 -0300 test(stock): cover propagated reservation expiration commit 82570fe94101e8547fad96e130222a03c60ce33f Author: ncoronel Date: Tue Aug 25 16:09:52 2026 -0300 refactor(stock): propagate reservation expiration commit d2a2b323e09a188b7519d7441d09725459ec6936 Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 docs(stock): document terminal reservation recovery commit ec67623b7b9035d8f4e2d6365d75eee4f3673466 Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 test(stock): cover terminal reservation lifecycle commit f6f138e180f82d883dac6cd4d8a9bd9ba15add49 Author: ncoronel Date: Tue Aug 25 15:58:41 2026 -0300 refactor(stock): make expired reservations terminal commit d612b7a118b6f24f3ee78f9dd9f12eb4ca5ce148 Author: ncoronel Date: Tue Aug 25 15:28:30 2026 -0300 docs(stock): describe unified expiration ownership commit 49f42d450747e51d08cfd1cb3ba65953e72a2d21 Author: ncoronel Date: Tue Aug 25 15:28:23 2026 -0300 test(stock): cover authoritative reservation expiration commit 1881cc1d4b5f8a3874c5e7a6bf04f35ccc589085 Author: ncoronel Date: Tue Aug 25 15:28:17 2026 -0300 refactor(stock): make reservation expiration authoritative commit 00ec37d8a05143b921435c7eb0c93f656f8f2691 Author: ncoronel Date: Tue Aug 25 15:05:34 2026 -0300 docs(stock): document centralized reservation flow commit d9f374c718bafaf23e24fe60de66d31056ad59e2 Author: ncoronel Date: Tue Aug 25 15:05:29 2026 -0300 test(stock): cover aggregate reservation lifecycle commit bbfdf8f3429b7811dc250a8c3e2b7b21a961c0ea Author: ncoronel Date: Tue Aug 25 15:05:23 2026 -0300 refactor(stock): centralize reservation aggregate commit 8a0f29bdaea0288ac74676b7252209f39add39e2 Author: ncoronel Date: Tue Aug 25 16:33:39 2026 -0300 fix(cart): reconcile expired cart mutations commit 198ed400a9c227923b1043e1ac8a388045cb0d09 Author: ncoronel Date: Tue Aug 25 16:10:15 2026 -0300 docs(stock): describe associated entity expiration commit 23d83166e61c37ebcad109864190b2e983480fa7 Author: ncoronel Date: Tue Aug 25 16:10:14 2026 -0300 test(stock): cover propagated reservation expiration commit cb090402d0764c6aff1cfed49854b0d23e55627f Author: ncoronel Date: Tue Aug 25 16:09:52 2026 -0300 refactor(stock): propagate reservation expiration commit c120b6f7c0f037b959dceb220f1b20ab97a0b36a Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 docs(stock): document terminal reservation recovery commit 1106fa28b4ce015666935b43bfa52d02a05beea9 Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 test(stock): cover terminal reservation lifecycle commit 896fb81bcfaa6b6a06fc6c80b80ea3816988b83c Author: ncoronel Date: Tue Aug 25 15:58:41 2026 -0300 refactor(stock): make expired reservations terminal commit 8545fbc645062c7d3b61c871e71e73956158f013 Author: ncoronel Date: Tue Aug 25 15:28:30 2026 -0300 docs(stock): describe unified expiration ownership commit dd6dcb708ab099cd97517429914bb39a4c12147e Author: ncoronel Date: Tue Aug 25 15:28:23 2026 -0300 test(stock): cover authoritative reservation expiration commit 624b246ff5a98d019ebffb5ab2a27afbfacf6cf9 Author: ncoronel Date: Tue Aug 25 15:28:17 2026 -0300 refactor(stock): make reservation expiration authoritative commit 007b95b9046f5d5a9154ac8fb90af3d79b3def9d Author: ncoronel Date: Tue Aug 25 15:05:34 2026 -0300 docs(stock): document centralized reservation flow commit 0b3c8c93be9b69bf9b153f9a0c705886f8c1529e Author: ncoronel Date: Tue Aug 25 15:05:29 2026 -0300 test(stock): cover aggregate reservation lifecycle commit ede718e44808353bb2a49e1c9318ba7abd56af2d Author: ncoronel Date: Tue Aug 25 15:05:23 2026 -0300 refactor(stock): centralize reservation aggregate commit e63a03601a3e46df0b54c642b3a7f82483d2d479 Author: ncoronel Date: Tue Aug 25 16:33:39 2026 -0300 fix(cart): reconcile expired cart mutations commit 389373ad8cad749f0cf15650f74e7f4863119f75 Author: ncoronel Date: Tue Aug 25 16:10:15 2026 -0300 docs(stock): describe associated entity expiration commit ace02a31335315d71626769a2263b74819c3f883 Author: ncoronel Date: Tue Aug 25 16:10:14 2026 -0300 test(stock): cover propagated reservation expiration commit d69a6210f68871dc1a2258a93fc5d5262cab0563 Author: ncoronel Date: Tue Aug 25 16:09:52 2026 -0300 refactor(stock): propagate reservation expiration commit 3c0b43fea38c788706d525274cf60891927796a4 Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 docs(stock): document terminal reservation recovery commit 9b0008626bc5aadcd8e054e12728a702e7a80d7d Author: ncoronel Date: Tue Aug 25 15:58:47 2026 -0300 test(stock): cover terminal reservation lifecycle commit 61861e331af9160390061b1df2405b57aab44200 Author: ncoronel Date: Tue Aug 25 15:58:41 2026 -0300 refactor(stock): make expired reservations terminal commit 2cc9d7dd97fc6c2eb99af5cef157adf03f4373d4 Author: ncoronel Date: Tue Aug 25 15:28:30 2026 -0300 docs(stock): describe unified expiration ownership commit f982bcead10b1cdecf3635220a7b23776621959d Author: ncoronel Date: Tue Aug 25 15:28:23 2026 -0300 test(stock): cover authoritative reservation expiration commit 7a85e1731defb6acdbb4e0c36cd6df4db20a4766 Author: ncoronel Date: Tue Aug 25 15:28:17 2026 -0300 refactor(stock): make reservation expiration authoritative commit 6db99e775a84380d49d974a13ee3df3215d69ec4 Author: ncoronel Date: Tue Aug 25 15:05:34 2026 -0300 docs(stock): document centralized reservation flow commit e5f7ba36155a24c87fcdef7bcf3235f3fec80cb2 Author: ncoronel Date: Tue Aug 25 15:05:29 2026 -0300 test(stock): cover aggregate reservation lifecycle commit 24bfef431baa8d257ac86140c29fcf383f01347c Author: ncoronel Date: Tue Aug 25 15:05:23 2026 -0300 refactor(stock): centralize reservation aggregate --- app/Domains/Purchase/Controllers/PurchaseController.php | 6 ++++++ app/Domains/Purchase/Services/CheckoutService.php | 1 + 2 files changed, 7 insertions(+) diff --git a/app/Domains/Purchase/Controllers/PurchaseController.php b/app/Domains/Purchase/Controllers/PurchaseController.php index b175a48..455b739 100644 --- a/app/Domains/Purchase/Controllers/PurchaseController.php +++ b/app/Domains/Purchase/Controllers/PurchaseController.php @@ -140,6 +140,12 @@ class PurchaseController extends Controller $purchaseUpdate['transfer_payer_dni'] = $transferPayerDni; } $purchase->update($purchaseUpdate); + $checkoutService->refreshReservationExpiration( + $purchase, + now()->addMinutes( + max(1, (int) config("purchase.payment_expiration_minutes.{$method}", 30)), + ), + ); return true; }); diff --git a/app/Domains/Purchase/Services/CheckoutService.php b/app/Domains/Purchase/Services/CheckoutService.php index 882e235..aa786c5 100644 --- a/app/Domains/Purchase/Services/CheckoutService.php +++ b/app/Domains/Purchase/Services/CheckoutService.php @@ -8,6 +8,7 @@ use App\Domains\Purchase\Services\Checkout\EditCheckoutService; use App\Domains\Purchase\Services\Checkout\ReleaseCheckoutService; use App\Domains\Purchase\Services\Checkout\StartCheckoutService; use App\Domains\Tenant\Models\Tenant; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; /**