@doswiftly/storefront-operations 9.1.0 → 11.0.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-operations",
3
- "version": "9.1.0",
3
+ "version": "11.0.0",
4
4
  "description": "GraphQL operations for DoSwiftly Storefront - SSOT from backend",
5
5
  "homepage": "https://doswiftly.pl",
6
6
  "publishConfig": {
package/queries.graphql CHANGED
@@ -232,13 +232,27 @@ query CustomerOrder($orderId: ID!) {
232
232
  }
233
233
 
234
234
  # ============================================
235
- # Checkout
236
- # ============================================
237
-
238
- # Fetches a checkout session by `id`. **Important**: `checkoutId` and `cartId` are 1:1 there is no separate "checkout" record, the response is built dynamically from the cart. Returns line items, addresses, selected shipping rate, available shipping rates + payment methods, applied discount/gift cards (gift card codes are masked for security), and totals (`cost`, `tax`, `paymentDue`). Public read; ownership enforced on mutations. Refetch after every checkout mutation.
239
- query Checkout($id: ID!) {
240
- checkout(id: $id) {
241
- ...Checkout
235
+ # Discount Code Validation
236
+ # ============================================
237
+
238
+ # Read-only validation of a discount code against an existing cart does NOT modify cart state. Returns `{ isValid, discount, error }` (`DiscountValidationResult`) for previewing the effect of a code (inline UI feedback as the user types, before they commit to applying via `cartDiscountCodesUpdate`). Validates: discount existence + active status + customer eligibility + minimum order amount + minimum quantity met. Errors: `NOT_FOUND`, `INACTIVE`, `NOT_STARTED`, `EXPIRED`, `USAGE_LIMIT_REACHED`, `CUSTOMER_USAGE_LIMIT_REACHED`, `CUSTOMER_NOT_ELIGIBLE`, `MINIMUM_ORDER_NOT_MET`, `MINIMUM_QUANTITY_NOT_MET`.
239
+ query CartValidateDiscountCode($cartId: ID!, $discountCode: String!) {
240
+ cartValidateDiscountCode(cartId: $cartId, discountCode: $discountCode) {
241
+ isValid
242
+ discount {
243
+ code
244
+ title
245
+ type
246
+ value
247
+ discountAmount {
248
+ amount
249
+ currencyCode
250
+ }
251
+ }
252
+ error {
253
+ code
254
+ message
255
+ }
242
256
  }
243
257
  }
244
258