@endora-commerce/contracts 0.107.0 → 0.109.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 (273) hide show
  1. package/dist/admin-actions.d.ts +12 -3
  2. package/dist/admin-actions.d.ts.map +1 -1
  3. package/dist/admin-actions.js +34 -3
  4. package/dist/admin-actions.js.map +1 -1
  5. package/dist/admin-contributions.d.ts +35 -6
  6. package/dist/admin-contributions.d.ts.map +1 -1
  7. package/dist/admin-contributions.js +46 -0
  8. package/dist/admin-contributions.js.map +1 -1
  9. package/dist/admin-feedback.d.ts +61 -0
  10. package/dist/admin-feedback.d.ts.map +1 -0
  11. package/dist/admin-feedback.js +71 -0
  12. package/dist/admin-feedback.js.map +1 -0
  13. package/dist/admin-name.d.ts +21 -0
  14. package/dist/admin-name.d.ts.map +1 -0
  15. package/dist/admin-name.js +30 -0
  16. package/dist/admin-name.js.map +1 -0
  17. package/dist/admin-notifications.d.ts +17 -1
  18. package/dist/admin-notifications.d.ts.map +1 -1
  19. package/dist/admin-preferences.d.ts +108 -0
  20. package/dist/admin-preferences.d.ts.map +1 -0
  21. package/dist/admin-preferences.js +133 -0
  22. package/dist/admin-preferences.js.map +1 -0
  23. package/dist/admin.d.ts +15 -1
  24. package/dist/admin.d.ts.map +1 -1
  25. package/dist/admin.js +7 -0
  26. package/dist/admin.js.map +1 -1
  27. package/dist/assets-library.d.ts +97 -3
  28. package/dist/assets-library.d.ts.map +1 -1
  29. package/dist/assets-library.js +5 -0
  30. package/dist/assets-library.js.map +1 -1
  31. package/dist/blog.d.ts +57 -0
  32. package/dist/blog.d.ts.map +1 -1
  33. package/dist/blog.js +63 -1
  34. package/dist/blog.js.map +1 -1
  35. package/dist/carts.d.ts +303 -50
  36. package/dist/carts.d.ts.map +1 -1
  37. package/dist/carts.js +95 -13
  38. package/dist/carts.js.map +1 -1
  39. package/dist/catalog.d.ts +512 -40
  40. package/dist/catalog.d.ts.map +1 -1
  41. package/dist/catalog.js +362 -23
  42. package/dist/catalog.js.map +1 -1
  43. package/dist/cms-brand.d.ts +2233 -0
  44. package/dist/cms-brand.d.ts.map +1 -0
  45. package/dist/cms-brand.js +311 -0
  46. package/dist/cms-brand.js.map +1 -0
  47. package/dist/cms-contact-form.d.ts +55 -0
  48. package/dist/cms-contact-form.d.ts.map +1 -0
  49. package/dist/cms-contact-form.js +100 -0
  50. package/dist/cms-contact-form.js.map +1 -0
  51. package/dist/cms.d.ts +537 -3
  52. package/dist/cms.d.ts.map +1 -1
  53. package/dist/cms.js +251 -0
  54. package/dist/cms.js.map +1 -1
  55. package/dist/common.d.ts +4 -0
  56. package/dist/common.d.ts.map +1 -1
  57. package/dist/common.js +14 -0
  58. package/dist/common.js.map +1 -1
  59. package/dist/comparisons.d.ts +7 -0
  60. package/dist/comparisons.d.ts.map +1 -1
  61. package/dist/comparisons.js +2 -0
  62. package/dist/comparisons.js.map +1 -1
  63. package/dist/credit-limits.d.ts.map +1 -1
  64. package/dist/credit-limits.js +3 -2
  65. package/dist/credit-limits.js.map +1 -1
  66. package/dist/crm-rich-text.d.ts +13 -0
  67. package/dist/crm-rich-text.d.ts.map +1 -0
  68. package/dist/crm-rich-text.js +13 -0
  69. package/dist/crm-rich-text.js.map +1 -0
  70. package/dist/crm.d.ts +180 -62
  71. package/dist/crm.d.ts.map +1 -1
  72. package/dist/crm.js +63 -107
  73. package/dist/crm.js.map +1 -1
  74. package/dist/custom-fields.d.ts +436 -5
  75. package/dist/custom-fields.d.ts.map +1 -1
  76. package/dist/custom-fields.js +325 -10
  77. package/dist/custom-fields.js.map +1 -1
  78. package/dist/customer-accounts.d.ts +30 -0
  79. package/dist/customer-accounts.d.ts.map +1 -1
  80. package/dist/customer-accounts.js +31 -0
  81. package/dist/customer-accounts.js.map +1 -1
  82. package/dist/document-templates.d.ts +211 -23
  83. package/dist/document-templates.d.ts.map +1 -1
  84. package/dist/document-templates.js +98 -1
  85. package/dist/document-templates.js.map +1 -1
  86. package/dist/document-values.d.ts +12 -1
  87. package/dist/document-values.d.ts.map +1 -1
  88. package/dist/document-values.js +41 -11
  89. package/dist/document-values.js.map +1 -1
  90. package/dist/email.d.ts +5 -0
  91. package/dist/email.d.ts.map +1 -1
  92. package/dist/errors.d.ts +142 -8
  93. package/dist/errors.d.ts.map +1 -1
  94. package/dist/errors.js +189 -8
  95. package/dist/errors.js.map +1 -1
  96. package/dist/index.d.ts +24 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +43 -1
  99. package/dist/index.js.map +1 -1
  100. package/dist/inventory.d.ts +3 -3
  101. package/dist/invoices.d.ts +6 -2
  102. package/dist/invoices.d.ts.map +1 -1
  103. package/dist/invoices.js +10 -4
  104. package/dist/invoices.js.map +1 -1
  105. package/dist/line-groups.d.ts +80 -0
  106. package/dist/line-groups.d.ts.map +1 -0
  107. package/dist/line-groups.js +130 -0
  108. package/dist/line-groups.js.map +1 -0
  109. package/dist/localized-name.d.ts +20 -0
  110. package/dist/localized-name.d.ts.map +1 -0
  111. package/dist/localized-name.js +45 -0
  112. package/dist/localized-name.js.map +1 -0
  113. package/dist/megamenu.d.ts +674 -0
  114. package/dist/megamenu.d.ts.map +1 -1
  115. package/dist/megamenu.js +96 -3
  116. package/dist/megamenu.js.map +1 -1
  117. package/dist/mfa.d.ts +1 -0
  118. package/dist/mfa.d.ts.map +1 -1
  119. package/dist/mfa.js +8 -2
  120. package/dist/mfa.js.map +1 -1
  121. package/dist/modules.d.ts +8 -1
  122. package/dist/modules.d.ts.map +1 -1
  123. package/dist/modules.js +5 -0
  124. package/dist/modules.js.map +1 -1
  125. package/dist/money-decimal.d.ts +162 -0
  126. package/dist/money-decimal.d.ts.map +1 -0
  127. package/dist/money-decimal.js +365 -0
  128. package/dist/money-decimal.js.map +1 -0
  129. package/dist/money-input.d.ts +64 -0
  130. package/dist/money-input.d.ts.map +1 -0
  131. package/dist/money-input.js +111 -0
  132. package/dist/money-input.js.map +1 -0
  133. package/dist/newsletter.d.ts +3 -3
  134. package/dist/order-minimums.d.ts +111 -0
  135. package/dist/order-minimums.d.ts.map +1 -0
  136. package/dist/order-minimums.js +196 -0
  137. package/dist/order-minimums.js.map +1 -0
  138. package/dist/orders.d.ts +206 -2
  139. package/dist/orders.d.ts.map +1 -1
  140. package/dist/orders.js +106 -5
  141. package/dist/orders.js.map +1 -1
  142. package/dist/page-builder-props.d.ts +1401 -0
  143. package/dist/page-builder-props.d.ts.map +1 -0
  144. package/dist/page-builder-props.js +266 -0
  145. package/dist/page-builder-props.js.map +1 -0
  146. package/dist/page-builder-values.d.ts +95 -0
  147. package/dist/page-builder-values.d.ts.map +1 -0
  148. package/dist/page-builder-values.js +164 -0
  149. package/dist/page-builder-values.js.map +1 -0
  150. package/dist/payment-methods.d.ts.map +1 -1
  151. package/dist/payment-methods.js +2 -1
  152. package/dist/payment-methods.js.map +1 -1
  153. package/dist/pim-connector.d.ts +1 -1
  154. package/dist/platform-language.d.ts +9 -0
  155. package/dist/platform-language.d.ts.map +1 -1
  156. package/dist/platform-language.js +14 -0
  157. package/dist/platform-language.js.map +1 -1
  158. package/dist/price-book-decimal.d.ts +84 -0
  159. package/dist/price-book-decimal.d.ts.map +1 -0
  160. package/dist/price-book-decimal.js +175 -0
  161. package/dist/price-book-decimal.js.map +1 -0
  162. package/dist/price-books.d.ts +2206 -0
  163. package/dist/price-books.d.ts.map +1 -0
  164. package/dist/price-books.js +777 -0
  165. package/dist/price-books.js.map +1 -0
  166. package/dist/price-lists.d.ts +309 -614
  167. package/dist/price-lists.d.ts.map +1 -1
  168. package/dist/price-lists.js +113 -453
  169. package/dist/price-lists.js.map +1 -1
  170. package/dist/product-feeds.d.ts +195 -54
  171. package/dist/product-feeds.d.ts.map +1 -1
  172. package/dist/product-feeds.js +36 -1
  173. package/dist/product-feeds.js.map +1 -1
  174. package/dist/product-scopes.d.ts +628 -0
  175. package/dist/product-scopes.d.ts.map +1 -0
  176. package/dist/product-scopes.js +365 -0
  177. package/dist/product-scopes.js.map +1 -0
  178. package/dist/product-summary-text.d.ts +23 -0
  179. package/dist/product-summary-text.d.ts.map +1 -0
  180. package/dist/product-summary-text.js +64 -0
  181. package/dist/product-summary-text.js.map +1 -0
  182. package/dist/product-url-keys.d.ts +204 -0
  183. package/dist/product-url-keys.d.ts.map +1 -0
  184. package/dist/product-url-keys.js +166 -0
  185. package/dist/product-url-keys.js.map +1 -0
  186. package/dist/product-value-resolver.d.ts +6 -0
  187. package/dist/product-value-resolver.d.ts.map +1 -1
  188. package/dist/product-value-resolver.js +6 -1
  189. package/dist/product-value-resolver.js.map +1 -1
  190. package/dist/projects.d.ts +2355 -0
  191. package/dist/projects.d.ts.map +1 -0
  192. package/dist/projects.js +837 -0
  193. package/dist/projects.js.map +1 -0
  194. package/dist/promotions.d.ts +2 -2
  195. package/dist/promotions.d.ts.map +1 -1
  196. package/dist/promotions.js +8 -2
  197. package/dist/promotions.js.map +1 -1
  198. package/dist/prompt-actions.d.ts +19 -1
  199. package/dist/prompt-actions.d.ts.map +1 -1
  200. package/dist/prompt-actions.js +31 -2
  201. package/dist/prompt-actions.js.map +1 -1
  202. package/dist/quick-order.d.ts +39 -1
  203. package/dist/quick-order.d.ts.map +1 -1
  204. package/dist/quick-order.js +44 -1
  205. package/dist/quick-order.js.map +1 -1
  206. package/dist/quote-requests.d.ts +305 -1
  207. package/dist/quote-requests.d.ts.map +1 -1
  208. package/dist/quote-requests.js +173 -5
  209. package/dist/quote-requests.js.map +1 -1
  210. package/dist/record-references.d.ts +252 -0
  211. package/dist/record-references.d.ts.map +1 -0
  212. package/dist/record-references.js +179 -0
  213. package/dist/record-references.js.map +1 -0
  214. package/dist/record-rich-text.d.ts +66 -0
  215. package/dist/record-rich-text.d.ts.map +1 -0
  216. package/dist/record-rich-text.js +303 -0
  217. package/dist/record-rich-text.js.map +1 -0
  218. package/dist/returns.d.ts +81 -2
  219. package/dist/returns.d.ts.map +1 -1
  220. package/dist/returns.js +39 -4
  221. package/dist/returns.js.map +1 -1
  222. package/dist/sales-channels.d.ts +53 -7
  223. package/dist/sales-channels.d.ts.map +1 -1
  224. package/dist/sales-channels.js +40 -4
  225. package/dist/sales-channels.js.map +1 -1
  226. package/dist/saved-list-views.d.ts +28 -0
  227. package/dist/saved-list-views.d.ts.map +1 -1
  228. package/dist/saved-list-views.js +14 -1
  229. package/dist/saved-list-views.js.map +1 -1
  230. package/dist/scoped-translations.d.ts +48 -0
  231. package/dist/scoped-translations.d.ts.map +1 -0
  232. package/dist/scoped-translations.js +78 -0
  233. package/dist/scoped-translations.js.map +1 -0
  234. package/dist/search.d.ts +73 -5
  235. package/dist/search.d.ts.map +1 -1
  236. package/dist/search.js +4 -0
  237. package/dist/search.js.map +1 -1
  238. package/dist/seo.d.ts +64 -5
  239. package/dist/seo.d.ts.map +1 -1
  240. package/dist/seo.js +31 -4
  241. package/dist/seo.js.map +1 -1
  242. package/dist/settings.d.ts +32 -3
  243. package/dist/settings.d.ts.map +1 -1
  244. package/dist/settings.js +37 -3
  245. package/dist/settings.js.map +1 -1
  246. package/dist/shipping-methods.d.ts.map +1 -1
  247. package/dist/shipping-methods.js +2 -1
  248. package/dist/shipping-methods.js.map +1 -1
  249. package/dist/shopping-lists.d.ts +24 -0
  250. package/dist/shopping-lists.d.ts.map +1 -1
  251. package/dist/shopping-lists.js +20 -1
  252. package/dist/shopping-lists.js.map +1 -1
  253. package/dist/storefront-cache-tags.d.ts +29 -0
  254. package/dist/storefront-cache-tags.d.ts.map +1 -1
  255. package/dist/storefront-cache-tags.js +24 -0
  256. package/dist/storefront-cache-tags.js.map +1 -1
  257. package/dist/storefront-language-path.d.ts +77 -0
  258. package/dist/storefront-language-path.d.ts.map +1 -0
  259. package/dist/storefront-language-path.js +123 -0
  260. package/dist/storefront-language-path.js.map +1 -0
  261. package/dist/storefront-value-overrides.d.ts +67 -0
  262. package/dist/storefront-value-overrides.d.ts.map +1 -0
  263. package/dist/storefront-value-overrides.js +93 -0
  264. package/dist/storefront-value-overrides.js.map +1 -0
  265. package/dist/tasks.d.ts +2842 -0
  266. package/dist/tasks.d.ts.map +1 -0
  267. package/dist/tasks.js +901 -0
  268. package/dist/tasks.js.map +1 -0
  269. package/dist/transactional-emails.d.ts +7 -4
  270. package/dist/transactional-emails.d.ts.map +1 -1
  271. package/dist/transactional-emails.js +13 -0
  272. package/dist/transactional-emails.js.map +1 -1
  273. package/package.json +2 -2
