@endora-commerce/contracts 0.109.0 → 0.111.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 (385) hide show
  1. package/dist/accept-language.d.ts +31 -0
  2. package/dist/accept-language.js +64 -0
  3. package/dist/actor.d.ts +16 -0
  4. package/dist/addresses.d.ts +35 -0
  5. package/dist/addresses.js +8 -1
  6. package/dist/admin-actions.d.ts +2 -0
  7. package/dist/admin-actions.js +18 -0
  8. package/dist/admin-contributions.d.ts +99 -12
  9. package/dist/admin-contributions.js +36 -10
  10. package/dist/admin-roles.d.ts +17 -2
  11. package/dist/admin-users.d.ts +9 -0
  12. package/dist/admin.d.ts +114 -4
  13. package/dist/admin.js +98 -3
  14. package/dist/api-keys.d.ts +22 -0
  15. package/dist/api-keys.js +4 -0
  16. package/dist/assets-library.d.ts +45 -0
  17. package/dist/assets-library.js +20 -3
  18. package/dist/audit-logs.d.ts +12 -0
  19. package/dist/audit-logs.js +12 -0
  20. package/dist/auth.d.ts +9 -0
  21. package/dist/auth.js +9 -0
  22. package/dist/blog.d.ts +382 -22
  23. package/dist/blog.js +199 -17
  24. package/dist/carts.d.ts +423 -36
  25. package/dist/carts.js +150 -12
  26. package/dist/catalog.d.ts +379 -208
  27. package/dist/catalog.js +241 -163
  28. package/dist/cms-brand.d.ts +14 -14
  29. package/dist/cms.d.ts +71 -16
  30. package/dist/cms.js +15 -0
  31. package/dist/command-hooks.d.ts +301 -0
  32. package/dist/command-hooks.js +248 -0
  33. package/dist/common.d.ts +23 -6
  34. package/dist/common.js +25 -2
  35. package/dist/comparisons.d.ts +21 -14
  36. package/dist/comparisons.js +2 -1
  37. package/dist/credit-limits.d.ts +22 -0
  38. package/dist/credit-limits.js +35 -0
  39. package/dist/crm.d.ts +134 -78
  40. package/dist/crm.js +21 -5
  41. package/dist/custom-fields.d.ts +417 -49
  42. package/dist/custom-fields.js +142 -1
  43. package/dist/customer-accounts.d.ts +324 -22
  44. package/dist/customer-accounts.js +43 -0
  45. package/dist/customer-notifications.d.ts +143 -0
  46. package/dist/customer-notifications.js +41 -0
  47. package/dist/customers.d.ts +92 -73
  48. package/dist/customers.js +98 -10
  49. package/dist/dictionary.d.ts +53 -0
  50. package/dist/dictionary.js +25 -0
  51. package/dist/document-templates.d.ts +12 -12
  52. package/dist/email.d.ts +34 -0
  53. package/dist/email.js +6 -0
  54. package/dist/errors.d.ts +431 -3
  55. package/dist/errors.js +523 -3
  56. package/dist/forms-logic.d.ts +79 -0
  57. package/dist/forms-logic.fixtures.d.ts +52 -0
  58. package/dist/forms-logic.fixtures.js +610 -0
  59. package/dist/forms-logic.js +699 -0
  60. package/dist/forms.d.ts +9833 -0
  61. package/dist/forms.js +827 -0
  62. package/dist/i18n.d.ts +34 -0
  63. package/dist/i18n.js +15 -0
  64. package/dist/import-export.d.ts +180 -0
  65. package/dist/import-export.js +60 -0
  66. package/dist/index.d.ts +16 -1
  67. package/dist/index.js +30 -1
  68. package/dist/inventory.d.ts +9 -9
  69. package/dist/invoice-ledger.d.ts +13 -13
  70. package/dist/invoices.d.ts +126 -0
  71. package/dist/invoices.js +53 -0
  72. package/dist/line-bounds.d.ts +53 -0
  73. package/dist/line-bounds.js +65 -0
  74. package/dist/megamenu.d.ts +27 -27
  75. package/dist/mfa.d.ts +210 -4
  76. package/dist/mfa.js +136 -0
  77. package/dist/modules.d.ts +56 -8
  78. package/dist/modules.js +128 -3
  79. package/dist/money-decimal.d.ts +54 -0
  80. package/dist/money-decimal.js +95 -0
  81. package/dist/newsletter.d.ts +4 -4
  82. package/dist/orders.d.ts +246 -12
  83. package/dist/orders.js +140 -7
  84. package/dist/organization-hooks.d.ts +99 -0
  85. package/dist/organization-hooks.js +22 -0
  86. package/dist/organization-registry-lookup.d.ts +362 -0
  87. package/dist/organization-registry-lookup.js +196 -0
  88. package/dist/organization-roles.d.ts +341 -0
  89. package/dist/organization-roles.js +218 -0
  90. package/dist/organizations.d.ts +1074 -103
  91. package/dist/organizations.js +293 -28
  92. package/dist/page-builder-props.d.ts +56 -56
  93. package/dist/pim-connector.d.ts +7 -3
  94. package/dist/pim-connector.js +6 -2
  95. package/dist/pim-field-path.d.ts +5 -1
  96. package/dist/pim-field-path.js +37 -81
  97. package/dist/pim-locale-mapping.d.ts +131 -0
  98. package/dist/pim-locale-mapping.js +193 -0
  99. package/dist/price-books.d.ts +215 -63
  100. package/dist/price-books.js +47 -2
  101. package/dist/price-lists.d.ts +13 -10
  102. package/dist/product-feeds.d.ts +249 -100
  103. package/dist/product-feeds.js +46 -2
  104. package/dist/product-scope-model.d.ts +161 -0
  105. package/dist/product-scope-model.js +161 -0
  106. package/dist/product-scope-overrides.d.ts +0 -103
  107. package/dist/product-scope-overrides.js +0 -54
  108. package/dist/product-scoped-values.d.ts +2610 -0
  109. package/dist/product-scoped-values.js +425 -0
  110. package/dist/product-scopes.d.ts +199 -64
  111. package/dist/product-scopes.js +120 -23
  112. package/dist/product-tax-rates.d.ts +38 -0
  113. package/dist/product-tax-rates.js +45 -0
  114. package/dist/product-url-keys.d.ts +51 -45
  115. package/dist/product-url-keys.js +73 -39
  116. package/dist/product-value-resolver.d.ts +37 -60
  117. package/dist/product-value-resolver.js +36 -96
  118. package/dist/projects.d.ts +76 -28
  119. package/dist/projects.js +53 -9
  120. package/dist/promotions.d.ts +163 -11
  121. package/dist/promotions.js +23 -1
  122. package/dist/pwa.d.ts +41 -2
  123. package/dist/quick-order.d.ts +159 -9
  124. package/dist/quick-order.js +79 -4
  125. package/dist/quote-requests.d.ts +231 -17
  126. package/dist/quote-requests.js +111 -9
  127. package/dist/record-references.d.ts +15 -15
  128. package/dist/record-references.js +2 -3
  129. package/dist/record-rich-text.js +2 -1
  130. package/dist/returns.d.ts +214 -52
  131. package/dist/returns.js +143 -28
  132. package/dist/sales-channels.d.ts +34 -3
  133. package/dist/sales-channels.js +16 -1
  134. package/dist/saved-list-views.d.ts +28 -0
  135. package/dist/saved-list-views.js +14 -1
  136. package/dist/schema-extensions.d.ts +36 -0
  137. package/dist/schema-extensions.js +29 -0
  138. package/dist/scoped-write-encoding.d.ts +100 -0
  139. package/dist/scoped-write-encoding.js +135 -0
  140. package/dist/search.d.ts +18 -16
  141. package/dist/seo.d.ts +83 -30
  142. package/dist/seo.js +8 -1
  143. package/dist/settings.d.ts +173 -2
  144. package/dist/settings.js +53 -2
  145. package/dist/shopping-lists.d.ts +63 -4
  146. package/dist/shopping-lists.js +57 -3
  147. package/dist/storefront-cache-tags.d.ts +22 -0
  148. package/dist/storefront-cache-tags.js +12 -0
  149. package/dist/storefront-value-overrides.d.ts +18 -56
  150. package/dist/storefront-value-overrides.js +11 -86
  151. package/dist/tasks.d.ts +27 -27
  152. package/dist/taxes.d.ts +27 -0
  153. package/dist/taxes.js +4 -0
  154. package/dist/transactional-emails.d.ts +48 -22
  155. package/dist/webhooks.d.ts +75 -0
  156. package/dist/webhooks.js +24 -0
  157. package/package.json +5 -3
  158. package/dist/actor.d.ts.map +0 -1
  159. package/dist/actor.js.map +0 -1
  160. package/dist/addresses.d.ts.map +0 -1
  161. package/dist/addresses.js.map +0 -1
  162. package/dist/admin-actions.d.ts.map +0 -1
  163. package/dist/admin-actions.js.map +0 -1
  164. package/dist/admin-contributions.d.ts.map +0 -1
  165. package/dist/admin-contributions.js.map +0 -1
  166. package/dist/admin-feedback.d.ts.map +0 -1
  167. package/dist/admin-feedback.js.map +0 -1
  168. package/dist/admin-i18n.d.ts.map +0 -1
  169. package/dist/admin-i18n.js.map +0 -1
  170. package/dist/admin-name.d.ts.map +0 -1
  171. package/dist/admin-name.js.map +0 -1
  172. package/dist/admin-notifications.d.ts.map +0 -1
  173. package/dist/admin-notifications.js.map +0 -1
  174. package/dist/admin-preferences.d.ts.map +0 -1
  175. package/dist/admin-preferences.js.map +0 -1
  176. package/dist/admin-roles.d.ts.map +0 -1
  177. package/dist/admin-roles.js.map +0 -1
  178. package/dist/admin-search.d.ts.map +0 -1
  179. package/dist/admin-search.js.map +0 -1
  180. package/dist/admin-users.d.ts.map +0 -1
  181. package/dist/admin-users.js.map +0 -1
  182. package/dist/admin.d.ts.map +0 -1
  183. package/dist/admin.js.map +0 -1
  184. package/dist/analytics.d.ts.map +0 -1
  185. package/dist/analytics.js.map +0 -1
  186. package/dist/api-keys.d.ts.map +0 -1
  187. package/dist/api-keys.js.map +0 -1
  188. package/dist/assets-library.d.ts.map +0 -1
  189. package/dist/assets-library.js.map +0 -1
  190. package/dist/audit-logs.d.ts.map +0 -1
  191. package/dist/audit-logs.js.map +0 -1
  192. package/dist/auth.d.ts.map +0 -1
  193. package/dist/auth.js.map +0 -1
  194. package/dist/blog.d.ts.map +0 -1
  195. package/dist/blog.js.map +0 -1
  196. package/dist/capabilities.d.ts.map +0 -1
  197. package/dist/capabilities.js.map +0 -1
  198. package/dist/carts.d.ts.map +0 -1
  199. package/dist/carts.js.map +0 -1
  200. package/dist/catalog.d.ts.map +0 -1
  201. package/dist/catalog.js.map +0 -1
  202. package/dist/cms-brand.d.ts.map +0 -1
  203. package/dist/cms-brand.js.map +0 -1
  204. package/dist/cms-contact-form.d.ts.map +0 -1
  205. package/dist/cms-contact-form.js.map +0 -1
  206. package/dist/cms.d.ts.map +0 -1
  207. package/dist/cms.js.map +0 -1
  208. package/dist/common.d.ts.map +0 -1
  209. package/dist/common.js.map +0 -1
  210. package/dist/comparisons.d.ts.map +0 -1
  211. package/dist/comparisons.js.map +0 -1
  212. package/dist/credentials.d.ts.map +0 -1
  213. package/dist/credentials.js.map +0 -1
  214. package/dist/credit-limits.d.ts.map +0 -1
  215. package/dist/credit-limits.js.map +0 -1
  216. package/dist/crm-rich-text.d.ts.map +0 -1
  217. package/dist/crm-rich-text.js.map +0 -1
  218. package/dist/crm.d.ts.map +0 -1
  219. package/dist/crm.js.map +0 -1
  220. package/dist/currencies.d.ts.map +0 -1
  221. package/dist/currencies.js.map +0 -1
  222. package/dist/custom-fields.d.ts.map +0 -1
  223. package/dist/custom-fields.js.map +0 -1
  224. package/dist/customer-accounts.d.ts.map +0 -1
  225. package/dist/customer-accounts.js.map +0 -1
  226. package/dist/customers.d.ts.map +0 -1
  227. package/dist/customers.js.map +0 -1
  228. package/dist/dictionary.d.ts.map +0 -1
  229. package/dist/dictionary.js.map +0 -1
  230. package/dist/document-templates.d.ts.map +0 -1
  231. package/dist/document-templates.js.map +0 -1
  232. package/dist/document-values.d.ts.map +0 -1
  233. package/dist/document-values.js.map +0 -1
  234. package/dist/email-address.d.ts.map +0 -1
  235. package/dist/email-address.js.map +0 -1
  236. package/dist/email.d.ts.map +0 -1
  237. package/dist/email.js.map +0 -1
  238. package/dist/envelopes.d.ts.map +0 -1
  239. package/dist/envelopes.js.map +0 -1
  240. package/dist/environment-inputs.d.ts.map +0 -1
  241. package/dist/environment-inputs.js.map +0 -1
  242. package/dist/erp-connector.d.ts.map +0 -1
  243. package/dist/erp-connector.js.map +0 -1
  244. package/dist/errors.d.ts.map +0 -1
  245. package/dist/errors.js.map +0 -1
  246. package/dist/google-analytics.d.ts.map +0 -1
  247. package/dist/google-analytics.js.map +0 -1
  248. package/dist/google-tag-manager.d.ts.map +0 -1
  249. package/dist/google-tag-manager.js.map +0 -1
  250. package/dist/i18n.d.ts.map +0 -1
  251. package/dist/i18n.js.map +0 -1
  252. package/dist/import-export.d.ts.map +0 -1
  253. package/dist/import-export.js.map +0 -1
  254. package/dist/index.d.ts.map +0 -1
  255. package/dist/index.js.map +0 -1
  256. package/dist/inventory.d.ts.map +0 -1
  257. package/dist/inventory.js.map +0 -1
  258. package/dist/invoice-ledger.d.ts.map +0 -1
  259. package/dist/invoice-ledger.js.map +0 -1
  260. package/dist/invoices.d.ts.map +0 -1
  261. package/dist/invoices.js.map +0 -1
  262. package/dist/kernel.d.ts.map +0 -1
  263. package/dist/kernel.js.map +0 -1
  264. package/dist/languages.d.ts.map +0 -1
  265. package/dist/languages.js.map +0 -1
  266. package/dist/line-groups.d.ts.map +0 -1
  267. package/dist/line-groups.js.map +0 -1
  268. package/dist/linkedin-ads.d.ts.map +0 -1
  269. package/dist/linkedin-ads.js.map +0 -1
  270. package/dist/localized-name.d.ts.map +0 -1
  271. package/dist/localized-name.js.map +0 -1
  272. package/dist/megamenu.d.ts.map +0 -1
  273. package/dist/megamenu.js.map +0 -1
  274. package/dist/meta-ads.d.ts.map +0 -1
  275. package/dist/meta-ads.js.map +0 -1
  276. package/dist/mfa.d.ts.map +0 -1
  277. package/dist/mfa.js.map +0 -1
  278. package/dist/modules.d.ts.map +0 -1
  279. package/dist/modules.js.map +0 -1
  280. package/dist/money-decimal.d.ts.map +0 -1
  281. package/dist/money-decimal.js.map +0 -1
  282. package/dist/money-input.d.ts.map +0 -1
  283. package/dist/money-input.js.map +0 -1
  284. package/dist/newsletter.d.ts.map +0 -1
  285. package/dist/newsletter.js.map +0 -1
  286. package/dist/order-minimums.d.ts.map +0 -1
  287. package/dist/order-minimums.js.map +0 -1
  288. package/dist/orders.d.ts.map +0 -1
  289. package/dist/orders.js.map +0 -1
  290. package/dist/organizations.d.ts.map +0 -1
  291. package/dist/organizations.js.map +0 -1
  292. package/dist/page-builder-props.d.ts.map +0 -1
  293. package/dist/page-builder-props.js.map +0 -1
  294. package/dist/page-builder-values.d.ts.map +0 -1
  295. package/dist/page-builder-values.js.map +0 -1
  296. package/dist/pagination.d.ts.map +0 -1
  297. package/dist/pagination.js.map +0 -1
  298. package/dist/payment-methods.d.ts.map +0 -1
  299. package/dist/payment-methods.js.map +0 -1
  300. package/dist/payment-return-url.d.ts.map +0 -1
  301. package/dist/payment-return-url.js.map +0 -1
  302. package/dist/payments.d.ts.map +0 -1
  303. package/dist/payments.js.map +0 -1
  304. package/dist/pim-connector.d.ts.map +0 -1
  305. package/dist/pim-connector.js.map +0 -1
  306. package/dist/pim-field-path.d.ts.map +0 -1
  307. package/dist/pim-field-path.js.map +0 -1
  308. package/dist/platform-info.d.ts.map +0 -1
  309. package/dist/platform-info.js.map +0 -1
  310. package/dist/platform-language.d.ts.map +0 -1
  311. package/dist/platform-language.js.map +0 -1
  312. package/dist/price-book-decimal.d.ts.map +0 -1
  313. package/dist/price-book-decimal.js.map +0 -1
  314. package/dist/price-books.d.ts.map +0 -1
  315. package/dist/price-books.js.map +0 -1
  316. package/dist/price-lists.d.ts.map +0 -1
  317. package/dist/price-lists.js.map +0 -1
  318. package/dist/product-feeds.d.ts.map +0 -1
  319. package/dist/product-feeds.js.map +0 -1
  320. package/dist/product-scope-overrides.d.ts.map +0 -1
  321. package/dist/product-scope-overrides.js.map +0 -1
  322. package/dist/product-scopes.d.ts.map +0 -1
  323. package/dist/product-scopes.js.map +0 -1
  324. package/dist/product-summary-text.d.ts.map +0 -1
  325. package/dist/product-summary-text.js.map +0 -1
  326. package/dist/product-url-keys.d.ts.map +0 -1
  327. package/dist/product-url-keys.js.map +0 -1
  328. package/dist/product-value-resolver.d.ts.map +0 -1
  329. package/dist/product-value-resolver.js.map +0 -1
  330. package/dist/projects.d.ts.map +0 -1
  331. package/dist/projects.js.map +0 -1
  332. package/dist/promotions.d.ts.map +0 -1
  333. package/dist/promotions.js.map +0 -1
  334. package/dist/prompt-actions.d.ts.map +0 -1
  335. package/dist/prompt-actions.js.map +0 -1
  336. package/dist/pwa.d.ts.map +0 -1
  337. package/dist/pwa.js.map +0 -1
  338. package/dist/quick-order.d.ts.map +0 -1
  339. package/dist/quick-order.js.map +0 -1
  340. package/dist/quote-requests.d.ts.map +0 -1
  341. package/dist/quote-requests.js.map +0 -1
  342. package/dist/record-references.d.ts.map +0 -1
  343. package/dist/record-references.js.map +0 -1
  344. package/dist/record-rich-text.d.ts.map +0 -1
  345. package/dist/record-rich-text.js.map +0 -1
  346. package/dist/returns.d.ts.map +0 -1
  347. package/dist/returns.js.map +0 -1
  348. package/dist/sales-channels.d.ts.map +0 -1
  349. package/dist/sales-channels.js.map +0 -1
  350. package/dist/saved-list-views.d.ts.map +0 -1
  351. package/dist/saved-list-views.js.map +0 -1
  352. package/dist/scope-notice.d.ts.map +0 -1
  353. package/dist/scope-notice.js.map +0 -1
  354. package/dist/scoped-translations.d.ts +0 -48
  355. package/dist/scoped-translations.d.ts.map +0 -1
  356. package/dist/scoped-translations.js +0 -78
  357. package/dist/scoped-translations.js.map +0 -1
  358. package/dist/search.d.ts.map +0 -1
  359. package/dist/search.js.map +0 -1
  360. package/dist/seo.d.ts.map +0 -1
  361. package/dist/seo.js.map +0 -1
  362. package/dist/settings.d.ts.map +0 -1
  363. package/dist/settings.js.map +0 -1
  364. package/dist/shipments.d.ts.map +0 -1
  365. package/dist/shipments.js.map +0 -1
  366. package/dist/shipping-methods.d.ts.map +0 -1
  367. package/dist/shipping-methods.js.map +0 -1
  368. package/dist/shopping-lists.d.ts.map +0 -1
  369. package/dist/shopping-lists.js.map +0 -1
  370. package/dist/storefront-cache-tags.d.ts.map +0 -1
  371. package/dist/storefront-cache-tags.js.map +0 -1
  372. package/dist/storefront-language-path.d.ts.map +0 -1
  373. package/dist/storefront-language-path.js.map +0 -1
  374. package/dist/storefront-value-overrides.d.ts.map +0 -1
  375. package/dist/storefront-value-overrides.js.map +0 -1
  376. package/dist/tasks.d.ts.map +0 -1
  377. package/dist/tasks.js.map +0 -1
  378. package/dist/taxes.d.ts.map +0 -1
  379. package/dist/taxes.js.map +0 -1
  380. package/dist/text-normalization.d.ts.map +0 -1
  381. package/dist/text-normalization.js.map +0 -1
  382. package/dist/transactional-emails.d.ts.map +0 -1
  383. package/dist/transactional-emails.js.map +0 -1
  384. package/dist/webhooks.d.ts.map +0 -1
  385. package/dist/webhooks.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import type { SupportedLanguage } from './platform-language.js';
