sinfactura-types 1.10.342 → 1.10.343

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cart.d.ts +20 -0
  2. package/package.json +1 -1
package/dist/cart.d.ts CHANGED
@@ -716,6 +716,26 @@ declare global {
716
716
  * race gets the same permanent answer either way.
717
717
  */
718
718
  type CouponRefusal = 'COUPON_NOT_FOUND' | 'COUPON_NOT_ACTIVE' | 'COUPON_EXPIRED' | 'COUPON_EXHAUSTED' | 'COUPON_EXHAUSTED_AT_CHECKOUT' | 'COUPON_MIN_SUBTOTAL' | 'COUPON_REQUIRES_CUSTOMER' | 'COUPON_BUDGET_EXHAUSTED' | 'COUPON_RATE_LIMITED' | 'COUPON_CURRENCY_MISMATCH';
719
+ /**
720
+ * Why a promotion is not available to a cart.
721
+ *
722
+ * ⚠️ **Raised at TWO points with the same vocabulary, and the second is the
723
+ * one that matters.** Applying a promotion judges these once
724
+ * (`400`, the shopper chose something unavailable); CHECKOUT re-judges them
725
+ * against a fresh promotion row and answers `409 CART_PROMOTION_UNAVAILABLE`
726
+ * carrying this code in `data.reason`. The cart's frozen `CartPromotion`
727
+ * holds only the mechanic TERMS — no window, no status — so nothing on the
728
+ * cart-write path can notice a promotion that ended after it was applied.
729
+ *
730
+ * ⚠️ The CHECKOUT refusal is never the shopper's fault. There is no
731
+ * `_AT_CHECKOUT` split here, unlike {@link CouponRefusal}: a coupon splits
732
+ * because a per-customer cap can be raced by the SAME shopper submitting
733
+ * twice, so "you already used this" is sometimes true. A promotion carries
734
+ * no per-customer counter and no global one, so every checkout-time refusal
735
+ * means the merchant changed something while the cart sat. Copy should say
736
+ * so, and must not imply the shopper did anything.
737
+ */
738
+ type PromotionRefusal = 'PROMOTION_NOT_FOUND' | 'PROMOTION_NOT_ACTIVE' | 'PROMOTION_NOT_STARTED' | 'PROMOTION_EXPIRED' | 'PROMOTION_NOT_CART_APPLICABLE';
719
739
  /**
720
740
  * The request body for every cart mutation, discriminated on `mode`.
721
741
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.342",
3
+ "version": "1.10.343",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",