refactor(stock): centralize reservation aggregate

This commit is contained in:
2026-08-25 15:05:23 -03:00
parent 843659583e
commit 24bfef431b
18 changed files with 783 additions and 419 deletions

View File

@@ -161,13 +161,14 @@ class CompleteCheckoutService
]);
}
try {
$this->reservations->commit($cartItem, $selection, $purchase);
} catch (\InvalidArgumentException) {
throw ValidationException::withMessages([
'items' => __('api.purchase.inconsistent_reservation'),
]);
}
}
try {
$this->reservations->commit($purchase);
} catch (\InvalidArgumentException) {
throw ValidationException::withMessages([
'items' => __('api.purchase.inconsistent_reservation'),
]);
}
$this->sourceCart->finalize($purchase);