2
3
  import { type OriginReference } from './common.js';
3
4
  /**
4
5
  * Quote Requests (RFQ) module contracts — feature 008 workflow rewrite.
@@ -56,8 +57,8 @@ export declare const quoteRequestItemSchema: z.ZodObject<{
56
57
  export type QuoteRequestItem = z.infer<typeof quoteRequestItemSchema>;
57
58
  export declare const rfqEventTypeSchema: z.ZodEnum<{
58
59
  completed: "completed";
59
- expired: "expired";
60
60
  created: "created";
61
+ expired: "expired";
61
62
  approved: "approved";
62
63
  submitted: "submitted";
63
64
  modified: "modified";
@@ -74,8 +75,8 @@ export declare const quoteRequestEventSchema: z.ZodObject<{
74
75
  id: z.ZodString;
75
76
  eventType: z.ZodEnum<{
76
77
  completed: "completed";
77
- expired: "expired";
78
78
  created: "created";
79
+ expired: "expired";
79
80
  approved: "approved";
80
81
  submitted: "submitted";
81
82
  modified: "modified";
@@ -240,8 +241,8 @@ export declare const quoteRequestHistoryActorSchema: z.ZodDiscriminatedUnion<[z.
240
241
  export type QuoteRequestHistoryActor = z.infer<typeof quoteRequestHistoryActorSchema>;
241
242
  export declare const quoteRequestHistoryEntryKindSchema: z.ZodEnum<{
242
243
  completed: "completed";
243
- expired: "expired";
244
244
  created: "created";
245
+ expired: "expired";
245
246
  approved: "approved";
246
247
  submitted: "submitted";
247
248
  modified: "modified";
@@ -255,13 +256,77 @@ export declare const quoteRequestHistoryEntryKindSchema: z.ZodEnum<{
255
256
  custom_field_carry_skipped: "custom_field_carry_skipped";
256
257
  }>;
257
258
  export type QuoteRequestHistoryEntryKind = z.infer<typeof quoteRequestHistoryEntryKindSchema>;
259
+ /**
260
+ * `specs/179-rfq-and-customer-notifications/` — one notification delivery of a
261
+ * history entry (`contracts/delivery-and-ports.md` §4): who was told, through
262
+ * which channel, and with what outcome. Admin history only; the customer
263
+ * projection never carries it (FR-071). The recipient's address is never part
264
+ * of it — `displayName` is resolved at read, `''` when the person is gone.
265
+ */
266
+ export declare const quoteRequestDeliveryChannelSchema: z.ZodEnum<{
267
+ admin_in_app: "admin_in_app";
268
+ admin_email: "admin_email";
269
+ customer_email: "customer_email";
270
+ customer_in_app: "customer_in_app";
271
+ customer_push: "customer_push";
272
+ }>;
273
+ export type QuoteRequestDeliveryChannel = z.infer<typeof quoteRequestDeliveryChannelSchema>;
274
+ export declare const quoteRequestDeliveryStatusSchema: z.ZodEnum<{
275
+ pending: "pending";
276
+ failed: "failed";
277
+ sent: "sent";
278
+ skipped_stale: "skipped_stale";
279
+ skipped_module_off: "skipped_module_off";
280
+ skipped_deactivated: "skipped_deactivated";
281
+ skipped_no_transport: "skipped_no_transport";
282
+ skipped_logged: "skipped_logged";
283
+ skipped_no_recipient: "skipped_no_recipient";
284
+ skipped_preference: "skipped_preference";
285
+ skipped_no_subscription: "skipped_no_subscription";
286
+ }>;
287
+ export type QuoteRequestDeliveryStatus = z.infer<typeof quoteRequestDeliveryStatusSchema>;
288
+ export declare const quoteRequestDeliverySchema: z.ZodObject<{
289
+ id: z.ZodString;
290
+ channel: z.ZodEnum<{
291
+ admin_in_app: "admin_in_app";
292
+ admin_email: "admin_email";
293
+ customer_email: "customer_email";
294
+ customer_in_app: "customer_in_app";
295
+ customer_push: "customer_push";
296
+ }>;
297
+ recipient: z.ZodObject<{
298
+ kind: z.ZodEnum<{
299
+ customer: "customer";
300
+ admin: "admin";
301
+ }>;
302
+ id: z.ZodString;
303
+ displayName: z.ZodString;
304
+ }, z.core.$strict>;
305
+ status: z.ZodEnum<{
306
+ pending: "pending";
307
+ failed: "failed";
308
+ sent: "sent";
309
+ skipped_stale: "skipped_stale";
310
+ skipped_module_off: "skipped_module_off";
311
+ skipped_deactivated: "skipped_deactivated";
312
+ skipped_no_transport: "skipped_no_transport";
313
+ skipped_logged: "skipped_logged";
314
+ skipped_no_recipient: "skipped_no_recipient";
315
+ skipped_preference: "skipped_preference";
316
+ skipped_no_subscription: "skipped_no_subscription";
317
+ }>;
318
+ attempts: z.ZodNumber;
319
+ lastError: z.ZodNullable<z.ZodString>;
320
+ closedAt: z.ZodNullable<z.ZodString>;
321
+ }, z.core.$strict>;
322
+ export type QuoteRequestDelivery = z.infer<typeof quoteRequestDeliverySchema>;
258
323
  export declare const quoteRequestHistoryEntrySchema: z.ZodObject<{
259
324
  id: z.ZodString;
260
325
  eventIds: z.ZodArray<z.ZodString>;
261
326
  kind: z.ZodEnum<{
262
327
  completed: "completed";
263
- expired: "expired";
264
328
  created: "created";
329
+ expired: "expired";
265
330
  approved: "approved";
266
331
  submitted: "submitted";
267
332
  modified: "modified";
@@ -429,6 +494,40 @@ export declare const quoteRequestHistoryEntrySchema: z.ZodObject<{
429
494
  }, z.core.$strip>>;
430
495
  }, z.core.$strip>>;
431
496
  }, z.core.$strip>>>;
