@endora-commerce/contracts 0.100.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.
Files changed (327) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/dist/actor.d.ts +79 -0
  4. package/dist/actor.d.ts.map +1 -0
  5. package/dist/actor.js +41 -0
  6. package/dist/actor.js.map +1 -0
  7. package/dist/addresses.d.ts +134 -0
  8. package/dist/addresses.d.ts.map +1 -0
  9. package/dist/addresses.js +16 -0
  10. package/dist/addresses.js.map +1 -0
  11. package/dist/admin-actions.d.ts +367 -0
  12. package/dist/admin-actions.d.ts.map +1 -0
  13. package/dist/admin-actions.js +287 -0
  14. package/dist/admin-actions.js.map +1 -0
  15. package/dist/admin-contributions.d.ts +518 -0
  16. package/dist/admin-contributions.d.ts.map +1 -0
  17. package/dist/admin-contributions.js +495 -0
  18. package/dist/admin-contributions.js.map +1 -0
  19. package/dist/admin-i18n.d.ts +135 -0
  20. package/dist/admin-i18n.d.ts.map +1 -0
  21. package/dist/admin-i18n.js +72 -0
  22. package/dist/admin-i18n.js.map +1 -0
  23. package/dist/admin-notifications.d.ts +55 -0
  24. package/dist/admin-notifications.d.ts.map +1 -0
  25. package/dist/admin-notifications.js +16 -0
  26. package/dist/admin-notifications.js.map +1 -0
  27. package/dist/admin-roles.d.ts +125 -0
  28. package/dist/admin-roles.d.ts.map +1 -0
  29. package/dist/admin-roles.js +2 -0
  30. package/dist/admin-roles.js.map +1 -0
  31. package/dist/admin-users.d.ts +178 -0
  32. package/dist/admin-users.d.ts.map +1 -0
  33. package/dist/admin-users.js +14 -0
  34. package/dist/admin-users.js.map +1 -0
  35. package/dist/admin.d.ts +243 -0
  36. package/dist/admin.d.ts.map +1 -0
  37. package/dist/admin.js +246 -0
  38. package/dist/admin.js.map +1 -0
  39. package/dist/analytics.d.ts +123 -0
  40. package/dist/analytics.d.ts.map +1 -0
  41. package/dist/analytics.js +68 -0
  42. package/dist/analytics.js.map +1 -0
  43. package/dist/api-keys.d.ts +97 -0
  44. package/dist/api-keys.d.ts.map +1 -0
  45. package/dist/api-keys.js +64 -0
  46. package/dist/api-keys.js.map +1 -0
  47. package/dist/assets-library.d.ts +684 -0
  48. package/dist/assets-library.d.ts.map +1 -0
  49. package/dist/assets-library.js +181 -0
  50. package/dist/assets-library.js.map +1 -0
  51. package/dist/audit-logs.d.ts +141 -0
  52. package/dist/audit-logs.d.ts.map +1 -0
  53. package/dist/audit-logs.js +31 -0
  54. package/dist/audit-logs.js.map +1 -0
  55. package/dist/auth.d.ts +174 -0
  56. package/dist/auth.d.ts.map +1 -0
  57. package/dist/auth.js +27 -0
  58. package/dist/auth.js.map +1 -0
  59. package/dist/blog.d.ts +669 -0
  60. package/dist/blog.d.ts.map +1 -0
  61. package/dist/blog.js +360 -0
  62. package/dist/blog.js.map +1 -0
  63. package/dist/capabilities.d.ts +40 -0
  64. package/dist/capabilities.d.ts.map +1 -0
  65. package/dist/capabilities.js +38 -0
  66. package/dist/capabilities.js.map +1 -0
  67. package/dist/carts.d.ts +1367 -0
  68. package/dist/carts.d.ts.map +1 -0
  69. package/dist/carts.js +405 -0
  70. package/dist/carts.js.map +1 -0
  71. package/dist/catalog.d.ts +2855 -0
  72. package/dist/catalog.d.ts.map +1 -0
  73. package/dist/catalog.js +1543 -0
  74. package/dist/catalog.js.map +1 -0
  75. package/dist/cms.d.ts +872 -0
  76. package/dist/cms.d.ts.map +1 -0
  77. package/dist/cms.js +468 -0
  78. package/dist/cms.js.map +1 -0
  79. package/dist/common.d.ts +82 -0
  80. package/dist/common.d.ts.map +1 -0
  81. package/dist/common.js +72 -0
  82. package/dist/common.js.map +1 -0
  83. package/dist/comparisons.d.ts +487 -0
  84. package/dist/comparisons.d.ts.map +1 -0
  85. package/dist/comparisons.js +221 -0
  86. package/dist/comparisons.js.map +1 -0
  87. package/dist/credentials.d.ts +292 -0
  88. package/dist/credentials.d.ts.map +1 -0
  89. package/dist/credentials.js +142 -0
  90. package/dist/credentials.js.map +1 -0
  91. package/dist/credit-limits.d.ts +111 -0
  92. package/dist/credit-limits.d.ts.map +1 -0
  93. package/dist/credit-limits.js +35 -0
  94. package/dist/credit-limits.js.map +1 -0
  95. package/dist/currencies.d.ts +127 -0
  96. package/dist/currencies.d.ts.map +1 -0
  97. package/dist/currencies.js +20 -0
  98. package/dist/currencies.js.map +1 -0
  99. package/dist/custom-fields.d.ts +345 -0
  100. package/dist/custom-fields.d.ts.map +1 -0
  101. package/dist/custom-fields.js +185 -0
  102. package/dist/custom-fields.js.map +1 -0
  103. package/dist/customer-accounts.d.ts +690 -0
  104. package/dist/customer-accounts.d.ts.map +1 -0
  105. package/dist/customer-accounts.js +41 -0
  106. package/dist/customer-accounts.js.map +1 -0
  107. package/dist/customers.d.ts +305 -0
  108. package/dist/customers.d.ts.map +1 -0
  109. package/dist/customers.js +158 -0
  110. package/dist/customers.js.map +1 -0
  111. package/dist/dictionary.d.ts +580 -0
  112. package/dist/dictionary.d.ts.map +1 -0
  113. package/dist/dictionary.js +297 -0
  114. package/dist/dictionary.js.map +1 -0
  115. package/dist/email-address.d.ts +62 -0
  116. package/dist/email-address.d.ts.map +1 -0
  117. package/dist/email-address.js +64 -0
  118. package/dist/email-address.js.map +1 -0
  119. package/dist/email.d.ts +175 -0
  120. package/dist/email.d.ts.map +1 -0
  121. package/dist/email.js +45 -0
  122. package/dist/email.js.map +1 -0
  123. package/dist/envelopes.d.ts +15 -0
  124. package/dist/envelopes.d.ts.map +1 -0
  125. package/dist/envelopes.js +16 -0
  126. package/dist/envelopes.js.map +1 -0
  127. package/dist/environment-inputs.d.ts +306 -0
  128. package/dist/environment-inputs.d.ts.map +1 -0
  129. package/dist/environment-inputs.js +277 -0
  130. package/dist/environment-inputs.js.map +1 -0
  131. package/dist/erp-connector.d.ts +52 -0
  132. package/dist/erp-connector.d.ts.map +1 -0
  133. package/dist/erp-connector.js +34 -0
  134. package/dist/erp-connector.js.map +1 -0
  135. package/dist/errors.d.ts +455 -0
  136. package/dist/errors.d.ts.map +1 -0
  137. package/dist/errors.js +532 -0
  138. package/dist/errors.js.map +1 -0
  139. package/dist/google-analytics.d.ts +181 -0
  140. package/dist/google-analytics.d.ts.map +1 -0
  141. package/dist/google-analytics.js +176 -0
  142. package/dist/google-analytics.js.map +1 -0
  143. package/dist/google-tag-manager.d.ts +111 -0
  144. package/dist/google-tag-manager.d.ts.map +1 -0
  145. package/dist/google-tag-manager.js +129 -0
  146. package/dist/google-tag-manager.js.map +1 -0
  147. package/dist/i18n.d.ts +69 -0
  148. package/dist/i18n.d.ts.map +1 -0
  149. package/dist/i18n.js +59 -0
  150. package/dist/i18n.js.map +1 -0
  151. package/dist/import-export.d.ts +63 -0
  152. package/dist/import-export.d.ts.map +1 -0
  153. package/dist/import-export.js +37 -0
  154. package/dist/import-export.js.map +1 -0
  155. package/dist/index.d.ts +82 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +126 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/inventory.d.ts +673 -0
  160. package/dist/inventory.d.ts.map +1 -0
  161. package/dist/inventory.js +412 -0
  162. package/dist/inventory.js.map +1 -0
  163. package/dist/invoice-ledger.d.ts +366 -0
  164. package/dist/invoice-ledger.d.ts.map +1 -0
  165. package/dist/invoice-ledger.js +114 -0
  166. package/dist/invoice-ledger.js.map +1 -0
  167. package/dist/invoices.d.ts +845 -0
  168. package/dist/invoices.d.ts.map +1 -0
  169. package/dist/invoices.js +314 -0
  170. package/dist/invoices.js.map +1 -0
  171. package/dist/kernel.d.ts +49 -0
  172. package/dist/kernel.d.ts.map +1 -0
  173. package/dist/kernel.js +19 -0
  174. package/dist/kernel.js.map +1 -0
  175. package/dist/languages.d.ts +122 -0
  176. package/dist/languages.d.ts.map +1 -0
  177. package/dist/languages.js +24 -0
  178. package/dist/languages.js.map +1 -0
  179. package/dist/linkedin-ads.d.ts +167 -0
  180. package/dist/linkedin-ads.d.ts.map +1 -0
  181. package/dist/linkedin-ads.js +156 -0
  182. package/dist/linkedin-ads.js.map +1 -0
  183. package/dist/megamenu.d.ts +556 -0
  184. package/dist/megamenu.d.ts.map +1 -0
  185. package/dist/megamenu.js +186 -0
  186. package/dist/megamenu.js.map +1 -0
  187. package/dist/meta-ads.d.ts +126 -0
  188. package/dist/meta-ads.d.ts.map +1 -0
  189. package/dist/meta-ads.js +112 -0
  190. package/dist/meta-ads.js.map +1 -0
  191. package/dist/mfa.d.ts +274 -0
  192. package/dist/mfa.d.ts.map +1 -0
  193. package/dist/mfa.js +187 -0
  194. package/dist/mfa.js.map +1 -0
  195. package/dist/modules.d.ts +1706 -0
  196. package/dist/modules.d.ts.map +1 -0
  197. package/dist/modules.js +1390 -0
  198. package/dist/modules.js.map +1 -0
  199. package/dist/newsletter.d.ts +611 -0
  200. package/dist/newsletter.d.ts.map +1 -0
  201. package/dist/newsletter.js +345 -0
  202. package/dist/newsletter.js.map +1 -0
  203. package/dist/orders.d.ts +1175 -0
  204. package/dist/orders.d.ts.map +1 -0
  205. package/dist/orders.js +630 -0
  206. package/dist/orders.js.map +1 -0
  207. package/dist/organizations.d.ts +938 -0
  208. package/dist/organizations.d.ts.map +1 -0
  209. package/dist/organizations.js +418 -0
  210. package/dist/organizations.js.map +1 -0
  211. package/dist/pagination.d.ts +21 -0
  212. package/dist/pagination.d.ts.map +1 -0
  213. package/dist/pagination.js +22 -0
  214. package/dist/pagination.js.map +1 -0
  215. package/dist/payment-methods.d.ts +472 -0
  216. package/dist/payment-methods.d.ts.map +1 -0
  217. package/dist/payment-methods.js +175 -0
  218. package/dist/payment-methods.js.map +1 -0
  219. package/dist/payment-return-url.d.ts +53 -0
  220. package/dist/payment-return-url.d.ts.map +1 -0
  221. package/dist/payment-return-url.js +35 -0
  222. package/dist/payment-return-url.js.map +1 -0
  223. package/dist/payments.d.ts +386 -0
  224. package/dist/payments.d.ts.map +1 -0
  225. package/dist/payments.js +84 -0
  226. package/dist/payments.js.map +1 -0
  227. package/dist/pim-connector.d.ts +60 -0
  228. package/dist/pim-connector.d.ts.map +1 -0
  229. package/dist/pim-connector.js +43 -0
  230. package/dist/pim-connector.js.map +1 -0
  231. package/dist/pim-field-path.d.ts +6 -0
  232. package/dist/pim-field-path.d.ts.map +1 -0
  233. package/dist/pim-field-path.js +101 -0
  234. package/dist/pim-field-path.js.map +1 -0
  235. package/dist/platform-language.d.ts +20 -0
  236. package/dist/platform-language.d.ts.map +1 -0
  237. package/dist/platform-language.js +22 -0
  238. package/dist/platform-language.js.map +1 -0
  239. package/dist/price-lists.d.ts +685 -0
  240. package/dist/price-lists.d.ts.map +1 -0
  241. package/dist/price-lists.js +330 -0
  242. package/dist/price-lists.js.map +1 -0
  243. package/dist/product-feeds.d.ts +2837 -0
  244. package/dist/product-feeds.d.ts.map +1 -0
  245. package/dist/product-feeds.js +1504 -0
  246. package/dist/product-feeds.js.map +1 -0
  247. package/dist/product-scope-overrides.d.ts +134 -0
  248. package/dist/product-scope-overrides.d.ts.map +1 -0
  249. package/dist/product-scope-overrides.js +82 -0
  250. package/dist/product-scope-overrides.js.map +1 -0
  251. package/dist/product-value-resolver.d.ts +88 -0
  252. package/dist/product-value-resolver.d.ts.map +1 -0
  253. package/dist/product-value-resolver.js +128 -0
  254. package/dist/product-value-resolver.js.map +1 -0
  255. package/dist/promotions.d.ts +678 -0
  256. package/dist/promotions.d.ts.map +1 -0
  257. package/dist/promotions.js +479 -0
  258. package/dist/promotions.js.map +1 -0
  259. package/dist/prompt-actions.d.ts +582 -0
  260. package/dist/prompt-actions.d.ts.map +1 -0
  261. package/dist/prompt-actions.js +221 -0
  262. package/dist/prompt-actions.js.map +1 -0
  263. package/dist/pwa.d.ts +293 -0
  264. package/dist/pwa.d.ts.map +1 -0
  265. package/dist/pwa.js +204 -0
  266. package/dist/pwa.js.map +1 -0
  267. package/dist/quick-order.d.ts +340 -0
  268. package/dist/quick-order.d.ts.map +1 -0
  269. package/dist/quick-order.js +177 -0
  270. package/dist/quick-order.js.map +1 -0
  271. package/dist/quote-requests.d.ts +538 -0
  272. package/dist/quote-requests.d.ts.map +1 -0
  273. package/dist/quote-requests.js +308 -0
  274. package/dist/quote-requests.js.map +1 -0
  275. package/dist/returns.d.ts +774 -0
  276. package/dist/returns.d.ts.map +1 -0
  277. package/dist/returns.js +389 -0
  278. package/dist/returns.js.map +1 -0
  279. package/dist/sales-channels.d.ts +392 -0
  280. package/dist/sales-channels.d.ts.map +1 -0
  281. package/dist/sales-channels.js +285 -0
  282. package/dist/sales-channels.js.map +1 -0
  283. package/dist/scope-notice.d.ts +60 -0
  284. package/dist/scope-notice.d.ts.map +1 -0
  285. package/dist/scope-notice.js +56 -0
  286. package/dist/scope-notice.js.map +1 -0
  287. package/dist/search.d.ts +321 -0
  288. package/dist/search.d.ts.map +1 -0
  289. package/dist/search.js +160 -0
  290. package/dist/search.js.map +1 -0
  291. package/dist/seo.d.ts +113 -0
  292. package/dist/seo.d.ts.map +1 -0
  293. package/dist/seo.js +63 -0
  294. package/dist/seo.js.map +1 -0
  295. package/dist/settings.d.ts +453 -0
  296. package/dist/settings.d.ts.map +1 -0
  297. package/dist/settings.js +337 -0
  298. package/dist/settings.js.map +1 -0
  299. package/dist/shipments.d.ts +140 -0
  300. package/dist/shipments.d.ts.map +1 -0
  301. package/dist/shipments.js +14 -0
  302. package/dist/shipments.js.map +1 -0
  303. package/dist/shipping-methods.d.ts +350 -0
  304. package/dist/shipping-methods.d.ts.map +1 -0
  305. package/dist/shipping-methods.js +99 -0
  306. package/dist/shipping-methods.js.map +1 -0
  307. package/dist/shopping-lists.d.ts +122 -0
  308. package/dist/shopping-lists.d.ts.map +1 -0
  309. package/dist/shopping-lists.js +92 -0
  310. package/dist/shopping-lists.js.map +1 -0
  311. package/dist/taxes.d.ts +106 -0
  312. package/dist/taxes.d.ts.map +1 -0
  313. package/dist/taxes.js +80 -0
  314. package/dist/taxes.js.map +1 -0
  315. package/dist/text-normalization.d.ts +199 -0
  316. package/dist/text-normalization.d.ts.map +1 -0
  317. package/dist/text-normalization.js +205 -0
  318. package/dist/text-normalization.js.map +1 -0
  319. package/dist/transactional-emails.d.ts +459 -0
  320. package/dist/transactional-emails.d.ts.map +1 -0
  321. package/dist/transactional-emails.js +212 -0
  322. package/dist/transactional-emails.js.map +1 -0
  323. package/dist/webhooks.d.ts +69 -0
  324. package/dist/webhooks.d.ts.map +1 -0
  325. package/dist/webhooks.js +53 -0
  326. package/dist/webhooks.js.map +1 -0
  327. package/package.json +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../src/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAGxB,CAAC;AAIX,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;iBAmB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;2BAoB3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiFtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAIhD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBAuClC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;iBAIzC,CAAC;AACH,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B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEpC;;;;;;;;OAQG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CACtD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC"}
