feat(F-185): completed feature
This commit is contained in:
@@ -19,7 +19,8 @@ export class CartService {
|
||||
|
||||
async addItem(userId: string, input: CartItemInput): Promise<CartView> {
|
||||
ensurePositiveQuantity(input.quantity);
|
||||
await this.assertStockAvailable(input.variantId, input.quantity);
|
||||
// Keep unavailable lines visible in the cart so the customer can remove or
|
||||
// replace them; checkout remains the authoritative stock gate.
|
||||
return this.toView(await this.carts.addItem(userId, input));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user