497
+ deliveries: z.ZodOptional<z.ZodArray<z.ZodObject<{
498
+ id: z.ZodString;
499
+ channel: z.ZodEnum<{
500
+ admin_in_app: "admin_in_app";
501
+ admin_email: "admin_email";
502
+ customer_email: "customer_email";
503
+ customer_in_app: "customer_in_app";
504
+ customer_push: "customer_push";
505
+ }>;
506
+ recipient: z.ZodObject<{
507
+ kind: z.ZodEnum<{
508
+ customer: "customer";
509
+ admin: "admin";
510
+ }>;
511
+ id: z.ZodString;
512
+ displayName: z.ZodString;
513
+ }, z.core.$strict>;
514
+ status: z.ZodEnum<{
515
+ pending: "pending";
516
+ failed: "failed";
517
+ sent: "sent";
518
+ skipped_stale: "skipped_stale";
519
+ skipped_module_off: "skipped_module_off";
520
+ skipped_deactivated: "skipped_deactivated";
521
+ skipped_no_transport: "skipped_no_transport";
522
+ skipped_logged: "skipped_logged";
523
+ skipped_no_recipient: "skipped_no_recipient";
524
+ skipped_preference: "skipped_preference";
525
+ skipped_no_subscription: "skipped_no_subscription";
526
+ }>;
527
+ attempts: z.ZodNumber;
528
+ lastError: z.ZodNullable<z.ZodString>;
529
+ closedAt: z.ZodNullable<z.ZodString>;
530
+ }, z.core.$strict>>>;
432
531
  }, z.core.$strip>;
