@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,673 @@
1
+ import { z } from 'zod';
2
+ import type { BulkImportReport } from './import-export.js';
3
+ /**
4
+ * Inventory module contracts — feature 010 multi-warehouse rewrite.
5
+ * Source of truth per Constitution Principle V; the backend re-uses
6
+ * these schemas as route validators and the frontends consume the
7
+ * inferred TS types.
8
+ *
9
+ * See specs/010-inventory-module/contracts/ for the HTTP contract docs.
10
+ *
11
+ * Foundation 001 schemas (`stockLevelSchema`, `adjustStockRequestSchema`,
12
+ * `availabilityNotificationRequestSchema`) are preserved at the bottom
13
+ * of the file for backward compatibility with the existing admin
14
+ * inventory routes; new code should consume the feature-010 schemas.
15
+ */
16
+ export declare const warehouseAddressSchema: z.ZodObject<{
17
+ street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ }, z.core.$strip>;
22
+ export type WarehouseAddress = z.infer<typeof warehouseAddressSchema>;
23
+ export declare const warehouseContactSchema: z.ZodObject<{
24
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ }, z.core.$strip>;
28
+ export type WarehouseContact = z.infer<typeof warehouseContactSchema>;
29
+ export declare const warehouseSchema: z.ZodObject<{
30
+ id: z.ZodString;
31
+ name: z.ZodString;
32
+ code: z.ZodString;
33
+ active: z.ZodBoolean;
34
+ description: z.ZodNullable<z.ZodString>;
35
+ address: z.ZodNullable<z.ZodObject<{
36
+ street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ }, z.core.$strip>>;
41
+ contact: z.ZodNullable<z.ZodObject<{
42
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ }, z.core.$strip>>;
46
+ defaultLowStockThreshold: z.ZodNullable<z.ZodNumber>;
47
+ totals: z.ZodOptional<z.ZodObject<{
48
+ products: z.ZodNumber;
49
+ onHand: z.ZodNumber;
50
+ isDefaultForChannelCount: z.ZodNumber;
51
+ }, z.core.$strip>>;
52
+ createdAt: z.ZodString;
53
+ updatedAt: z.ZodString;
54
+ }, z.core.$strip>;
55
+ export type Warehouse = z.infer<typeof warehouseSchema>;
56
+ export declare const createWarehouseRequestSchema: z.ZodObject<{
57
+ name: z.ZodString;
58
+ code: z.ZodString;
59
+ active: z.ZodOptional<z.ZodBoolean>;
60
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
62
+ street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ }, z.core.$strip>>>;
67
+ contact: z.ZodOptional<z.ZodNullable<z.ZodObject<{
68
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ }, z.core.$strip>>>;
72
+ defaultLowStockThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
73
+ }, z.core.$strip>;
74
+ export type CreateWarehouseRequest = z.infer<typeof createWarehouseRequestSchema>;
75
+ export declare const updateWarehouseRequestSchema: z.ZodObject<{
76
+ name: z.ZodOptional<z.ZodString>;
77
+ active: z.ZodOptional<z.ZodBoolean>;
78
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
+ address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
80
+ street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ }, z.core.$strip>>>;
85
+ contact: z.ZodOptional<z.ZodNullable<z.ZodObject<{
86
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ }, z.core.$strip>>>;
90
+ defaultLowStockThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
91
+ }, z.core.$strict>;
92
+ export type UpdateWarehouseRequest = z.infer<typeof updateWarehouseRequestSchema>;
93
+ export declare const warehouseChannelAssignmentSchema: z.ZodObject<{
94
+ id: z.ZodString;
95
+ warehouseId: z.ZodString;
96
+ warehouseName: z.ZodString;
97
+ warehouseCode: z.ZodString;
98
+ isDefault: z.ZodBoolean;
99
+ sortOrder: z.ZodNumber;
100
+ assignedAt: z.ZodString;
101
+ }, z.core.$strip>;
102
+ export type WarehouseChannelAssignment = z.infer<typeof warehouseChannelAssignmentSchema>;
103
+ export declare const assignWarehouseToChannelRequestSchema: z.ZodObject<{
104
+ warehouseId: z.ZodString;
105
+ isDefault: z.ZodOptional<z.ZodBoolean>;
106
+ sortOrder: z.ZodOptional<z.ZodNumber>;
107
+ }, z.core.$strip>;
108
+ export type AssignWarehouseToChannelRequest = z.infer<typeof assignWarehouseToChannelRequestSchema>;
109
+ export declare const patchWarehouseChannelAssignmentRequestSchema: z.ZodObject<{
110
+ isDefault: z.ZodOptional<z.ZodBoolean>;
111
+ sortOrder: z.ZodOptional<z.ZodNumber>;
112
+ }, z.core.$strict>;
113
+ export type PatchWarehouseChannelAssignmentRequest = z.infer<typeof patchWarehouseChannelAssignmentRequestSchema>;
114
+ export declare const inventoryLandingKpisSchema: z.ZodObject<{
115
+ totalProductsTracked: z.ZodNumber;
116
+ totalOnHand: z.ZodNumber;
117
+ outOfStockCount: z.ZodNumber;
118
+ lowStockCount: z.ZodNumber;
119
+ perWarehouseTotals: z.ZodArray<z.ZodObject<{
120
+ warehouseId: z.ZodString;
121
+ warehouseCode: z.ZodString;
122
+ onHand: z.ZodNumber;
123
+ }, z.core.$strip>>;
124
+ }, z.core.$strip>;
125
+ export type InventoryLandingKpis = z.infer<typeof inventoryLandingKpisSchema>;
126
+ export declare const stockDisplayBandSchema: z.ZodEnum<{
127
+ available: "available";
128
+ out_of_stock: "out_of_stock";
129
+ high: "high";
130
+ medium: "medium";
131
+ low: "low";
132
+ }>;
133
+ export type StockDisplayBand = z.infer<typeof stockDisplayBandSchema>;
134
+ export declare const stockLevelRowSchema: z.ZodObject<{
135
+ productId: z.ZodString;
136
+ productSku: z.ZodString;
137
+ productName: z.ZodString;
138
+ manageStock: z.ZodBoolean;
139
+ backorderEnabled: z.ZodBoolean;
140
+ lowStockThreshold: z.ZodNullable<z.ZodNumber>;
141
+ lowStockThresholdMode: z.ZodEnum<{
142
+ cumulative: "cumulative";
143
+ per_warehouse: "per_warehouse";
144
+ }>;
145
+ perWarehouse: z.ZodArray<z.ZodObject<{
146
+ warehouseId: z.ZodString;
147
+ warehouseCode: z.ZodString;
148
+ onHand: z.ZodNumber;
149
+ reserved: z.ZodNumber;
150
+ lowStockThreshold: z.ZodNullable<z.ZodNumber>;
151
+ }, z.core.$strip>>;
152
+ cumulativeOnHand: z.ZodNumber;
153
+ displayBand: z.ZodEnum<{
154
+ available: "available";
155
+ out_of_stock: "out_of_stock";
156
+ high: "high";
157
+ medium: "medium";
158
+ low: "low";
159
+ }>;
160
+ isLowStock: z.ZodBoolean;
161
+ isOutOfStock: z.ZodBoolean;
162
+ }, z.core.$strip>;
163
+ export type StockLevelRow = z.infer<typeof stockLevelRowSchema>;
164
+ /**
165
+ * Bulk replace per-warehouse low-stock thresholds for one product.
166
+ * The submitted set is the new truth: any (product, warehouse) row not
167
+ * mentioned here is deleted. Pass `threshold: null` in an entry to
168
+ * delete that single entry while keeping others.
169
+ */
170
+ export declare const setProductWarehouseLowStockThresholdsRequestSchema: z.ZodObject<{
171
+ productId: z.ZodString;
172
+ thresholds: z.ZodArray<z.ZodObject<{
173
+ warehouseId: z.ZodString;
174
+ threshold: z.ZodNullable<z.ZodNumber>;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strip>;
177
+ export type SetProductWarehouseLowStockThresholdsRequest = z.infer<typeof setProductWarehouseLowStockThresholdsRequestSchema>;
178
+ export declare const setStockLevelRequestSchema: z.ZodObject<{
179
+ productId: z.ZodString;
180
+ warehouseId: z.ZodString;
181
+ variantId: z.ZodOptional<z.ZodString>;
182
+ onHand: z.ZodNumber;
183
+ }, z.core.$strip>;
184
+ export type SetStockLevelRequest = z.infer<typeof setStockLevelRequestSchema>;
185
+ export declare const inventoryDisplayModeSchema: z.ZodEnum<{
186
+ exact: "exact";
187
+ band: "band";
188
+ available_or_not: "available_or_not";
189
+ }>;
190
+ export type InventoryDisplayMode = z.infer<typeof inventoryDisplayModeSchema>;
191
+ export declare const thresholdTripleSchema: z.ZodObject<{
192
+ high: z.ZodNullable<z.ZodNumber>;
193
+ medium: z.ZodNullable<z.ZodNumber>;
194
+ low: z.ZodNullable<z.ZodNumber>;
195
+ }, z.core.$strip>;
196
+ export type ThresholdTriple = z.infer<typeof thresholdTripleSchema>;
197
+ export declare const inventoryThresholdsSchema: z.ZodObject<{
198
+ global: z.ZodObject<{
199
+ high: z.ZodNullable<z.ZodNumber>;
200
+ medium: z.ZodNullable<z.ZodNumber>;
201
+ low: z.ZodNullable<z.ZodNumber>;
202
+ }, z.core.$strip>;
203
+ perCategory: z.ZodArray<z.ZodObject<{
204
+ categoryId: z.ZodString;
205
+ high: z.ZodNullable<z.ZodNumber>;
206
+ medium: z.ZodNullable<z.ZodNumber>;
207
+ low: z.ZodNullable<z.ZodNumber>;
208
+ }, z.core.$strip>>;
209
+ perProduct: z.ZodArray<z.ZodObject<{
210
+ productId: z.ZodString;
211
+ high: z.ZodNullable<z.ZodNumber>;
212
+ medium: z.ZodNullable<z.ZodNumber>;
213
+ low: z.ZodNullable<z.ZodNumber>;
214
+ }, z.core.$strip>>;
215
+ }, z.core.$strip>;
216
+ export type InventoryThresholds = z.infer<typeof inventoryThresholdsSchema>;
217
+ export declare const patchInventoryThresholdsRequestSchema: z.ZodObject<{
218
+ global: z.ZodOptional<z.ZodObject<{
219
+ high: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
220
+ medium: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
221
+ low: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
222
+ }, z.core.$strip>>;
223
+ perCategory: z.ZodOptional<z.ZodArray<z.ZodObject<{
224
+ categoryId: z.ZodString;
225
+ high: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
226
+ medium: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
227
+ low: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
228
+ }, z.core.$strip>>>;
229
+ perProduct: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ productId: z.ZodString;
231
+ high: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
232
+ medium: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
233
+ low: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
234
+ }, z.core.$strip>>>;
235
+ }, z.core.$strict>;
236
+ export type PatchInventoryThresholdsRequest = z.infer<typeof patchInventoryThresholdsRequestSchema>;
237
+ export declare const storefrontProductStockSchema: z.ZodObject<{
238
+ productId: z.ZodString;
239
+ manageStock: z.ZodBoolean;
240
+ backorderEnabled: z.ZodBoolean;
241
+ displayMode: z.ZodEnum<{
242
+ exact: "exact";
243
+ band: "band";
244
+ available_or_not: "available_or_not";
245
+ }>;
246
+ displayBand: z.ZodEnum<{
247
+ available: "available";
248
+ out_of_stock: "out_of_stock";
249
+ high: "high";
250
+ medium: "medium";
251
+ low: "low";
252
+ }>;
253
+ exactOnHand: z.ZodNullable<z.ZodNumber>;
254
+ isOutOfStock: z.ZodBoolean;
255
+ showNotifyButton: z.ZodBoolean;
256
+ }, z.core.$strip>;
257
+ export type StorefrontProductStock = z.infer<typeof storefrontProductStockSchema>;
258
+ export declare const availabilityNotificationStatusSchema: z.ZodEnum<{
259
+ cancelled: "cancelled";
260
+ queued: "queued";
261
+ notified: "notified";
262
+ }>;
263
+ export type AvailabilityNotificationStatus = z.infer<typeof availabilityNotificationStatusSchema>;
264
+ export declare const availabilityNotificationSchema: z.ZodObject<{
265
+ id: z.ZodString;
266
+ productId: z.ZodString;
267
+ productName: z.ZodOptional<z.ZodString>;
268
+ productSku: z.ZodOptional<z.ZodString>;
269
+ customerAccountId: z.ZodNullable<z.ZodString>;
270
+ email: z.ZodString;
271
+ status: z.ZodEnum<{
272
+ cancelled: "cancelled";
273
+ queued: "queued";
274
+ notified: "notified";
275
+ }>;
276
+ queuedAt: z.ZodString;
277
+ notifiedAt: z.ZodNullable<z.ZodString>;
278
+ }, z.core.$strip>;
279
+ export type AvailabilityNotification = z.infer<typeof availabilityNotificationSchema>;
280
+ export declare const subscribeAvailabilityNotificationRequestSchema: z.ZodObject<{
281
+ productId: z.ZodString;
282
+ email: z.ZodString;
283
+ }, z.core.$strip>;
284
+ export type SubscribeAvailabilityNotificationRequest = z.infer<typeof subscribeAvailabilityNotificationRequestSchema>;
285
+ export declare const patchAvailabilityNotificationRequestSchema: z.ZodObject<{
286
+ status: z.ZodLiteral<"cancelled">;
287
+ }, z.core.$strip>;
288
+ export type PatchAvailabilityNotificationRequest = z.infer<typeof patchAvailabilityNotificationRequestSchema>;
289
+ export declare const fulfilmentStrategySchema: z.ZodEnum<{
290
+ any: "any";
291
+ default_first: "default_first";
292
+ lowest_stock_first: "lowest_stock_first";
293
+ highest_stock_first: "highest_stock_first";
294
+ defined_order: "defined_order";
295
+ }>;
296
+ export type FulfilmentStrategy = z.infer<typeof fulfilmentStrategySchema>;
297
+ export declare const stockImportErrorSchema: z.ZodObject<{
298
+ row: z.ZodNumber;
299
+ sku: z.ZodString;
300
+ reason: z.ZodEnum<{
301
+ product_not_found: "product_not_found";
302
+ invalid_quantity: "invalid_quantity";
303
+ malformed_row: "malformed_row";
304
+ }>;
305
+ }, z.core.$strip>;
306
+ export type StockImportError = z.infer<typeof stockImportErrorSchema>;
307
+ export declare const stockImportResultSchema: z.ZodObject<{
308
+ rowsRead: z.ZodNumber;
309
+ rowsApplied: z.ZodNumber;
310
+ rowsSkipped: z.ZodNumber;
311
+ errors: z.ZodArray<z.ZodObject<{
312
+ row: z.ZodNumber;
313
+ sku: z.ZodString;
314
+ reason: z.ZodEnum<{
315
+ product_not_found: "product_not_found";
316
+ invalid_quantity: "invalid_quantity";
317
+ malformed_row: "malformed_row";
318
+ }>;
319
+ }, z.core.$strip>>;
320
+ }, z.core.$strip>;
321
+ export type StockImportResult = z.infer<typeof stockImportResultSchema>;
322
+ export declare const stockLevelSchema: z.ZodObject<{
323
+ id: z.ZodString;
324
+ productId: z.ZodString;
325
+ variantId: z.ZodNullable<z.ZodString>;
326
+ onHand: z.ZodNumber;
327
+ reserved: z.ZodNumber;
328
+ updatedAt: z.ZodString;
329
+ }, z.core.$strip>;
330
+ export type StockLevel = z.infer<typeof stockLevelSchema>;
331
+ export declare const adjustStockRequestSchema: z.ZodObject<{
332
+ productId: z.ZodString;
333
+ variantId: z.ZodOptional<z.ZodString>;
334
+ delta: z.ZodNumber;
335
+ reason: z.ZodOptional<z.ZodString>;
336
+ }, z.core.$strip>;
337
+ export type AdjustStockRequest = z.infer<typeof adjustStockRequestSchema>;
338
+ export declare const availabilityNotificationRequestSchema: z.ZodObject<{
339
+ variantId: z.ZodOptional<z.ZodString>;
340
+ }, z.core.$strip>;
341
+ export type AvailabilityNotificationRequest = z.infer<typeof availabilityNotificationRequestSchema>;
342
+ /**
343
+ * The deterministic id of the warehouse every install seeds.
344
+ *
345
+ * Published as a **constant, not a port** (FR-013): switching `inventory` off
346
+ * does not change what the seeded id is, and `orders` compares against it when
347
+ * a line names no warehouse.
348
+ */
349
+ export declare const DEFAULT_WAREHOUSE_ID = "00000000-0000-4000-8000-00000000d017";
350
+ /**
351
+ * A warehouse as it crosses a module boundary — never the ORM entity.
352
+ *
353
+ * `address` reuses {@link WarehouseAddress}, declared above for the HTTP
354
+ * surface: the column stores exactly that JSONB shape, so a second
355
+ * declaration would be two names for one blob.
356
+ */
357
+ export interface WarehouseRecord {
358
+ id: string;
359
+ name: string;
360
+ code: string;
361
+ active: boolean;
362
+ description: string | null;
363
+ address: WarehouseAddress | null;
364
+ contactName: string | null;
365
+ contactEmail: string | null;
366
+ contactPhone: string | null;
367
+ defaultLowStockThreshold: number | null;
368
+ createdAt: Date;
369
+ updatedAt: Date;
370
+ }
371
+ /** One product's stock in one warehouse. `available` is `onHand - reserved`. */
372
+ export interface StockLevelRecord {
373
+ id: string;
374
+ productId: string;
375
+ variantId: string | null;
376
+ warehouseId: string;
377
+ onHand: number;
378
+ reserved: number;
379
+ createdAt: Date;
380
+ updatedAt: Date;
381
+ }
382
+ /**
383
+ * One **active** warehouse bound to a sales channel, in the order placement
384
+ * walks them. See {@link InventoryStockReadPort.listChannelWarehouses}.
385
+ */
386
+ export interface ChannelWarehouse {
387
+ warehouseId: string;
388
+ warehouseCode: string;
389
+ isDefault: boolean;
390
+ }
391
+ /** Which warehouses serve which sales channel, and in what order. */
392
+ export interface WarehouseChannelAssignmentRecord {
393
+ id: string;
394
+ warehouseId: string;
395
+ salesChannelId: string;
396
+ isDefault: boolean;
397
+ sortOrder: number;
398
+ createdAt: Date;
399
+ }
400
+ /**
401
+ * Container name: `inventoryStockReadPort`. Owner: `inventory`.
402
+ *
403
+ * `orders` reads stock at placement to pick warehouses, and `import_export`
404
+ * reads it to export a stock sheet. Both reach the `StockLevel` entity today,
405
+ * and `orders` does so through a **dynamic** import inside a method body —
406
+ * invisible to a reviewer scanning the import block, which is why the boundary
407
+ * check was taught to see one.
408
+ *
409
+ * `candidatesFor` answers the question `orders` actually asks: which
410
+ * warehouses can serve this line on this channel, with how much available,
411
+ * already shaped for {@link resolveAllocations}. Assembling that from three
412
+ * tables is this module's business, and it was being assembled in `orders`.
413
+ *
414
+ * **Owner off:** the seam fails closed — resolving this port throws
415
+ * `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`, so nothing
416
+ * half-executes. Whether `inventory` has an off state at all is its manifest's
417
+ * `activation` to say, not this line's: a module declaring
418
+ * `nonDeactivatable` never enters one.
419
+ */
420
+ export interface InventoryStockReadPort {
421
+ listStockForProducts(productIds: readonly string[], options?: {
422
+ warehouseId?: string;
423
+ }): Promise<StockLevelRecord[]>;
424
+ listWarehouses(options?: {
425
+ activeOnly?: boolean;
426
+ }): Promise<WarehouseRecord[]>;
427
+ listChannelAssignments(salesChannelId: string): Promise<WarehouseChannelAssignmentRecord[]>;
428
+ /**
429
+ * The **active** warehouses bound to a channel, joined with their codes and
430
+ * ordered the way placement walks them: `isDefault desc, sortOrder asc,
431
+ * createdAt asc`. When the channel has no active warehouse bound, this
432
+ * answers the seeded default warehouse — the fallback lives here rather than
433
+ * in the caller, which is where it used to be spelled out of a UUID constant
434
+ * copied from `warehouse.entity.ts` (D-94.4).
435
+ *
436
+ * Not a widening of {@link listChannelAssignments}: that one has a different
437
+ * ordering and a different consumer, and both should keep saying what they
438
+ * mean.
439
+ *
440
+ * **`candidatesFor` is not the method for the placement call site**, and the
441
+ * distinction matters more than it looks. `candidatesFor` computes
442
+ * availability through this module's own `EntityManager`, so it neither
443
+ * takes nor holds the `PESSIMISTIC_WRITE` on `stock_levels` that stops two
444
+ * concurrent placements allocating the same unit
445
+ * (`test/contract/orders/place-stock-race.test.ts`). Placement therefore
446
+ * takes the channel → warehouse binding from here and reads and locks the
447
+ * stock rows itself, on its own transaction.
448
+ */
449
+ listChannelWarehouses(salesChannelId: string): Promise<ChannelWarehouse[]>;
450
+ /**
451
+ * Candidate warehouses for one product line on one channel, ordered by
452
+ * warehouse code, with `available = onHand - reserved`. An empty answer
453
+ * means the line cannot be allocated anywhere, which is not the same as an
454
+ * error.
455
+ *
456
+ * Read outside any caller's transaction — see the warning on
457
+ * {@link listChannelWarehouses}.
458
+ */
459
+ candidatesFor(input: {
460
+ productId: string;
461
+ variantId?: string | null;
462
+ salesChannelId: string | null;
463
+ }): Promise<CandidateWarehouse[]>;
464
+ }
465
+ /**
466
+ * One row of a stock-level import.
467
+ *
468
+ * `productSku` rather than a product id: a spreadsheet addresses a product the
469
+ * way an operator does, and resolving it is this module's business because it
470
+ * is this module that decides a row addressing nothing is a rejected row.
471
+ * `variantId` absent or `null` addresses the simple-product baseline level.
472
+ *
473
+ * The row names no warehouse by default. The import applies to the seeded
474
+ * default one — the behaviour the CSV path has always had. Integrations that
475
+ * address a specific warehouse (for example ERP stock sync) may set
476
+ * `warehouseCode` to the warehouse's unique `code`.
477
+ */
478
+ export interface StockLevelImportRow {
479
+ productSku: string;
480
+ variantId?: string | null;
481
+ onHand: number;
482
+ warehouseCode?: string;
483
+ }
484
+ /**
485
+ * Container name: `inventoryStockImportPort`. Owner: `inventory`.
486
+ *
487
+ * All-or-nothing per call, one audit row — the same contract `catalog`'s bulk
488
+ * import port carries, and for the same reason. With `inventory` off the call answers 503
489
+ * `MODULE_DISABLED`; the caller is expected to decide presence before offering
490
+ * the surface at all.
491
+ */
492
+ export interface InventoryStockImportPort {
493
+ importStockLevels(rows: readonly StockLevelImportRow[]): Promise<BulkImportReport>;
494
+ }
495
+ /** How many `(product, warehouse)` thresholds the copy wrote. */
496
+ export interface ProductThresholdCopyResult {
497
+ copied: number;
498
+ }
499
+ /**
500
+ * Container name: `inventoryProductThresholdWritePort`. Owner: `inventory`.
501
+ *
502
+ * Issue #185. `catalog` duplicates a product and carries the source's
503
+ * per-warehouse low-stock thresholds over to the copy — with an
504
+ * `insert … select` against `product_warehouse_low_stock_thresholds`, a table
505
+ * this module owns and this module's migration creates. Four things were absent
506
+ * from that statement at once: no import specifier, so the boundary check could
507
+ * not see it; no gate, so the write proceeded with this module switched off; no
508
+ * declared edge; and no audit row on this side, so rows appeared here with
509
+ * nothing here having decided they should.
510
+ *
511
+ * The copy is therefore published rather than ledgered. It runs as one Command
512
+ * on **this module's own transaction**, not the caller's: the duplication
513
+ * commits its product row before it asks, an alerting profile is an indication
514
+ * on a product rather than part of what makes one, and a duplicate that lost
515
+ * its thresholds is exactly the duplicate an operator gets when this module was
516
+ * never installed. Rolling a whole duplication back over it would be the wrong
517
+ * trade in the other direction.
518
+ *
519
+ * **Owner off:** `catalog` declares this name `degrades-without` and decides
520
+ * presence in front of the gate, so a duplicate made while this module is off
521
+ * carries no per-warehouse thresholds and the duplication itself succeeds. The
522
+ * gate `providePort` wraps this in stays real for any caller that forgets.
523
+ */
524
+ export interface InventoryProductThresholdWritePort {
525
+ /**
526
+ * Copy every `(warehouse, threshold)` the source product carries onto the
527
+ * target, overwriting a row the target already holds for the same warehouse.
528
+ * A source with no thresholds answers `{ copied: 0 }` and records nothing —
529
+ * the same rule the channel-membership service applies to an idempotent add.
530
+ */
531
+ copyProductWarehouseThresholds(input: {
532
+ sourceProductId: string;
533
+ targetProductId: string;
534
+ }): Promise<ProductThresholdCopyResult>;
535
+ }
536
+ export interface FulfilmentLayer {
537
+ strategy: FulfilmentStrategy | null | undefined;
538
+ warehouseOrder: string[] | null | undefined;
539
+ }
540
+ export interface EffectiveFulfilment {
541
+ strategy: FulfilmentStrategy;
542
+ warehouseOrder: string[];
543
+ }
544
+ /**
545
+ * Effective fulfilment-strategy resolver (feature 010).
546
+ *
547
+ * The warehouse-picking strategy used to reserve stock at order placement is
548
+ * configurable at three levels, resolved with precedence:
549
+ *
550
+ * Product > Organization > Sales Channel (setting) > platform default
551
+ *
552
+ * Product and organisation each contribute an optional override layer; the
553
+ * sales-channel layer, and the platform default behind it, are resolved
554
+ * upstream by the settings module and arrive already collapsed into
555
+ * `channelDefault`. The first layer with a non-null `strategy` wins and
556
+ * supplies **both** its `strategy` and its `warehouseOrder` — the warehouse
557
+ * walk for `defined_order` never mixes across layers.
558
+ */
559
+ export declare function resolveEffectiveFulfilmentStrategy(product: FulfilmentLayer, organization: FulfilmentLayer, channelDefault: EffectiveFulfilment): EffectiveFulfilment;
560
+ export interface CandidateWarehouse {
561
+ warehouseId: string;
562
+ warehouseCode: string;
563
+ /** `onHand - reserved`. */
564
+ available: number;
565
+ isDefault: boolean;
566
+ }
567
+ export interface AllocationDecision {
568
+ warehouseId: string;
569
+ quantity: number;
570
+ /**
571
+ * True when this allocation is going through with insufficient stock
572
+ * because the product has `backorderEnabled = true`.
573
+ */
574
+ isBackorder: boolean;
575
+ }
576
+ export interface ResolveAllocationsInput {
577
+ quantity: number;
578
+ candidateWarehouses: CandidateWarehouse[];
579
+ strategy: FulfilmentStrategy;
580
+ /** When `defined_order`, the configured warehouse-id list to walk. */
581
+ warehouseOrder?: string[];
582
+ /**
583
+ * When the product allows backorder, lines that cannot be fully fulfilled
584
+ * still go through; the unfulfilled remainder is flagged as a backorder
585
+ * against the first-choice warehouse.
586
+ */
587
+ backorderEnabled: boolean;
588
+ }
589
+ export type AllocationOutcome = {
590
+ ok: true;
591
+ allocations: AllocationDecision[];
592
+ } | {
593
+ ok: false;
594
+ reason: 'insufficient_stock';
595
+ };
596
+ /**
597
+ * Fulfilment-strategy resolver (feature 010 / FR-029…FR-033, research §R4).
598
+ *
599
+ * Picks a list of `(warehouseId, quantity)` allocations for a single order
600
+ * line given the available candidate warehouses and the resolved strategy.
601
+ * Tie-break on equal `available` quantities is warehouse-code lexical order —
602
+ * deterministic and documented.
603
+ *
604
+ * Of the five strategies only `default_first` **splits** a line across
605
+ * warehouses; the others pick a single warehouse per line and refuse the line
606
+ * if that warehouse cannot fully satisfy the requested quantity.
607
+ */
608
+ export declare function resolveAllocations(input: ResolveAllocationsInput): AllocationOutcome;
609
+ /**
610
+ * Container name: `inventoryFulfilmentPlanningPort`. Owner: `inventory`.
611
+ *
612
+ * The warehouse-picking **policy** placement runs, published (D-94.4).
613
+ *
614
+ * `orders` used to reach both halves through `await import(
615
+ * '../../inventory/services/…')` inside the placement method body: a dynamic
616
+ * import, invisible to a reviewer scanning the import block, of the rules that
617
+ * decide which warehouse serves a line. Publishing them stops the policy being
618
+ * something `orders` can re-implement by editing an import.
619
+ *
620
+ * Two methods and not two more on {@link InventoryStockReadPort}: a *read*
621
+ * port that also decides policy makes its own name a lie. Both are **pure over
622
+ * their arguments** — no `EntityManager`, no table, no clock — so the contract
623
+ * stays FR-034-clean and the caller may run them inside its own transaction
624
+ * without the owner ever touching it.
625
+ */
626
+ export interface InventoryFulfilmentPlanningPort {
627
+ /**
628
+ * Product > Organization > Sales Channel (already collapsed into
629
+ * `channelDefault`) > platform default. See
630
+ * {@link resolveEffectiveFulfilmentStrategy}.
631
+ */
632
+ resolveEffectiveStrategy(product: FulfilmentLayer, organization: FulfilmentLayer, channelDefault: EffectiveFulfilment): EffectiveFulfilment;
633
+ /**
634
+ * One line's allocation plan over the candidate warehouses the caller has
635
+ * already read **and locked**. See {@link resolveAllocations}.
636
+ */
637
+ planAllocations(input: ResolveAllocationsInput): AllocationOutcome;
638
+ }
639
+ /**
640
+ * Container name: `inventoryAvailabilityPort`. Owner: `inventory`.
641
+ *
642
+ * One product's display band and its channel-public in-stock flag, in batch,
643
+ * for a caller that is projecting a catalogue outward — `catalog`'s external
644
+ * product surface and `product_feeds`' generation pipeline.
645
+ *
646
+ * Cumulative on-hand across the warehouses the sales channel is served from,
647
+ * mapped through the product / category / global threshold chain. A product
648
+ * with no stock rows still gets an entry: `out_of_stock`, or `available` when
649
+ * stock is not managed for it. That is what makes the result usable as a map —
650
+ * a caller can tell "no stock" from "not asked about".
651
+ *
652
+ * The shape was declared inline in a composition root's local type and in this
653
+ * module's own cradle, twice, and the `providePort` call carried no type
654
+ * argument at all — so a consumer resolving it had nothing to name and
655
+ * `check:port-shape` had nothing to compare the registration to. Published in
656
+ * `specs/110-instance-repository/` T118c, when the first consumer stopped being
657
+ * a root.
658
+ *
659
+ * **Owner off:** the seam fails closed — resolving this port throws
660
+ * `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`, so nothing
661
+ * half-executes. `catalog` declares this edge `degrades-without` and decides
662
+ * presence in front of the gate, which is a consumer's judgement about its own
663
+ * surface and not a property of this port; `product_feeds` binds it, because a
664
+ * feed whose availability column is silently absent is worse than a run that
665
+ * stops and records why.
666
+ */
667
+ export interface InventoryAvailabilityPort {
668
+ resolveAvailabilityBands(productIds: string[], salesChannelId: string): Promise<Map<string, {
669
+ band: StockDisplayBand;
670
+ inStock: boolean;
671
+ }>>;
672
+ }
673
+ //# sourceMappingURL=inventory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../src/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AAMH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,K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