package/dist/carts.d.ts CHANGED
@@ -90,11 +90,17 @@ export declare const updateCartItemRequestSchema: z.ZodObject<{
90
90
  quantity: z.ZodNumber;
91
91
  }, z.core.$strip>;
92
92
  export type UpdateCartItemRequest = z.infer<typeof updateCartItemRequestSchema>;
93
+ /**
94
+ * `working` (issue #169): a basket an order is placed from on the customer's
95
+ * behalf, beside their active basket. Never listed and never the customer's
96
+ * basket; it ends `completed` against its order or is removed.
97
+ */
93
98
  export declare const cartStatusSchema: z.ZodEnum<{
94
99
  completed: "completed";
95
100
  active: "active";
96
101
  rejected: "rejected";
97
102
  abandoned: "abandoned";
103
+ working: "working";
98
104
  }>;
99
105
  export type CartStatus = z.infer<typeof cartStatusSchema>;
100
106
  export declare const cartApprovalStatusSchema: z.ZodEnum<{
@@ -126,6 +132,7 @@ export declare const cartDroppedLineReasonSchema: z.ZodEnum<{
126
132
  out_of_stock: "out_of_stock";
127
133
  no_price_in_customer_list: "no_price_in_customer_list";
128
134
  removed_by_conversion: "removed_by_conversion";
135
+ below_minimum: "below_minimum";
129
136
  }>;
130
137
  export type CartDroppedLineReason = z.infer<typeof cartDroppedLineReasonSchema>;
131
138
  export declare const cartLineUnavailableReasonSchema: z.ZodEnum<{
@@ -138,9 +145,10 @@ export declare const cartViewLineSchema: z.ZodObject<{
138
145
  id: z.ZodString;
139
146
  productId: z.ZodString;
140
147
  variantId: z.ZodNullable<z.ZodString>;
141
- productName: z.ZodString;
142
- productSlug: z.ZodOptional<z.ZodString>;
143
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
148
+ productName: z.ZodNullable<z.ZodString>;
149
+ productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
150
+ productSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
151
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
152
  quantity: z.ZodNumber;
145
153
  unitPrice: z.ZodObject<{
146
154
  amount: z.ZodNumber;
@@ -159,13 +167,23 @@ export declare const cartViewLineSchema: z.ZodObject<{
159
167
  packagingUnitName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
168
  packagingUnitBaseQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
161
169
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
+ minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
171
+ belowMinimum: z.ZodOptional<z.ZodNullable<z.ZodObject<{
172
+ kind: z.ZodEnum<{
173
+ pieces: "pieces";
174
+ packaging_unit: "packaging_unit";
175
+ }>;
176
+ minimum: z.ZodNumber;
177
+ packagingUnitName: z.ZodOptional<z.ZodString>;
178
+ }, z.core.$strip>>>;
162
179
  }, z.core.$strip>;
163
180
  export type CartViewLine = z.infer<typeof cartViewLineSchema>;
164
181
  export declare const cartMiniLineSchema: z.ZodObject<{
165
182
  id: z.ZodString;
166
183
  productId: z.ZodString;
167
- productName: z.ZodString;
168
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
184
+ variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
185
+ productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
186
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
187
  quantity: z.ZodNumber;
170
188
  unitPrice: z.ZodObject<{
171
189
  amount: z.ZodNumber;
@@ -196,6 +214,7 @@ export declare const cartFullPayloadSchema: z.ZodObject<{
196
214
  active: "active";
197
215
  rejected: "rejected";
198
216
  abandoned: "abandoned";
217
+ working: "working";
199
218
  }>;
200
219
  approvalStatus: z.ZodEnum<{
201
220
  pending: "pending";
@@ -207,9 +226,10 @@ export declare const cartFullPayloadSchema: z.ZodObject<{
207
226
  id: z.ZodString;
208
227
  productId: z.ZodString;
209
228
  variantId: z.ZodNullable<z.ZodString>;
210
- productName: z.ZodString;
211
- productSlug: z.ZodOptional<z.ZodString>;
212
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
229
+ productName: z.ZodNullable<z.ZodString>;
230
+ productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
+ productSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
233
  quantity: z.ZodNumber;
214
234
  unitPrice: z.ZodObject<{
215
235
  amount: z.ZodNumber;
@@ -228,6 +248,15 @@ export declare const cartFullPayloadSchema: z.ZodObject<{
228
248
  packagingUnitName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
249
  packagingUnitBaseQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
230
250
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
252
+ belowMinimum: z.ZodOptional<z.ZodNullable<z.ZodObject<{
253
+ kind: z.ZodEnum<{
254
+ pieces: "pieces";
255
+ packaging_unit: "packaging_unit";
256
+ }>;
257
+ minimum: z.ZodNumber;
258
+ packagingUnitName: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>>>;
231
260
  }, z.core.$strip>>;
232
261
  itemCount: z.ZodNumber;
233
262
  subtotal: z.ZodObject<{
@@ -263,7 +292,9 @@ export declare const cartFullPayloadSchema: z.ZodObject<{
263
292
  out_of_stock: "out_of_stock";
264
293
  no_price_in_customer_list: "no_price_in_customer_list";
265
294
  removed_by_conversion: "removed_by_conversion";
295
+ below_minimum: "below_minimum";
266
296
  }>;
297
+ minimum: z.ZodOptional<z.ZodNumber>;
267
298
  }, z.core.$strip>>;
268
299
  couponDroppedThisRead: z.ZodNullable<z.ZodObject<{
269
300
  code: z.ZodString;
@@ -277,9 +308,9 @@ export declare const cartFullPayloadSchema: z.ZodObject<{
277
308
  coupon_format_invalid: "coupon_format_invalid";
278
309
  }>;
279
310
  }, z.core.$strip>>;
280
- createdAt: z.ZodString;
281
- updatedAt: z.ZodString;
282
- lastActivityAt: z.ZodString;
311
+ createdAt: z.ZodNullable<z.ZodString>;
312
+ updatedAt: z.ZodNullable<z.ZodString>;
313
+ lastActivityAt: z.ZodNullable<z.ZodString>;
283
314
  }, z.core.$strip>;
284
315
  export type CartFullPayload = z.infer<typeof cartFullPayloadSchema>;
285
316
  export declare const cartFullResponseSchema: z.ZodObject<{
@@ -294,6 +325,7 @@ export declare const cartFullResponseSchema: z.ZodObject<{
294
325
  active: "active";
295
326
  rejected: "rejected";
296
327
  abandoned: "abandoned";
328
+ working: "working";
297
329
  }>;
298
330
  approvalStatus: z.ZodEnum<{
299
331
  pending: "pending";
@@ -305,9 +337,10 @@ export declare const cartFullResponseSchema: z.ZodObject<{
305
337
  id: z.ZodString;
306
338
  productId: z.ZodString;
307
339
  variantId: z.ZodNullable<z.ZodString>;
308
- productName: z.ZodString;
309
- productSlug: z.ZodOptional<z.ZodString>;
310
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
340
+ productName: z.ZodNullable<z.ZodString>;
341
+ productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
342
+ productSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
344
  quantity: z.ZodNumber;
312
345
  unitPrice: z.ZodObject<{
313
346
  amount: z.ZodNumber;
@@ -326,6 +359,15 @@ export declare const cartFullResponseSchema: z.ZodObject<{
326
359
  packagingUnitName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
360
  packagingUnitBaseQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
328
361
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
362
+ minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
363
+ belowMinimum: z.ZodOptional<z.ZodNullable<z.ZodObject<{
364
+ kind: z.ZodEnum<{
365
+ pieces: "pieces";
366
+ packaging_unit: "packaging_unit";
367
+ }>;
368
+ minimum: z.ZodNumber;
369
+ packagingUnitName: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strip>>>;
329
371
  }, z.core.$strip>>;
330
372
  itemCount: z.ZodNumber;
331
373
  subtotal: z.ZodObject<{
@@ -361,7 +403,9 @@ export declare const cartFullResponseSchema: z.ZodObject<{
361
403
  out_of_stock: "out_of_stock";
362
404
  no_price_in_customer_list: "no_price_in_customer_list";
363
405
  removed_by_conversion: "removed_by_conversion";
406
+ below_minimum: "below_minimum";
364
407
  }>;
408
+ minimum: z.ZodOptional<z.ZodNumber>;
365
409
  }, z.core.$strip>>;
366
410
  couponDroppedThisRead: z.ZodNullable<z.ZodObject<{
367
411
  code: z.ZodString;
@@ -375,31 +419,44 @@ export declare const cartFullResponseSchema: z.ZodObject<{
375
419
  coupon_format_invalid: "coupon_format_invalid";
376
420
  }>;
377
421
  }, z.core.$strip>>;
378
- createdAt: z.ZodString;
379
- updatedAt: z.ZodString;
380
- lastActivityAt: z.ZodString;
422
+ createdAt: z.ZodNullable<z.ZodString>;
423
+ updatedAt: z.ZodNullable<z.ZodString>;
424
+ lastActivityAt: z.ZodNullable<z.ZodString>;
381
425
  }, z.core.$strip>;
382
426
  }, z.core.$strip>;
383
427
  export type CartFullResponse = z.infer<typeof cartFullResponseSchema>;
428
+ /**
429
+ * `GET /api/v1/cart?view=mini` — the header's lightweight basket (feature 027,
430
+ * FR-007).
431
+ *
432
+ * What the route answers is `id`, `itemCount`, `items` and `subtotal`, on an
433
+ * empty basket too. `status`, `approvalStatus`, `grandTotal` and `primaryCta`
434
+ * were declared required here and have **never been answered** by the mini
435
+ * view, which skips the coupon and promotion work they need on purpose; they
436
+ * are optional so the schema describes the wire (issue #128). A client that
437
+ * needs them reads the full view.
438
+ */
384
439
  export declare const cartMiniPayloadSchema: z.ZodObject<{
385
440
  id: z.ZodNullable<z.ZodString>;
386
- status: z.ZodEnum<{
441
+ status: z.ZodOptional<z.ZodEnum<{
387
442
  completed: "completed";
388
443
  active: "active";
389
444
  rejected: "rejected";
390
445
  abandoned: "abandoned";
391
- }>;
392
- approvalStatus: z.ZodEnum<{
446
+ working: "working";
447
+ }>>;
448
+ approvalStatus: z.ZodOptional<z.ZodEnum<{
393
449
  pending: "pending";
394
450
  not_required: "not_required";
395
451
  approved: "approved";
396
452
  rejected_by_org_admin: "rejected_by_org_admin";
397
- }>;
453
+ }>>;
398
454
  items: z.ZodArray<z.ZodObject<{
399
455
  id: z.ZodString;
400
456
  productId: z.ZodString;
401
- productName: z.ZodString;
402
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
457
+ variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
+ productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
459
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
403
460
  quantity: z.ZodNumber;
404
461
  unitPrice: z.ZodObject<{
405
462
  amount: z.ZodNumber;
@@ -411,38 +468,44 @@ export declare const cartMiniPayloadSchema: z.ZodObject<{
411
468
  }, z.core.$strip>;
412
469
  }, z.core.$strip>>;
413
470
  itemCount: z.ZodNumber;
414
- grandTotal: z.ZodObject<{
471
+ subtotal: z.ZodOptional<z.ZodObject<{
415
472
  amount: z.ZodNumber;
416
473
  currency: z.ZodString;
417
- }, z.core.$strip>;
418
- primaryCta: z.ZodEnum<{
474
+ }, z.core.$strip>>;
475
+ grandTotal: z.ZodOptional<z.ZodObject<{
476
+ amount: z.ZodNumber;
477
+ currency: z.ZodString;
478
+ }, z.core.$strip>>;
479
+ primaryCta: z.ZodOptional<z.ZodEnum<{
419
480
  checkout: "checkout";
420
481
  submit_for_approval: "submit_for_approval";
421
482
  awaiting_approval: "awaiting_approval";
422
483
  blocked_by_organization: "blocked_by_organization";
423
- }>;
484
+ }>>;
424
485
  }, z.core.$strip>;
425
486
  export type CartMiniPayload = z.infer<typeof cartMiniPayloadSchema>;
426
487
  export declare const cartMiniResponseSchema: z.ZodObject<{
427
488
  data: z.ZodObject<{
428
489
  id: z.ZodNullable<z.ZodString>;
429
- status: z.ZodEnum<{
490
+ status: z.ZodOptional<z.ZodEnum<{
430
491
  completed: "completed";
431
492
  active: "active";
432
493
  rejected: "rejected";
433
494
  abandoned: "abandoned";
434
- }>;
435
- approvalStatus: z.ZodEnum<{
495
+ working: "working";
496
+ }>>;
497
+ approvalStatus: z.ZodOptional<z.ZodEnum<{
436
498
  pending: "pending";
437
499
  not_required: "not_required";
438
500
  approved: "approved";
439
501
  rejected_by_org_admin: "rejected_by_org_admin";
440
- }>;
502
+ }>>;
441
503
  items: z.ZodArray<z.ZodObject<{
442
504
  id: z.ZodString;
443
505
  productId: z.ZodString;
444
- productName: z.ZodString;
445
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
506
+ variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
507
+ productName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
446
509
  quantity: z.ZodNumber;
447
510
  unitPrice: z.ZodObject<{
448
511
  amount: z.ZodNumber;
@@ -454,16 +517,20 @@ export declare const cartMiniResponseSchema: z.ZodObject<{
454
517
  }, z.core.$strip>;
455
518
  }, z.core.$strip>>;
456
519
  itemCount: z.ZodNumber;
457
- grandTotal: z.ZodObject<{
520
+ subtotal: z.ZodOptional<z.ZodObject<{
458
521
  amount: z.ZodNumber;
459
522
  currency: z.ZodString;
460
- }, z.core.$strip>;
461
- primaryCta: z.ZodEnum<{
523
+ }, z.core.$strip>>;
524
+ grandTotal: z.ZodOptional<z.ZodObject<{
525
+ amount: z.ZodNumber;
526
+ currency: z.ZodString;
527
+ }, z.core.$strip>>;
528
+ primaryCta: z.ZodOptional<z.ZodEnum<{
462
529
  checkout: "checkout";
463
530
  submit_for_approval: "submit_for_approval";
464
531
  awaiting_approval: "awaiting_approval";
465
532
  blocked_by_organization: "blocked_by_organization";
466
- }>;
533
+ }>>;
467
534
  }, z.core.$strip>;
468
535
  }, z.core.$strip>;
469
536
  export type CartMiniResponse = z.infer<typeof cartMiniResponseSchema>;
@@ -551,7 +618,9 @@ export declare const cartFromQrResponseSchema: z.ZodObject<{
551
618
  out_of_stock: "out_of_stock";
552
619
  no_price_in_customer_list: "no_price_in_customer_list";
553
620
  removed_by_conversion: "removed_by_conversion";
621
+ below_minimum: "below_minimum";
554
622
  }>;
623
+ minimum: z.ZodOptional<z.ZodNumber>;
555
624
  }, z.core.$strip>>;
556
625
  }, z.core.$strip>;
557
626
  }, z.core.$strip>;
@@ -568,7 +637,9 @@ export declare const cartFromShoppingListResponseSchema: z.ZodObject<{
568
637
  out_of_stock: "out_of_stock";
569
638
  no_price_in_customer_list: "no_price_in_customer_list";
570
639
  removed_by_conversion: "removed_by_conversion";
640
+ below_minimum: "below_minimum";
571
641
  }>;
642
+ minimum: z.ZodOptional<z.ZodNumber>;
572
643
  }, z.core.$strip>>;
573
644
  }, z.core.$strip>;
574
645
  }, z.core.$strip>;
@@ -582,6 +653,7 @@ export declare const orgCartSummarySchema: z.ZodObject<{
582
653
  active: "active";
583
654
  rejected: "rejected";
584
655
  abandoned: "abandoned";
656
+ working: "working";
585
657
  }>;
586
658
  approvalStatus: z.ZodEnum<{
587
659
  pending: "pending";
@@ -608,6 +680,7 @@ export declare const orgCartsListResponseSchema: z.ZodObject<{
608
680
  active: "active";
609
681
  rejected: "rejected";
610
682
  abandoned: "abandoned";
683
+ working: "working";
611
684
  }>;
612
685
  approvalStatus: z.ZodEnum<{
613
686
  pending: "pending";
@@ -657,6 +730,7 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
657
730
  active: "active";
658
731
  rejected: "rejected";
659
732
  abandoned: "abandoned";
733
+ working: "working";
660
734
  }>;
661
735
  approvalStatus: z.ZodEnum<{
662
736
  pending: "pending";
@@ -668,9 +742,10 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
668
742
  id: z.ZodString;
669
743
  productId: z.ZodString;
670
744
  variantId: z.ZodNullable<z.ZodString>;
671
- productName: z.ZodString;
672
- productSlug: z.ZodOptional<z.ZodString>;
673
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
745
+ productName: z.ZodNullable<z.ZodString>;
746
+ productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
747
+ productSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
748
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
674
749
  quantity: z.ZodNumber;
675
750
  unitPrice: z.ZodObject<{
676
751
  amount: z.ZodNumber;
@@ -689,6 +764,15 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
689
764
  packagingUnitName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
690
765
  packagingUnitBaseQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
691
766
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
767
+ minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
768
+ belowMinimum: z.ZodOptional<z.ZodNullable<z.ZodObject<{
769
+ kind: z.ZodEnum<{
770
+ pieces: "pieces";
771
+ packaging_unit: "packaging_unit";
772
+ }>;
773
+ minimum: z.ZodNumber;
774
+ packagingUnitName: z.ZodOptional<z.ZodString>;
775
+ }, z.core.$strip>>>;
692
776
  }, z.core.$strip>>;
693
777
  itemCount: z.ZodNumber;
694
778
  subtotal: z.ZodObject<{
@@ -724,7 +808,9 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
724
808
  out_of_stock: "out_of_stock";
725
809
  no_price_in_customer_list: "no_price_in_customer_list";
726
810
  removed_by_conversion: "removed_by_conversion";
811
+ below_minimum: "below_minimum";
727
812
  }>;
813
+ minimum: z.ZodOptional<z.ZodNumber>;
728
814
  }, z.core.$strip>>;
729
815
  couponDroppedThisRead: z.ZodNullable<z.ZodObject<{
730
816
  code: z.ZodString;
@@ -738,9 +824,9 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
738
824
  coupon_format_invalid: "coupon_format_invalid";
739
825
  }>;
740
826
  }, z.core.$strip>>;
741
- createdAt: z.ZodString;
742
- updatedAt: z.ZodString;
743
- lastActivityAt: z.ZodString;
827
+ createdAt: z.ZodNullable<z.ZodString>;
828
+ updatedAt: z.ZodNullable<z.ZodString>;
829
+ lastActivityAt: z.ZodNullable<z.ZodString>;
744
830
  ownerCustomerAccountId: z.ZodString;
745
831
  ownerDisplayName: z.ZodString;
746
832
  auditEntries: z.ZodArray<z.ZodObject<{
@@ -772,6 +858,7 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
772
858
  active: "active";
773
859
  rejected: "rejected";
774
860
  abandoned: "abandoned";
861
+ working: "working";
775
862
  }>;
776
863
  approvalStatus: z.ZodEnum<{
777
864
  pending: "pending";
@@ -783,9 +870,10 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
783
870
  id: z.ZodString;
784
871
  productId: z.ZodString;
785
872
  variantId: z.ZodNullable<z.ZodString>;
786
- productName: z.ZodString;
787
- productSlug: z.ZodOptional<z.ZodString>;
788
- productThumbnailUrl: z.ZodNullable<z.ZodString>;
873
+ productName: z.ZodNullable<z.ZodString>;
874
+ productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
875
+ productSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
876
+ productThumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
789
877
  quantity: z.ZodNumber;
790
878
  unitPrice: z.ZodObject<{
791
879
  amount: z.ZodNumber;
@@ -804,6 +892,15 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
804
892
  packagingUnitName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
805
893
  packagingUnitBaseQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
806
894
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
895
+ minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
896
+ belowMinimum: z.ZodOptional<z.ZodNullable<z.ZodObject<{
897
+ kind: z.ZodEnum<{
898
+ pieces: "pieces";
899
+ packaging_unit: "packaging_unit";
900
+ }>;
901
+ minimum: z.ZodNumber;
902
+ packagingUnitName: z.ZodOptional<z.ZodString>;
903
+ }, z.core.$strip>>>;
807
904
  }, z.core.$strip>>;
808
905
  itemCount: z.ZodNumber;
809
906
  subtotal: z.ZodObject<{
@@ -839,7 +936,9 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
839
936
  out_of_stock: "out_of_stock";
840
937
  no_price_in_customer_list: "no_price_in_customer_list";
841
938
  removed_by_conversion: "removed_by_conversion";
939
+ below_minimum: "below_minimum";
842
940
  }>;
941
+ minimum: z.ZodOptional<z.ZodNumber>;
843
942
  }, z.core.$strip>>;
844
943
  couponDroppedThisRead: z.ZodNullable<z.ZodObject<{
845
944
  code: z.ZodString;
@@ -853,9 +952,9 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
853
952
  coupon_format_invalid: "coupon_format_invalid";
854
953
  }>;
855
954
  }, z.core.$strip>>;
856
- createdAt: z.ZodString;
857
- updatedAt: z.ZodString;
858
- lastActivityAt: z.ZodString;
955
+ createdAt: z.ZodNullable<z.ZodString>;
956
+ updatedAt: z.ZodNullable<z.ZodString>;
957
+ lastActivityAt: z.ZodNullable<z.ZodString>;
859
958
  ownerCustomerAccountId: z.ZodString;
860
959
  ownerDisplayName: z.ZodString;
861
960
  auditEntries: z.ZodArray<z.ZodObject<{
@@ -913,6 +1012,7 @@ export declare const adminCartSummarySchema: z.ZodObject<{
913
1012
  active: "active";
914
1013
  rejected: "rejected";
915
1014
  abandoned: "abandoned";
1015
+ working: "working";
916
1016
  }>;
917
1017
  approvalStatus: z.ZodEnum<{
918
1018
  pending: "pending";
@@ -944,6 +1044,7 @@ export declare const adminCartsListResponseSchema: z.ZodObject<{
944
1044
  active: "active";
945
1045
  rejected: "rejected";
946
1046
  abandoned: "abandoned";
1047
+ working: "working";
947
1048
  }>;
948
1049
  approvalStatus: z.ZodEnum<{
949
1050
  pending: "pending";
@@ -973,6 +1074,7 @@ export declare const adminCartsListQuerySchema: z.ZodObject<{
973
1074
  active: "active";
974
1075
  rejected: "rejected";
975
1076
  abandoned: "abandoned";
1077
+ working: "working";
976
1078
  }>>>;
977
1079
  approvalStatus: z.ZodOptional<z.ZodArray<z.ZodEnum<{
978
1080
  pending: "pending";
@@ -1025,6 +1127,7 @@ export declare const adminCartDetailPayloadSchema: z.ZodObject<{
1025
1127
  active: "active";
1026
1128
  rejected: "rejected";
1027
1129
  abandoned: "abandoned";
1130
+ working: "working";
1028
1131
  }>;
1029
1132
  approvalStatus: z.ZodEnum<{
1030
1133
  pending: "pending";
@@ -1083,6 +1186,7 @@ export declare const adminCartDetailResponseSchema: z.ZodObject<{
1083
1186
  active: "active";
1084
1187
  rejected: "rejected";
1085
1188
  abandoned: "abandoned";
1189
+ working: "working";
1086
1190
  }>;
1087
1191
  approvalStatus: z.ZodEnum<{
1088
1192
  pending: "pending";
@@ -1253,9 +1357,39 @@ export interface CartItemRecord {
1253
1357
  packagingUnitId: string | null;
1254
1358
  packagingUnitName: string | null;
1255
1359
  packagingUnitBaseQuantity: number | null;
1360
+ /**
1361
+ * Feature 155 (FR-028) — the quantity this line was seeded with from an accepted
1362
+ * quote request; `null` for every other line. Written only by
1363
+ * `CartWritePort.replaceItemsForCustomer` with a `sourceQuoteRequestId` — it is
1364
+ * the line's agreed quantity, the one its agreed price holds at.
1365
+ */
1366
+ quoteSeededQuantity: number | null;
1367
+ /**
1368
+ * Issue #167 — the accepted Quote Request this line's agreement was seeded from; `null` (or
1369
+ * absent) on every line that carries none. Written with {@link quoteSeededQuantity}, and read
1370
+ * at order placement, which refuses the line at its agreed price once that quote's validity
1371
+ * has ended or it is no longer in force.
1372
+ */
1373
+ quoteRequestId?: string | null;
1374
+ /**
1375
+ * Feature 160 (FR-030) — which tier priced `unitPrice` (`base`, `catalogue`,
1376
+ * `buyer`, `sale`), or `agreed`; `null` for a line priced before the feature.
1377
+ * Order placement copies it onto the order line.
1378
+ */
1379
+ priceSource?: 'agreed' | 'base' | 'catalogue' | 'buyer' | 'sale' | null;
1256
1380
  createdAt: Date;
1257
1381
  updatedAt: Date;
1258
1382
  }
1383
+ /**
1384
+ * Feature 155 (FR-028, owner ruling P2; data-model §2) — whether a basket line is
1385
+ * exempt from the catalogue's order minimums: it was seeded from an accepted quote,
1386
+ * the basket still carries that quote as its source, and the line's quantity equals
1387
+ * the quote's. State-based, so 5 → 12 → 5 is exempt again.
1388
+ *
1389
+ * The per-line half only: `carts` applies it to the basket's mark at face value;
1390
+ * `orders` first decides whether the quote source honours exemptions at all (R19).
1391
+ */
1392
+ export declare function isQuoteSeededLineExempt(cart: Pick<CartRecord, 'sourceQuoteRequestId'>, item: Pick<CartItemRecord, 'quantity' | 'quoteSeededQuantity'>): boolean;
1259
1393
  /** A cart with its lines — the unit every consumer actually wants. */
1260
1394
  export interface CartWithItems {
1261
1395
  cart: CartRecord;
@@ -1273,6 +1407,23 @@ export interface CartSeedLine {
1273
1407
  export interface CartSeedOptions {
1274
1408
  /** The accepted Quote Request these lines are the agreed lines of. */
1275
1409
  sourceQuoteRequestId?: string | null;
1410
+ /**
1411
+ * Issue #166 — leave out of the basket every seed line that has no price
1412
+ * this customer may order it at now (no price list and no price of its own,
1413
+ * or sold on request only), and name them in the answer's `unorderable`.
1414
+ * A reorder sets it, so the buyer is told rather than handed a basket
1415
+ * placement refuses. Ignored for an agreed seed (`sourceQuoteRequestId`),
1416
+ * whose lines are priced by their agreement. Absent, such a line is kept at
1417
+ * the price it was seeded with, as before.
1418
+ */
1419
+ dropUnorderable?: boolean;
1420
+ }
1421
+ /** A seed line `dropUnorderable` left out, and why (issue #166). */
1422
+ export interface CartSeedUnorderableLine {
1423
+ productId: string;
1424
+ variantId: string | null;
1425
+ /** `unpriced`: nothing prices it for this customer; `quote_only`: sold on request only. */
1426
+ reason: 'unpriced' | 'quote_only';
1276
1427
  }
1277
1428
  /**
1278
1429
  * Container name: `cartReadPort`. Owner: `carts`.
@@ -1337,6 +1488,49 @@ export interface CartReadPort {
1337
1488
  * `activation` to say, not this line's: a module declaring
1338
1489
  * `nonDeactivatable` never enters one.
1339
1490
  */
1491
+ /**
1492
+ * Feature 155 (research R8) — one line of a batch add (`CartWritePort.addItems`).
1493
+ * The fields of `addItem`'s line.
1494
+ */
1495
+ export interface CartBatchLineInput {
1496
+ productId: string;
1497
+ variantId?: string;
1498
+ /** Pieces, or units when `packagingUnitId` is set — as `addItem`. */
1499
+ quantity: number;
1500
+ packagingUnitId?: string;
1501
+ /** As `addItem`'s: set only by an operator surface that names the channel itself. */
1502
+ salesChannelId?: string;
1503
+ }
1504
+ /**
1505
+ * Feature 155 (research R8) — what became of one batch line, at its input `index`.
1506
+ *
1507
+ * A `failed` line carries the refusal it met and nothing about the product: a
1508
+ * product the caller may not see fails with the unknown id's `404`, never with a
1509
+ * name or a minimum (FR-035, threat F1).
1510
+ */
1511
+ export type CartBatchLineOutcome = {
1512
+ index: number;
1513
+ status: 'added';
1514
+ } | {
1515
+ index: number;
1516
+ status: 'below_minimum';
1517
+ productId: string;
1518
+ /** In `options.language`, the language the response is answered in. */
1519
+ productName: string;
1520
+ kind: 'pieces' | 'packaging_unit';
1521
+ minimum: number;
1522
+ packagingUnitName?: string;
1523
+ } | {
1524
+ index: number;
1525
+ status: 'failed';
1526
+ /** The refusal as `addItem` threw it; `details` only when it carried any. */
1527
+ error: {
1528
+ status: number;
1529
+ code: string;
1530
+ message: string;
1531
+ details?: unknown;
1532
+ };
1533
+ };
1340
1534
  export interface CartWritePort {
1341
1535
  getOrCreateForCustomer(ctx: CartCustomerContext): Promise<CartRecord>;
1342
1536
  addItem(actor: {
@@ -1354,7 +1548,64 @@ export interface CartWritePort {
1354
1548
  * never by a buyer-facing route.
1355
1549
  */
1356
1550
  salesChannelId?: string;
1551
+ },
1552
+ /** The language a minimum refusal names the product in (feature 155, D3/D4). */
1553
+ options?: {
1554
+ language?: string;
1357
1555
  }): Promise<CartWithItems>;
1556
+ /**
1557
+ * Feature 155 (R8) — add several lines. (1) Every line is resolved with exactly
1558
+ * `addItem`'s preconditions (quantity, visibility, channel, packaging unit in
1559
+ * product); a line that fails gets the unknown-id answer and takes no part in
1560
+ * the evaluation. (2) The resolved lines are judged with the cart in two passes
1561
+ * — unit minimums, then pieces minimums over the survivors; lines below a
1562
+ * minimum are not added and are reported. Lines already in the cart are never
1563
+ * rejected. (3) The accepted lines are added.
1564
+ *
1565
+ * `onLineError: 'throw'` — the first resolution failure is thrown before
1566
+ * anything is written; a later add failure is thrown as `addItem` would (lines
1567
+ * before it stay added). `'report'` — every failure is returned as `failed`.
1568
+ *
1569
+ * `onBelowMinimum: 'report'` (the default) — a line below a minimum is a
1570
+ * `below_minimum` outcome. `'throw'` — any such line refuses the whole batch
1571
+ * after step (2) and before anything is written: `422
1572
+ * PRODUCT_BELOW_MINIMUM_QUANTITY` / `PACKAGING_UNIT_BELOW_MINIMUM_QUANTITY`,
1573
+ * every offending line in `details.lines` keyed by its `index`.
1574
+ *
1575
+ * `workingBasket` (a customer actor only; issue #169) — the batch is written
1576
+ * into a fresh **working** basket of the customer's on the actor's channel,
1577
+ * never into the active one, which stays exactly as it was: step (2) judges
1578
+ * the batch alone, and the working basket is created only after steps (1) and
1579
+ * (2) pass and removed again when step (3) refuses a line, so a refused
1580
+ * request writes nothing. The returned cart is that working basket; its id is
1581
+ * what `OrderPlacementPort.placeOrder`'s `workingBasketId` places from. It
1582
+ * requires `onLineError: 'throw'`; with `'report'` the call is refused before
1583
+ * anything is read or written.
1584
+ *
1585
+ * `keepRepeatedLines` (with `workingBasket` only) — every line stays a line
1586
+ * of its own: a repeated `(product, variant, unit)` is not merged into the
1587
+ * first, each line is priced at its own quantity, and the basket reads back in
1588
+ * the batch's order. Minimums are still judged on a product's total. Feature
1589
+ * 159 (research N-31): the admin order creation's one product on lines of
1590
+ * several groups.
1591
+ *
1592
+ * `ModuleDisabledError` is always thrown. At most `CART_MAX_LINES` (200) lines.
1593
+ *
1594
+ * `language` names a refused product — the language the response is answered
1595
+ * in (`request.responseLanguage()`); absent, the record's own fallback chain.
1596
+ */
1597
+ addItems(actor: {
1598
+ customer?: CartCustomerContext;
1599
+ anonymousToken?: string;
1600
+ }, lines: readonly CartBatchLineInput[], options: {
1601
+ onLineError: 'throw' | 'report';
1602
+ onBelowMinimum?: 'report' | 'throw';
1603
+ workingBasket?: boolean;
1604
+ keepRepeatedLines?: boolean;
1605
+ language?: string;
1606
+ }): Promise<CartWithItems & {
1607
+ outcomes: CartBatchLineOutcome[];
1608
+ }>;
1358
1609
  clearForCustomer(ctx: CartCustomerContext): Promise<void>;
1359
1610
  /**
1360
1611
  * Clear the customer's active cart and seed it with these lines, creating
@@ -1368,7 +1619,9 @@ export interface CartWritePort {
1368
1619
  * The id travels the road the agreed unit prices travel — on the basket, to
1369
1620
  * placement — and is dropped again when the buyer removes the last line.
1370
1621
  */
1371
- replaceItemsForCustomer(ctx: CartCustomerContext, lines: readonly CartSeedLine[], options?: CartSeedOptions): Promise<CartWithItems>;
1622
+ replaceItemsForCustomer(ctx: CartCustomerContext, lines: readonly CartSeedLine[], options?: CartSeedOptions): Promise<CartWithItems & {
1623
+ unorderable?: CartSeedUnorderableLine[];
1624
+ }>;
1372
1625
  }
1373
1626
  export interface CartItemView {
1374
1627
  productId: string;