433
532
  export type QuoteRequestHistoryEntry = z.infer<typeof quoteRequestHistoryEntrySchema>;
434
533
  /**
@@ -448,8 +547,8 @@ export declare const quoteRequestHistorySchema: z.ZodObject<{
448
547
  eventIds: z.ZodArray<z.ZodString>;
449
548
  kind: z.ZodEnum<{
450
549
  completed: "completed";
451
- expired: "expired";
452
550
  created: "created";
551
+ expired: "expired";
453
552
  approved: "approved";
454
553
  submitted: "submitted";
455
554
  modified: "modified";
@@ -617,6 +716,40 @@ export declare const quoteRequestHistorySchema: z.ZodObject<{
617
716
  }, z.core.$strip>>;
618
717
  }, z.core.$strip>>;
619
718
  }, z.core.$strip>>>;
719
+ deliveries: z.ZodOptional<z.ZodArray<z.ZodObject<{
720
+ id: z.ZodString;
721
+ channel: z.ZodEnum<{
722
+ admin_in_app: "admin_in_app";
723
+ admin_email: "admin_email";
724
+ customer_email: "customer_email";
725
+ customer_in_app: "customer_in_app";
726
+ customer_push: "customer_push";
727
+ }>;
728
+ recipient: z.ZodObject<{
729
+ kind: z.ZodEnum<{
730
+ customer: "customer";
731
+ admin: "admin";
732
+ }>;
733
+ id: z.ZodString;
734
+ displayName: z.ZodString;
735
+ }, z.core.$strict>;
736
+ status: z.ZodEnum<{
737
+ pending: "pending";
738
+ failed: "failed";
739
+ sent: "sent";
740
+ skipped_stale: "skipped_stale";
741
+ skipped_module_off: "skipped_module_off";
742
+ skipped_deactivated: "skipped_deactivated";
743
+ skipped_no_transport: "skipped_no_transport";
744
+ skipped_logged: "skipped_logged";
745
+ skipped_no_recipient: "skipped_no_recipient";
746
+ skipped_preference: "skipped_preference";
747
+ skipped_no_subscription: "skipped_no_subscription";
748
+ }>;
749
+ attempts: z.ZodNumber;
750
+ lastError: z.ZodNullable<z.ZodString>;
751
+ closedAt: z.ZodNullable<z.ZodString>;
752
+ }, z.core.$strict>>>;
620
753
  }, z.core.$strip>>;
621
754
  truncated: z.ZodBoolean;
622
755
  }, z.core.$strip>;
@@ -758,8 +891,8 @@ export declare const quoteRequestSchema: z.ZodObject<{
758
891
  id: z.ZodString;
759
892
  eventType: z.ZodEnum<{
760
893
  completed: "completed";
761
- expired: "expired";
762
894
  created: "created";
895
+ expired: "expired";
763
896
  approved: "approved";
764
897
  submitted: "submitted";
765
898
  modified: "modified";
@@ -827,7 +960,8 @@ export declare const quoteRequestSchema: z.ZodObject<{
827
960
  id: z.ZodString;
828
961
  name: z.ZodString;
829
962
  legalName: z.ZodNullable<z.ZodString>;
830
- taxId: z.ZodString;
963
+ taxId: z.ZodNullable<z.ZodString>;
964
+ isPersonal: z.ZodBoolean;
831
965
  vatStatus: z.ZodString;
832
966
  }, z.core.$strip>>>;
833
967
  customer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -842,6 +976,46 @@ export declare const quoteRequestSchema: z.ZodObject<{
842
976
  version: z.ZodNumber;
843
977
  }, z.core.$strip>;
844
978
  export type QuoteRequest = z.infer<typeof quoteRequestSchema>;
979
+ /**
980
+ * How far a quote request is agreed (issue #456, PO ruling of 2026-11-08):
981
+ * `agreed` — every line has an agreed price; `partial` — some lines do;
982
+ * `none` — no line does (a quote without a line included).
983
+ */
984
+ export declare const quoteRequestAgreementSchema: z.ZodEnum<{
985
+ none: "none";
986
+ agreed: "agreed";
987
+ partial: "partial";
988
+ }>;
989
+ export type QuoteRequestAgreement = z.infer<typeof quoteRequestAgreementSchema>;
990
+ /**
991
+ * What a quote request is worth — **one rule**, owned by `quote_requests`
992
+ * (issue #456, owner ruling of 2026-11-07). The quote desk list, a CRM
993
+ * Opportunity's link and a Project's link all show this figure; none of them
994
+ * re-derives it. Read it from `quoteRequestReadPort.amountOf`.
995
+ *
996
+ * - **Per line**: quantity × (agreed unit price ?? the price the customer
997
+ * asked for). The unit price keeps its four places; the line value is the
998
+ * rounding point, half-up to two places once (`lineAmountHalfUp`,
999
+ * `specs/conventions/pricing.md`), and the line values are summed exactly.
1000
+ * - **A line with neither price adds nothing** — it is not a zero price, it is
1001
+ * no price. A quote none of whose lines has a price has **no amount**
1002
+ * (`null`, shown as `—`), not `0.00`.
1003
+ * - Net of tax, in the currency of the first line (what the desk shows the
1004
+ * total in); `null` for a quote without a line.
1005
+ *
1006
+ * A consumer shows a marker only beside an amount: *Partially agreed* for
1007
+ * `partial`, *Not yet agreed* for `none`.
1008
+ */
1009
+ export declare const quoteRequestAmountSchema: z.ZodObject<{
1010
+ amount: z.ZodNullable<z.ZodString>;
1011
+ currency: z.ZodNullable<z.ZodString>;
1012
+ agreement: z.ZodEnum<{
1013
+ none: "none";
1014
+ agreed: "agreed";
1015
+ partial: "partial";
1016
+ }>;
1017
+ }, z.core.$strip>;
1018
+ export type QuoteRequestAmount = z.infer<typeof quoteRequestAmountSchema>;
845
1019
  export declare const quoteRequestSummarySchema: z.ZodObject<{
846
1020
  id: z.ZodString;
847
1021
  businessId: z.ZodString;
@@ -872,6 +1046,13 @@ export declare const quoteRequestSummarySchema: z.ZodObject<{
872
1046
  }, z.core.$strip>>;
873
1047
  organizationName: z.ZodOptional<z.ZodString>;
874
1048
  customerDisplayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1049
+ amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1050
+ agreement: z.ZodOptional<z.ZodEnum<{
1051
+ none: "none";
1052
+ agreed: "agreed";
1053
+ partial: "partial";
1054
+ }>>;
1055
+ statusName: z.ZodOptional<z.ZodString>;
875
1056
  }, z.core.$strip>;