package/dist/orders.js ADDED
@@ -0,0 +1,630 @@
1
+ import { z } from 'zod';
2
+ import { addressSnapshotSchema, isoDateTimeSchema, multilingualStringSchema, paymentStatusSchema, uuidSchema, } from './common.js';
3
+ /**
4
+ * Orders module contracts — Source of truth per Principle V.
5
+ * See specs/001-b2b-platform-foundation/contracts/orders.contract.md.
6
+ */
7
+ /**
8
+ * Configurable order status code (feature 038). Was a fixed enum
9
+ * (`orderStatusSchema`); with the data-driven lifecycle the authoritative
10
+ * status is a code validated in-service against the configured `order_statuses`
11
+ * set.
12
+ */
13
+ export const orderStatusCodeSchema = z
14
+ .string()
15
+ .regex(/^[a-z][a-z0-9_]*$/, 'status code must be snake_case')
16
+ .max(64);
17
+ // --- Resource types --------------------------------------------------------
18
+ export const orderItemSchema = z.object({
19
+ id: uuidSchema,
20
+ productId: uuidSchema,
21
+ productSnapshot: z.object({
22
+ sku: z.string(),
23
+ name: z.string(),
24
+ primaryAssetUrl: z.string().url().nullable(),
25
+ }),
26
+ variantId: uuidSchema.nullable(),
27
+ variantSnapshot: z
28
+ .object({
29
+ sku: z.string(),
30
+ label: z.string(),
31
+ })
32
+ .nullable(),
33
+ quantity: z.number().int().positive(),
34
+ unitPrice: z.number().finite().nonnegative(),
35
+ taxRate: z.number().finite().nonnegative(),
36
+ lineTotal: z.number().finite().nonnegative(),
37
+ });
38
+ export const nextActionSchema = z.discriminatedUnion('kind', [
39
+ z.object({
40
+ kind: z.literal('redirect_to_gateway'),
41
+ url: z.string().url(),
42
+ expiresAt: isoDateTimeSchema,
43
+ }),
44
+ z.object({
45
+ kind: z.literal('awaiting_transfer'),
46
+ accountDetails: z.object({
47
+ accountNumber: z.string(),
48
+ accountHolder: z.string(),
49
+ bankName: z.string(),
50
+ amount: z.number().finite(),
51
+ currency: z.string().length(3),
52
+ reference: z.string(),
53
+ }),
54
+ }),
55
+ z.object({
56
+ kind: z.literal('none'),
57
+ }),
58
+ ]);
59
+ export const orderSchema = z.object({
60
+ id: uuidSchema,
61
+ /**
62
+ * Customer-facing business Order ID (feature 036). Distinct from the
63
+ * database `id` (UUID): `${prefix}${sequence}${suffix}`, where prefix/suffix
64
+ * come from the `orders.business_id.*` settings. This is the identifier
65
+ * shown to the Customer; `id` stays internal.
66
+ */
67
+ businessId: z.string(),
68
+ organizationId: uuidSchema,
69
+ placedByCustomerAccountId: uuidSchema,
70
+ placedOnBehalfByAdminUserId: uuidSchema.nullable(),
71
+ salesChannelId: uuidSchema,
72
+ status: orderStatusCodeSchema,
73
+ /** Localized status labels; resolve statusName[language] → statusDefaultName → status. */
74
+ statusName: multilingualStringSchema.optional(),
75
+ statusDefaultName: z.string().optional(),
76
+ paymentStatus: paymentStatusSchema,
77
+ deliveryAddress: addressSnapshotSchema,
78
+ billingAddress: addressSnapshotSchema,
79
+ deliveryPoint: z
80
+ .object({
81
+ provider: z.string(),
82
+ pointId: z.string(),
83
+ label: z.string().nullable().optional(),
84
+ address: z.string().nullable().optional(),
85
+ })
86
+ .nullable()
87
+ .optional(),
88
+ deliveryMethod: z.object({
89
+ id: uuidSchema,
90
+ code: z.string(),
91
+ name: z.string(),
92
+ cost: z.number().finite().nonnegative(),
93
+ }),
94
+ paymentMethod: z.object({
95
+ id: uuidSchema,
96
+ code: z.string(),
97
+ name: z.string(),
98
+ kind: z.enum(['bank_transfer', 'pickup', 'credit_limit', 'gateway']),
99
+ }),
100
+ sourceQuoteRequestId: uuidSchema.nullable(),
101
+ items: z.array(orderItemSchema),
102
+ subtotal: z.number().finite().nonnegative(),
103
+ taxTotal: z.number().finite().nonnegative(),
104
+ discountTotal: z.number().finite().nonnegative(),
105
+ /** Feature 045 (US2) — per-promotion discount breakdown. */
106
+ appliedPromotions: z
107
+ .array(z.object({
108
+ promotionId: uuidSchema,
109
+ couponId: uuidSchema.nullable(),
110
+ amount: z.number().finite().nonnegative(),
111
+ currency: z.string().length(3),
112
+ }))
113
+ .default([]),
114
+ deliveryTotal: z.number().finite().nonnegative(),
115
+ total: z.number().finite().nonnegative(),
116
+ currency: z.string().length(3),
117
+ placedAt: isoDateTimeSchema,
118
+ customerNote: z.string().nullable(),
119
+ nextAction: nextActionSchema.nullable(),
120
+ /**
121
+ * Whether the buyer reading this order may cancel it (feature 085, FR-018).
122
+ *
123
+ * A **capability computed by the platform**, not a fact about the order: it
124
+ * combines the money axis, the configured status graph and the payment
125
+ * method's configured failure status, and it is scoped to the account asking
126
+ * — an Organization colleague may read a peer's order and never cancel it.
127
+ * The storefront renders its control on this value alone and re-derives
128
+ * nothing, because two of the three inputs are configuration the storefront
129
+ * does not have and must not be given.
130
+ *
131
+ * Present on the buyer-facing order reads (`GET /api/v1/orders`,
132
+ * `GET /api/v1/orders/:id` and the placement reply). Absent on the admin
133
+ * reads, where an administrator's power to cancel carries no payment-state
134
+ * condition at all (FR-017), so a per-order capability there would describe a
135
+ * narrowing that does not exist.
136
+ */
137
+ customerCancellable: z.boolean().optional(),
138
+ });
139
+ // --- Requests --------------------------------------------------------------
140
+ export const placeOrderRequestSchema = z.object({
141
+ deliveryAddressId: uuidSchema,
142
+ billingAddressId: uuidSchema,
143
+ deliveryMethodId: uuidSchema,
144
+ paymentMethodId: uuidSchema,
145
+ salesChannelId: uuidSchema.optional(),
146
+ promotionCode: z.string().optional(),
147
+ customerNote: z.string().max(4000).optional(),
148
+ idempotencyKey: z.string().optional(),
149
+ /**
150
+ * Optional billing-company override. When provided (non-empty), it
151
+ * replaces the Organization name on the order's billing snapshot; otherwise
152
+ * the snapshot defaults to the Organization's legal/display name.
153
+ */
154
+ billingCompanyName: z.string().max(255).optional(),
155
+ /**
156
+ * Optional billing tax-id (NIP) override. When provided (non-empty), it
157
+ * replaces the Organization tax-id on the order's billing snapshot;
158
+ * otherwise the snapshot defaults to the Organization's tax-id.
159
+ */
160
+ billingTaxId: z.string().max(32).optional(),
161
+ /**
162
+ * Optional pickup-point metadata selected at checkout. Provider-agnostic,
163
+ * so any carrier adapter can read one normalized snapshot from the order.
164
+ */
165
+ deliveryPoint: z
166
+ .object({
167
+ provider: z.string().min(1),
168
+ pointId: z.string().min(1),
169
+ label: z.string().max(255).optional(),
170
+ address: z.string().max(500).optional(),
171
+ })
172
+ .optional(),
173
+ /**
174
+ * Optional adapter-specific shipping payload persisted on the order
175
+ * (feature 068). Shape is interpreted by the selected delivery method's
176
+ * ShippingAdapter. InPost locker: `{ targetPoint: string }`.
177
+ */
178
+ shippingAdapterData: z.record(z.string(), z.unknown()).optional(),
179
+ });
180
+ /**
181
+ * Read-only order-total preview for the active cart with a chosen delivery +
182
+ * payment method (feature 049). Computes the exact total server-side — including
183
+ * per-product VAT, delivery cost, payment surcharge, and promotion discount —
184
+ * so the storefront never re-derives pricing on the client. `billingAddressId`
185
+ * refines the tax country to match placement; omit ⇒ the organization's country.
186
+ */
187
+ export const orderPreviewTotalRequestSchema = z.object({
188
+ deliveryMethodId: uuidSchema,
189
+ paymentMethodId: uuidSchema,
190
+ billingAddressId: uuidSchema.optional(),
191
+ });
192
+ export const orderPreviewTotalResponseSchema = z.object({
193
+ subtotal: z.number(),
194
+ taxTotal: z.number(),
195
+ deliveryTotal: z.number(),
196
+ paymentSurcharge: z.number(),
197
+ discountTotal: z.number(),
198
+ total: z.number(),
199
+ currency: z.string(),
200
+ });
201
+ export const adminOrderStatusTransitionSchema = z.object({
202
+ to: orderStatusCodeSchema,
203
+ reason: z.string().optional(),
204
+ });
205
+ export const adminOrderPaymentStatusTransitionSchema = z.object({
206
+ to: z.enum(['paid', 'refunded']),
207
+ reason: z.string().optional(),
208
+ invoiceId: uuidSchema.optional(),
209
+ });
210
+ export const adminOrderRefundRequestSchema = z.object({
211
+ amount: z.number().finite().positive().optional(),
212
+ });
213
+ export const adminOrderShippedRequestSchema = z.object({
214
+ trackingNumber: z.string(),
215
+ carrierCode: z.string(),
216
+ shippedAt: isoDateTimeSchema,
217
+ });
218
+ // ===========================================================================
219
+ // Feature 038 — Orders module (configurable lifecycle + admin operations)
220
+ // ===========================================================================
221
+ // --- Status configuration --------------------------------------------------
222
+ /**
223
+ * Status badge colour — an arbitrary `#rrggbb` hex value. The admin colour
224
+ * picker offers a curated preset palette plus a free custom colour. The default
225
+ * is a neutral slate, matching the legacy uncoloured look.
226
+ */
227
+ export const ORDER_STATUS_DEFAULT_COLOR = '#64748b';
228
+ /** Curated preset palette surfaced by the admin colour picker. */
229
+ export const ORDER_STATUS_COLOR_PRESETS = [
230
+ '#64748b', // slate (neutral)
231
+ '#3b82f6', // blue
232
+ '#10b981', // emerald
233
+ '#f59e0b', // amber
234
+ '#ef4444', // red
235
+ '#8b5cf6', // purple
236
+ ];
237
+ export const orderStatusColorSchema = z
238
+ .string()
239
+ .regex(/^#[0-9a-fA-F]{6}$/, 'Colour must be a #rrggbb hex value');
240
+ export const orderStatusDefSchema = z.object({
241
+ code: orderStatusCodeSchema,
242
+ name: multilingualStringSchema,
243
+ /** Language-independent fallback used when the active language is missing from `name`. */
244
+ defaultName: z.string(),
245
+ isInitial: z.boolean(),
246
+ isTerminal: z.boolean(),
247
+ isSystem: z.boolean(),
248
+ weight: z.number().int(),
249
+ /** Badge colour for this status (defaults to `neutral`). */
250
+ color: orderStatusColorSchema,
251
+ /** # of orders currently in this status — drives the delete-guard UI. */
252
+ inUseCount: z.number().int().nonnegative(),
253
+ });
254
+ export const orderStatusTransitionDtoSchema = z.object({
255
+ fromStatusCode: orderStatusCodeSchema,
256
+ toStatusCode: orderStatusCodeSchema,
257
+ isSystem: z.boolean(),
258
+ });
259
+ export const orderStatusGraphResponseSchema = z.object({
260
+ statuses: z.array(orderStatusDefSchema),
261
+ transitions: z.array(orderStatusTransitionDtoSchema),
262
+ });
263
+ export const createOrderStatusRequestSchema = z.object({
264
+ code: orderStatusCodeSchema,
265
+ name: multilingualStringSchema,
266
+ defaultName: z.string().min(1),
267
+ isTerminal: z.boolean().optional(),
268
+ weight: z.number().int().optional(),
269
+ color: orderStatusColorSchema.optional(),
270
+ });
271
+ export const updateOrderStatusRequestSchema = z.object({
272
+ name: multilingualStringSchema.optional(),
273
+ defaultName: z.string().min(1).optional(),
274
+ isTerminal: z.boolean().optional(),
275
+ weight: z.number().int().optional(),
276
+ color: orderStatusColorSchema.optional(),
277
+ });
278
+ export const setOrderTransitionsRequestSchema = z.object({
279
+ add: z.array(z.object({ fromStatusCode: orderStatusCodeSchema, toStatusCode: orderStatusCodeSchema })).optional(),
280
+ remove: z.array(z.object({ fromStatusCode: orderStatusCodeSchema, toStatusCode: orderStatusCodeSchema })).optional(),
281
+ });
282
+ // --- Admin orders list / search / bulk / export ----------------------------
283
+ /**
284
+ * Query-string list params arrive as a single value (`?k=a`) or repeated
285
+ * (`?k=a&k=b`). Normalise both to a `T[]` so the multiselect filters always
286
+ * see an array. Empty / absent ⇒ `undefined`.
287
+ */
288
+ function multiQueryParam(schema) {
289
+ return z
290
+ .union([schema, z.array(schema)])
291
+ .optional()
292
+ .transform((v) => v === undefined ? undefined : Array.isArray(v) ? v : [v]);
293
+ }
294
+ export const adminOrdersListQuerySchema = z.object({
295
+ // Multi-select filters (accept repeated query params).
296
+ status: multiQueryParam(orderStatusCodeSchema),
297
+ /**
298
+ * The money axis (feature 085, FR-021).
299
+ *
300
+ * The list could filter on eight things and none of them was payment status,
301
+ * so "which orders have a failed payment?" was a question the orders screen
302
+ * could not answer — and after this feature a platform administrator is the
303
+ * only actor who can rescue a held order whose buyer cannot.
304
+ *
305
+ * Validated against `paymentStatusSchema` rather than a free string: unlike
306
+ * the lifecycle status, the money axis is a fixed vocabulary and not an
307
+ * operator-configurable table.
308
+ */
309
+ paymentStatus: multiQueryParam(paymentStatusSchema),
310
+ salesChannelId: multiQueryParam(uuidSchema),
311
+ paymentMethodId: multiQueryParam(uuidSchema),
312
+ deliveryMethodId: multiQueryParam(uuidSchema),
313
+ organizationId: uuidSchema.optional(),
314
+ q: z.string().max(200).optional(),
315
+ // Dedicated org / customer name filters (free-text, AND-combined with `q`).
316
+ orgName: z.string().max(200).optional(),
317
+ customerName: z.string().max(200).optional(),
318
+ placedFrom: isoDateTimeSchema.optional(),
319
+ placedTo: isoDateTimeSchema.optional(),
320
+ // Order-total range (inclusive).
321
+ totalMin: z.coerce.number().nonnegative().optional(),
322
+ totalMax: z.coerce.number().nonnegative().optional(),
323
+ sort: z.string().optional(),
324
+ page: z.coerce.number().int().positive().default(1),
325
+ pageSize: z.coerce.number().int().positive().max(200).default(25),
326
+ });
327
+ export const adminOrderRowSchema = z.object({
328
+ id: uuidSchema,
329
+ businessId: z.string(),
330
+ customerName: z.string().nullable(),
331
+ organizationId: uuidSchema,
332
+ organizationName: z.string().nullable(),
333
+ status: orderStatusCodeSchema,
334
+ statusName: multilingualStringSchema,
335
+ paymentStatus: paymentStatusSchema,
336
+ total: z.number().finite().nonnegative(),
337
+ currency: z.string().length(3),
338
+ placedAt: isoDateTimeSchema,
339
+ createdAt: isoDateTimeSchema,
340
+ salesChannelId: uuidSchema,
341
+ salesChannelName: z.string().nullable(),
342
+ deliveryMethodName: z.string().nullable(),
343
+ paymentMethodName: z.string().nullable(),
344
+ shipToName: z.string().nullable(),
345
+ billToName: z.string().nullable(),
346
+ });
347
+ export const adminOrdersListResponseSchema = z.object({
348
+ data: z.array(adminOrderRowSchema),
349
+ pagination: z.object({
350
+ page: z.number().int().positive(),
351
+ pageSize: z.number().int().positive(),
352
+ total: z.number().int().nonnegative(),
353
+ }),
354
+ /** Per **lifecycle status** counts, keyed by status code. */
355
+ counts: z.record(z.string(), z.number().int().nonnegative()).optional(),
356
+ /**
357
+ * Per **payment status** counts, keyed by payment status (feature 085,
358
+ * FR-021).
359
+ *
360
+ * A second map rather than more keys in `counts`, because one map cannot
361
+ * carry both axes: `paid` is a shipped *order* status code **and** a payment
362
+ * status, so a merged map would silently add two different populations
363
+ * together under one key — and an operator may name a custom order status
364
+ * anything, including `failed` or `refunded`.
365
+ *
366
+ * Each axis's counts are computed over every other filter but its own, which
367
+ * is what makes an option's number mean "this is what selecting it would
368
+ * yield". That is the semantics `counts` already had for the status
369
+ * multi-select; this map extends it symmetrically, and with no payment-status
370
+ * filter applied `counts` is exactly what it was before.
371
+ */
372
+ paymentStatusCounts: z.record(z.string(), z.number().int().nonnegative()).optional(),
373
+ });
374
+ export const bulkOrderStatusRequestSchema = z.object({
375
+ orderIds: z.array(uuidSchema).min(1),
376
+ toStatusCode: orderStatusCodeSchema,
377
+ reason: z.string().max(2000).optional(),
378
+ });
379
+ export const bulkOrderStatusResponseSchema = z.object({
380
+ changed: z.array(uuidSchema),
381
+ skipped: z.array(z.object({
382
+ orderId: uuidSchema,
383
+ reason: z.enum(['invalid_transition', 'terminal', 'not_found']),
384
+ })),
385
+ });
386
+ export const bulkPrintInvoicesRequestSchema = z.object({
387
+ orderIds: z.array(uuidSchema).min(1),
388
+ });
389
+ // --- Saved list views ------------------------------------------------------
390
+ export const orderSavedViewSortSchema = z.object({
391
+ field: z.string(),
392
+ dir: z.enum(['asc', 'desc']),
393
+ });
394
+ export const orderSavedViewSchema = z.object({
395
+ id: uuidSchema,
396
+ name: z.string().min(1).max(160),
397
+ shared: z.boolean(),
398
+ ownerAdminUserId: uuidSchema,
399
+ filters: z.record(z.string(), z.unknown()),
400
+ sort: orderSavedViewSortSchema,
401
+ /** Column-picker selection. `null` ⇒ fall back to the default-visible set. */
402
+ visibleColumns: z.array(z.string()).nullable().optional(),
403
+ });
404
+ export const createOrderSavedViewRequestSchema = z.object({
405
+ name: z.string().min(1).max(160),
406
+ shared: z.boolean(),
407
+ filters: z.record(z.string(), z.unknown()),
408
+ sort: orderSavedViewSortSchema,
409
+ visibleColumns: z.array(z.string()).nullable().optional(),
410
+ });
411
+ export const updateOrderSavedViewRequestSchema = createOrderSavedViewRequestSchema.partial();
412
+ // --- Admin create order on behalf of a customer ----------------------------
413
+ export const adminCreateOrderItemSchema = z.object({
414
+ productId: uuidSchema,
415
+ variantId: uuidSchema.optional(),
416
+ quantity: z.number().int().positive(),
417
+ });
418
+ /**
419
+ * A brand-new address typed inline on the admin create-order form, instead of
420
+ * picking an existing one from the customer's organization address book. The
421
+ * address is always snapshotted onto the order; `saveToAddressBook` controls
422
+ * whether it is also persisted to the org book for reuse (false = one-time).
423
+ */
424
+ export const adminCreateOrderInlineAddressSchema = z.object({
425
+ recipientName: z.string().min(1).max(160),
426
+ street: z.string().min(1).max(255),
427
+ city: z.string().min(1).max(120),
428
+ postalCode: z.string().min(1).max(20),
429
+ country: z.string().length(2),
430
+ phone: z.string().max(32).optional(),
431
+ saveToAddressBook: z.boolean(),
432
+ });
433
+ export const adminCreateOrderRequestSchema = z
434
+ .object({
435
+ customerAccountId: uuidSchema,
436
+ salesChannelId: uuidSchema,
437
+ items: z.array(adminCreateOrderItemSchema).min(1),
438
+ deliveryMethodId: uuidSchema,
439
+ paymentMethodId: uuidSchema,
440
+ /**
441
+ * Per address side, supply EITHER an existing org address id OR an inline
442
+ * new address — exactly one of each pair (enforced below). The id path is
443
+ * the original US3 behavior; the inline path is the create-new-address flow.
444
+ */
445
+ deliveryAddressId: uuidSchema.optional(),
446
+ billingAddressId: uuidSchema.optional(),
447
+ deliveryAddress: adminCreateOrderInlineAddressSchema.optional(),
448
+ billingAddress: adminCreateOrderInlineAddressSchema.optional(),
449
+ customerNote: z.string().max(4000).optional(),
450
+ comment: z
451
+ .object({
452
+ body: z.string().min(1).max(8000),
453
+ isCustomerVisible: z.boolean(),
454
+ notifyCustomer: z.boolean(),
455
+ })
456
+ .optional(),
457
+ })
458
+ .superRefine((val, ctx) => {
459
+ if ((val.deliveryAddressId == null) === (val.deliveryAddress == null)) {
460
+ ctx.addIssue({
461
+ code: 'custom',
462
+ path: ['deliveryAddressId'],
463
+ message: 'Provide exactly one of deliveryAddressId or deliveryAddress.',
464
+ });
465
+ }
466
+ if ((val.billingAddressId == null) === (val.billingAddress == null)) {
467
+ ctx.addIssue({
468
+ code: 'custom',
469
+ path: ['billingAddressId'],
470
+ message: 'Provide exactly one of billingAddressId or billingAddress.',
471
+ });
472
+ }
473
+ });
474
+ // --- External order intake (feature 062, contracts/orders-api-key-intake.md) ---
475
+ /**
476
+ * Inline address for the external order-intake body — the admin-create
477
+ * pattern: per side, the caller supplies EITHER an existing org address id OR
478
+ * an inline address. `saveToAddressBook` defaults to a one-time address (the
479
+ * org book stays clean; the order keeps its own snapshot).
480
+ */
481
+ export const apiInlineAddressSchema = z.object({
482
+ recipientName: z.string().min(1).max(160),
483
+ street: z.string().min(1).max(255),
484
+ city: z.string().min(1).max(120),
485
+ postalCode: z.string().min(1).max(20),
486
+ country: z.string().length(2),
487
+ phone: z.string().max(32).optional(),
488
+ saveToAddressBook: z.boolean().default(false),
489
+ });
490
+ /**
491
+ * `POST /api/v1/external/orders` body (bound API keys only). Line items are
492
+ * addressed by SKU + quantity; the response reuses the existing serialized
493
+ * order envelope — no bespoke partner DTO.
494
+ */
495
+ export const apiPlaceOrderRequestSchema = z
496
+ .object({
497
+ lines: z
498
+ .array(z.object({
499
+ sku: z.string().min(1),
500
+ quantity: z.number().int().min(1),
501
+ }))
502
+ .min(1),
503
+ deliveryMethodId: uuidSchema,
504
+ paymentMethodId: uuidSchema,
505
+ deliveryAddressId: uuidSchema.optional(),
506
+ billingAddressId: uuidSchema.optional(),
507
+ deliveryAddress: apiInlineAddressSchema.optional(),
508
+ billingAddress: apiInlineAddressSchema.optional(),
509
+ /** Partner's own order number → persisted as the order `customerNote`. */
510
+ customerReference: z.string().max(160).optional(),
511
+ })
512
+ .superRefine((val, ctx) => {
513
+ if ((val.deliveryAddressId == null) === (val.deliveryAddress == null)) {
514
+ ctx.addIssue({
515
+ code: 'custom',
516
+ path: ['deliveryAddressId'],
517
+ message: 'Provide exactly one of deliveryAddressId or deliveryAddress.',
518
+ });
519
+ }
520
+ if ((val.billingAddressId == null) === (val.billingAddress == null)) {
521
+ ctx.addIssue({
522
+ code: 'custom',
523
+ path: ['billingAddressId'],
524
+ message: 'Provide exactly one of billingAddressId or billingAddress.',
525
+ });
526
+ }
527
+ });
528
+ // --- Admin order pricing preview (live summary on the create form) ---------
529
+ export const adminOrderPreviewRequestSchema = z.object({
530
+ customerAccountId: uuidSchema,
531
+ salesChannelId: uuidSchema,
532
+ items: z.array(adminCreateOrderItemSchema).min(1),
533
+ deliveryMethodId: uuidSchema.optional(),
534
+ paymentMethodId: uuidSchema.optional(),
535
+ });
536
+ export const adminOrderPreviewLineSchema = z.object({
537
+ productId: uuidSchema,
538
+ variantId: z.string().nullable().optional(),
539
+ quantity: z.number().int().positive(),
540
+ unitPrice: z.string(),
541
+ currency: z.string(),
542
+ lineTotal: z.number(),
543
+ unavailable: z.boolean().optional(),
544
+ });
545
+ export const adminOrderPreviewResponseSchema = z.object({
546
+ lines: z.array(adminOrderPreviewLineSchema),
547
+ summary: z.object({
548
+ subtotal: z.number(),
549
+ taxTotal: z.number(),
550
+ deliveryTotal: z.number(),
551
+ paymentSurcharge: z.number(),
552
+ discountTotal: z.number(),
553
+ total: z.number(),
554
+ currency: z.string(),
555
+ }),
556
+ messages: z.array(z.object({ productId: uuidSchema, code: z.string() })),
557
+ });
558
+ // --- Comments --------------------------------------------------------------
559
+ export const orderCommentSchema = z.object({
560
+ id: uuidSchema,
561
+ orderId: uuidSchema,
562
+ authorAdminUserId: uuidSchema.nullable(),
563
+ authorCustomerAccountId: uuidSchema.nullable(),
564
+ body: z.string(),
565
+ isCustomerVisible: z.boolean(),
566
+ notifyCustomer: z.boolean(),
567
+ createdAt: isoDateTimeSchema,
568
+ });
569
+ export const adminAddOrderCommentRequestSchema = z.object({
570
+ body: z.string().min(1).max(8000),
571
+ isCustomerVisible: z.boolean(),
572
+ notifyCustomer: z.boolean(),
573
+ });
574
+ export const customerAddOrderCommentRequestSchema = z.object({
575
+ body: z.string().min(1).max(8000),
576
+ });
577
+ // --- Reorder & clone-to-quote ----------------------------------------------
578
+ export const reorderUnavailableItemSchema = z.object({
579
+ productId: uuidSchema,
580
+ variantId: uuidSchema.nullable().optional(),
581
+ reason: z.enum(['discontinued', 'out_of_catalog_scope', 'out_of_stock', 'no_price']),
582
+ });
583
+ export const customerReorderResponseSchema = z.object({
584
+ cartId: uuidSchema,
585
+ checkoutUrl: z.string(),
586
+ unavailableItems: z.array(reorderUnavailableItemSchema),
587
+ });
588
+ export const adminReorderResponseSchema = z.object({
589
+ newOrderId: uuidSchema.optional(),
590
+ cartId: uuidSchema.optional(),
591
+ unavailableItems: z.array(reorderUnavailableItemSchema),
592
+ });
593
+ export const cloneOrderToQuoteResponseSchema = z.object({
594
+ quoteRequestId: uuidSchema,
595
+ });
596
+ // ---------------------------------------------------------------------------
597
+ // --- ports -----------------------------------------------------------------
598
+ //
599
+ // The in-process surface `orders` publishes to the eleven modules that read it
600
+ // (feature 075, Phase P). Plain TypeScript, not Zod: these describe in-process
601
+ // calls, not an API boundary.
602
+ // ---------------------------------------------------------------------------
603
+ /**
604
+ * The two lifecycle statuses that are **not** admin-configurable, materialised
605
+ * with universal edges at seed time (feature 038, data-model.md §2), plus the
606
+ * initial one.
607
+ *
608
+ * Published as **constants, not a port** (FR-013): switching `orders` off does
609
+ * not change the spelling of `'on_hold'`, and a gated port answering 503 to
610
+ * "what is the on-hold status code" would be a bug. `payments` compares against
611
+ * the first of them when a gateway reports a partial capture.
612
+ */
613
+ export const ORDER_STATUS_ON_HOLD = 'on_hold';
614
+ export const ORDER_STATUS_CANCELLED = 'cancelled';
615
+ export const ORDER_STATUS_INITIAL = 'new';
616
+ /**
617
+ * The answer to a buyer-side claim on an order's GA4 `purchase` conversion
618
+ * (issue #277).
619
+ *
620
+ * `counted: true` means this caller is the one that may report the conversion;
621
+ * every later caller, on any device, gets `false`. The storefront asks before
622
+ * it fires, so the tag runs once per order and never again — which is what
623
+ * stops a buyer who reopens their order from being counted twice, and what
624
+ * lets the two surfaces that may count an order (`/checkout/success` and
625
+ * `/orders/:id`) share one answer instead of guessing about each other.
626
+ */
627
+ export const purchaseConversionClaimResponseSchema = z.object({
628
+ counted: z.boolean(),
629
+ });
630
+ //# sourceMappingURL=orders.js.map