876
1057
  export type QuoteRequestSummary = z.infer<typeof quoteRequestSummarySchema>;
877
1058
  export declare const createQuoteRequestLineSchema: z.ZodObject<{
@@ -962,6 +1143,7 @@ export declare const adminCreateQuoteRequestSchema: z.ZodObject<{
962
1143
  type: z.ZodString;
963
1144
  id: z.ZodString;
964
1145
  }, z.core.$strict>>;
1146
+ customFieldValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
965
1147
  }, z.core.$strip>;
966
1148
  export type AdminCreateQuoteRequest = z.infer<typeof adminCreateQuoteRequestSchema>;
967
1149
  /**
@@ -1092,8 +1274,8 @@ export declare const quoteRequestAccountNegotiationSchema: z.ZodObject<{
1092
1274
  effectivePriceProposalsAllowed: z.ZodBoolean;
1093
1275
  effectiveSource: z.ZodEnum<{
1094
1276
  default: "default";
1095
- account: "account";
1096
1277
  organization: "organization";
1278
+ account: "account";
1097
1279
  }>;
1098
1280
  updatedAt: z.ZodNullable<z.ZodString>;
1099
1281
  }, z.core.$strip>;
@@ -1235,6 +1417,15 @@ export interface QuoteRequestLineRecord {
1235
1417
  */
1236
1418
  export interface QuoteRequestReadPort {
1237
1419
  findById(id: string): Promise<QuoteRequestRecord | null>;
1420
+ /**
1421
+ * A status's name in `language`, in this module's own wording (the one its
1422
+ * global-search results use); a code outside {@link rfqStatusSchema} answers
1423
+ * as it is. Published for issue #455, so that a module showing a linked
1424
+ * Quote Request names its status as `quote_requests` does rather than
1425
+ * showing the stored code or keeping a copy of the wording. Reads no quote,
1426
+ * so it checks no permission.
1427
+ */
1428
+ statusName(status: string, language: SupportedLanguage): Promise<string>;
1238
1429
  /**
1239
1430
  * Open quotes for the given organisations. Empty `organizationIds` answers
1240
1431
  * the empty array rather than every quote — a rep assigned nothing sees
@@ -1259,16 +1450,38 @@ export interface QuoteRequestReadPort {
1259
1450
  * resolve it.
1260
1451
  */
1261
1452
  findByBusinessId(businessId: string): Promise<QuoteRequestRecord | null>;
1453
+ /**
1454
+ * What the quote is worth, by the one rule of {@link quoteRequestAmountSchema},
1455
+ * or `null` when the quote is missing or out of the caller's scope — the
1456
+ * answer `findById` gives for it.
1457
+ *
1458
+ * Added for issue #456: `crm` and `projects` each kept a copy of the rule
1459
+ * over `listItems`, and the quote desk list a third, different one.
1460
+ */
1461
+ amountOf(quoteRequestId: string): Promise<QuoteRequestAmount | null>;
1462
+ /**
1463
+ * The quotes of `ids` in the caller's tenant scope, in no particular order —
1464
+ * what {@link findById} answers for each id, in one read. A missing,
1465
+ * out-of-scope or malformed id is simply absent.
1466
+ *
1467
+ * Added for issue #457: `projects` read the Quote Requests linked to a
1468
+ * Project one `findById` at a time.
1469
+ */
1470
+ findByIds(ids: readonly string[]): Promise<QuoteRequestRecord[]>;
1471
+ /**
1472
+ * What each quote of `quoteRequestIds` is worth, keyed by quote id — what
1473
+ * {@link amountOf} answers for each id, in a fixed number of reads. A quote
1474
+ * `amountOf` answers `null` for (missing, out of scope, malformed id) has no
1475
+ * entry.
1476
+ *
1477
+ * Added for issue #457, beside {@link findByIds}.
1478
+ */
1479
+ amountsOf(quoteRequestIds: readonly string[]): Promise<Map<string, QuoteRequestAmount>>;
1262
1480
  }
1263
1481
  /** Who is asking, on a customer-facing quote path. */
1264
1482
  export interface RfqCustomerContext {
1265
1483
  customerAccountId: string;
1266
1484
  organizationId: string;
1267
- /**
1268
- * True when the account holds the org-admin role on the current
1269
- * organisation (FR-011 — broader visibility).
1270
- */
1271
- isOrgAdmin: boolean;
1272
1485
  }
1273
1486
  /**
1274
1487
  * Container name: `rfqService`. Owner: `quote_requests`.
@@ -1325,10 +1538,11 @@ export interface CreateForCustomerOptions {
1325
1538
  */
1326
1539
  language?: string;
1327
1540
  /**
1328
- * Feature 163 — the buyer request's language tag (the first `Accept-Language` tag,
1329
- * `firstLanguageTag`), which the scope language L of every line is resolved from
1330
- * against the channel's own languages (`scopeLanguageOf`), as the basket's is. Absent:
1331
- * the channel's default language. Distinct from `language`, which falls back to a
1541
+ * Feature 163 — the buyer request's language tag, which the scope language L of every
1542
+ * line is resolved from against the channel's own languages (`scopeLanguageOf`), as the
1543
+ * basket's is. The customer routes pass the channel language the whole `Accept-Language`
1544
+ * asks for (`requestScopeLanguage`, issue #1011), which resolves to itself. Absent: the
1545
+ * channel's default language. Distinct from `language`, which falls back to a
1332
1546
  * bundle language the channel may switch a product off in. In-process only.
1333
1547
  */
1334
1548
  languageTag?: string;
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { isoDateTimeSchema, OriginReferenceSchema, uuidSchema } from './common.js';
3
3
  import { lineGroupInputSchema, lineGroupKeySchema, lineGroupSchema, newLineGroupInputSchema, refineLineGrouping, } from './line-groups.js';
4
- import { customFieldCarrySkipSchema } from './custom-fields.js';
4
+ import { customFieldCarrySkipSchema, customFieldValuesSchema } from './custom-fields.js';
5
5
  import { fourDecimalUnitPrice } from './money-input.js';
6
+ import { lineQuantitySchema, REQUEST_LINE_ITEMS_MAX } from './line-bounds.js';
6
7
  /**
7
8
  * Quote Requests (RFQ) module contracts — feature 008 workflow rewrite.
8
9
  * Source of truth per Principle V; the backend re-uses these schemas as
@@ -259,6 +260,50 @@ export const quoteRequestHistoryEntryKindSchema = z.enum([
259
260
  // Feature 162.
260
261
  'custom_field_carry_skipped',
261
262
  ]);
263
+ /**
264
+ * `specs/179-rfq-and-customer-notifications/` — one notification delivery of a
265
+ * history entry (`contracts/delivery-and-ports.md` §4): who was told, through
266
+ * which channel, and with what outcome. Admin history only; the customer
267
+ * projection never carries it (FR-071). The recipient's address is never part
268
+ * of it — `displayName` is resolved at read, `''` when the person is gone.
269
+ */
270
+ export const quoteRequestDeliveryChannelSchema = z.enum([
271
+ 'admin_in_app',
272
+ 'admin_email',
273
+ 'customer_email',
274
+ 'customer_in_app',
275
+ 'customer_push',
276
+ ]);
277
+ export const quoteRequestDeliveryStatusSchema = z.enum([
278
+ 'pending',
279
+ 'sent',
280
+ 'skipped_stale',
281
+ 'skipped_module_off',
282
+ 'skipped_deactivated',
283
+ 'skipped_no_transport',
284
+ 'skipped_logged',
285
+ 'skipped_no_recipient',
286
+ 'skipped_preference',
287
+ 'skipped_no_subscription',
288
+ 'failed',
289
+ ]);
290
+ export const quoteRequestDeliverySchema = z
291
+ .object({
292
+ id: uuidSchema,
293
+ channel: quoteRequestDeliveryChannelSchema,
294
+ recipient: z
295
+ .object({
296
+ kind: z.enum(['admin', 'customer']),
297
+ id: uuidSchema,
298
+ displayName: z.string(),
299
+ })
300
+ .strict(),
301
+ status: quoteRequestDeliveryStatusSchema,
302
+ attempts: z.number().int().nonnegative(),
303
+ lastError: z.string().nullable(),
304
+ closedAt: isoDateTimeSchema.nullable(),
305
+ })
306
+ .strict();
262
307
  export const quoteRequestHistoryEntrySchema = z.object({
263
308
  /** Id of the first merged event. */
264
309
  id: uuidSchema,
@@ -305,6 +350,11 @@ export const quoteRequestHistoryEntrySchema = z.object({
305
350
  })
306
351
  .nullable()
307
352
  .optional(),
353
+ /**
354
+ * Feature 179 — admin history only: the notification deliveries whose source
355
+ * event is one of `eventIds`. Absent on the customer route (FR-071).
356
+ */
357
+ deliveries: z.array(quoteRequestDeliverySchema).optional(),
308
358
  });
309
359
  /**
310
360
  * How many of a quote request's most recent events its history is built from
@@ -450,7 +500,10 @@ export const quoteRequestSchema = z.object({
450
500
  id: uuidSchema,
451
501
  name: z.string(),
452
502
  legalName: z.string().nullable(),
453
- taxId: z.string(),
503
+ /** `null` for a personal (B2C) Organization, whose tax id is an internal placeholder (#767). */
504
+ taxId: z.string().nullable(),
505
+ /** A personal (B2C) Organization: the panel labels it an individual customer (#767). */
506
+ isPersonal: z.boolean(),
454
507
  vatStatus: z.string(),
455
508
  })
456
509
  .nullable()
@@ -474,6 +527,37 @@ export const quoteRequestSchema = z.object({
474
527
  updatedAt: isoDateTimeSchema,
475
528
  version: z.number().int().nonnegative(),
476
529
  });
530
+ /**
531
+ * How far a quote request is agreed (issue #456, PO ruling of 2026-11-08):
532
+ * `agreed` — every line has an agreed price; `partial` — some lines do;
533
+ * `none` — no line does (a quote without a line included).
534
+ */
535
+ export const quoteRequestAgreementSchema = z.enum(['agreed', 'partial', 'none']);
536
+ /**
537
+ * What a quote request is worth — **one rule**, owned by `quote_requests`
538
+ * (issue #456, owner ruling of 2026-11-07). The quote desk list, a CRM
539
+ * Opportunity's link and a Project's link all show this figure; none of them
540
+ * re-derives it. Read it from `quoteRequestReadPort.amountOf`.
541
+ *
542
+ * - **Per line**: quantity × (agreed unit price ?? the price the customer
543
+ * asked for). The unit price keeps its four places; the line value is the
544
+ * rounding point, half-up to two places once (`lineAmountHalfUp`,
545
+ * `specs/conventions/pricing.md`), and the line values are summed exactly.
546
+ * - **A line with neither price adds nothing** — it is not a zero price, it is
547
+ * no price. A quote none of whose lines has a price has **no amount**
548
+ * (`null`, shown as `—`), not `0.00`.
549
+ * - Net of tax, in the currency of the first line (what the desk shows the
550
+ * total in); `null` for a quote without a line.
551
+ *
552
+ * A consumer shows a marker only beside an amount: *Partially agreed* for
553
+ * `partial`, *Not yet agreed* for `none`.
554
+ */
555
+ export const quoteRequestAmountSchema = z.object({
556
+ /** Two places, non-negative: `35.00`; `null` when no line has a price. */
557
+ amount: z.string().regex(/^\d+\.\d{2}$/).nullable(),
558
+ currency: z.string().length(3).nullable(),
559
+ agreement: quoteRequestAgreementSchema,
560
+ });
477
561
  export const quoteRequestSummarySchema = z.object({
478
562
  id: uuidSchema,
479
563
  businessId: z.string(),
@@ -501,6 +585,19 @@ export const quoteRequestSummarySchema = z.object({
501
585
  .optional(),
502
586
  organizationName: z.string().optional(),
503
587
  customerDisplayName: z.string().nullable().optional(),
588
+ /**
589
+ * Issue #456 — the quote's amount and how far it is agreed
590
+ * ({@link quoteRequestAmountSchema}). **Admin list only**; the customer list
591
+ * keeps its two every-line-or-`null` totals.
592
+ */
593
+ amount: quoteRequestAmountSchema.shape.amount.optional(),
594
+ agreement: quoteRequestAgreementSchema.optional(),
595
+ /**
596
+ * Issue #455 — `status` named in the response language, in this module's
597
+ * own wording (`QuoteRequestReadPort.statusName`), for another module's link
598
+ * picker to show. **Admin list only**; declared by issue #1270.
599
+ */
600
+ statusName: z.string().optional(),
504
601
  });
505
602
  // ---------------------------------------------------------------------------
506
603
  // Customer-facing request schemas
@@ -508,7 +605,7 @@ export const quoteRequestSummarySchema = z.object({
508
605
  export const createQuoteRequestLineSchema = z.object({
509
606
  productId: uuidSchema,
510
607
  variantId: uuidSchema.optional(),
511
- quantity: z.number().int().positive(),
608
+ quantity: lineQuantitySchema,
512
609
  desiredUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()).optional(),
513
610
  lineNote: z.string().max(2000).optional(),
514
611
  /** Feature 043 — snapshot when the line was added as a packaging unit. */
@@ -524,12 +621,12 @@ export const createQuoteRequestLineSchema = z.object({
524
621
  */
525
622
  export const createQuoteRequestSchema = z.object({
526
623
  headerNote: z.string().max(2000).optional(),
527
- items: z.array(createQuoteRequestLineSchema).min(1).max(200),
624
+ items: z.array(createQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX),
528
625
  });
529
626
  export const patchQuoteRequestSchema = z
530
627
  .object({
531
628
  headerNote: z.string().max(2000).nullable().optional(),
532
- items: z.array(createQuoteRequestLineSchema).min(1).max(200).optional(),
629
+ items: z.array(createQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX).optional(),
533
630
  })
534
631
  .strict();
535
632
  export const acceptRevisionSchema = z.object({
@@ -550,7 +647,7 @@ export const resubmitQuoteRequestSchema = z
550
647
  export const adminCreateQuoteRequestLineSchema = z.object({
551
648
  productId: uuidSchema,
552
649
  variantId: uuidSchema.optional(),
553
- quantity: z.number().int().positive(),
650
+ quantity: lineQuantitySchema,
554
651
  agreedUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()),
555
652
  lineNote: z.string().max(2000).optional(),
556
653
  /** Feature 159 — the `groups[].key` this line belongs to; absent or `null` = ungrouped. */
@@ -564,7 +661,7 @@ export const adminCreateQuoteRequestSchema = z
564
661
  /** Feature 159 — the new quote's groups in display order; lines name them by `groupKey`. */
565
662
  groups: z.array(newLineGroupInputSchema).optional(),
566
663
  /** In display order: each group's lines, then the ungrouped lines. */
567
- items: z.array(adminCreateQuoteRequestLineSchema).min(1),
664
+ items: z.array(adminCreateQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX),
568
665
  expiresInDays: z.number().int().nonnegative().optional(),
569
666
  /**
570
667
  * Feature 163 (FR-018) — the sales channel the operator raises the request on:
@@ -582,6 +679,11 @@ export const adminCreateQuoteRequestSchema = z
582
679
  * Not stored and not returned.
583
680
  */
584
681
  origin: OriginReferenceSchema.optional(),
682
+ /**
683
+ * Feature 175 (FR-019) — the request's custom-field values, validated with
684
+ * the administrator's rules inside the creating Command.
685
+ */
686
+ customFieldValues: customFieldValuesSchema.optional(),
585
687
  })
586
688
  .superRefine((body, ctx) => refineLineGrouping(ctx, body));
587
689
  /**
@@ -604,7 +706,7 @@ export const adminPatchQuoteRequestLineSchema = z.object({
604
706
  id: uuidSchema.optional(),
605
707
  productId: uuidSchema,
606
708
  variantId: uuidSchema.optional(),
607
- quantity: z.number().int().positive(),
709
+ quantity: lineQuantitySchema,
608
710
  agreedUnitPrice: fourDecimalUnitPrice(z.number().finite().nonnegative()).nullable().optional(),
609
711
  lineNote: z.string().max(2000).nullable().optional(),
610
712
  /** Feature 159 — the `groups[].key` this line belongs to; `null` = ungrouped. */
@@ -628,7 +730,7 @@ export const adminPatchQuoteRequestSchema = z
628
730
  */
629
731
  groups: z.array(lineGroupInputSchema).optional(),
630
732
  /** In display order: each group's lines, then the ungrouped lines. */
631
- items: z.array(adminPatchQuoteRequestLineSchema).min(1).optional(),
733
+ items: z.array(adminPatchQuoteRequestLineSchema).min(1).max(REQUEST_LINE_ITEMS_MAX).optional(),
632
734
  expiresInDays: z.number().int().nonnegative().optional(),
633
735
  /** Feature 055 — custom-field values for this quote request (validated on write). */
634
736
  customFieldValues: z.record(z.string(), z.unknown()).optional(),