@augno/sdk 0.14.0 → 0.15.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 (214) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/package.json +1 -1
  3. package/resources/catalog/product-lines/product-lines.d.mts +53 -0
  4. package/resources/catalog/product-lines/product-lines.d.mts.map +1 -1
  5. package/resources/catalog/product-lines/product-lines.d.ts +53 -0
  6. package/resources/catalog/product-lines/product-lines.d.ts.map +1 -1
  7. package/resources/catalog/product-lines/product-lines.js.map +1 -1
  8. package/resources/catalog/product-lines/product-lines.mjs.map +1 -1
  9. package/resources/core/analytics.d.mts +252 -1
  10. package/resources/core/analytics.d.mts.map +1 -1
  11. package/resources/core/analytics.d.ts +252 -1
  12. package/resources/core/analytics.d.ts.map +1 -1
  13. package/resources/core/analytics.js +38 -0
  14. package/resources/core/analytics.js.map +1 -1
  15. package/resources/core/analytics.mjs +38 -0
  16. package/resources/core/analytics.mjs.map +1 -1
  17. package/resources/core/audit-events.d.mts +4 -4
  18. package/resources/core/audit-events.d.mts.map +1 -1
  19. package/resources/core/audit-events.d.ts +4 -4
  20. package/resources/core/audit-events.d.ts.map +1 -1
  21. package/resources/core/core.d.mts +4 -4
  22. package/resources/core/core.d.mts.map +1 -1
  23. package/resources/core/core.d.ts +4 -4
  24. package/resources/core/core.d.ts.map +1 -1
  25. package/resources/core/core.js.map +1 -1
  26. package/resources/core/core.mjs.map +1 -1
  27. package/resources/core/index.d.mts +1 -1
  28. package/resources/core/index.d.mts.map +1 -1
  29. package/resources/core/index.d.ts +1 -1
  30. package/resources/core/index.d.ts.map +1 -1
  31. package/resources/core/index.js.map +1 -1
  32. package/resources/core/index.mjs.map +1 -1
  33. package/resources/messaging/conversations/conversations.d.mts +3 -3
  34. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  35. package/resources/messaging/conversations/conversations.d.ts +3 -3
  36. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  37. package/resources/messaging/conversations/conversations.js.map +1 -1
  38. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  39. package/resources/messaging/conversations/links.d.mts +2 -2
  40. package/resources/messaging/conversations/links.d.mts.map +1 -1
  41. package/resources/messaging/conversations/links.d.ts +2 -2
  42. package/resources/messaging/conversations/links.d.ts.map +1 -1
  43. package/resources/messaging/conversations/messages.d.mts +2 -2
  44. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  45. package/resources/messaging/conversations/messages.d.ts +2 -2
  46. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  47. package/resources/messaging/notifications/notifications.d.mts +2 -2
  48. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  49. package/resources/messaging/notifications/notifications.d.ts +2 -2
  50. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  51. package/resources/messaging/notifications/notifications.js.map +1 -1
  52. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  53. package/resources/operations/fulfillment-recommendations/actions.d.mts +59 -0
  54. package/resources/operations/fulfillment-recommendations/actions.d.mts.map +1 -0
  55. package/resources/operations/fulfillment-recommendations/actions.d.ts +59 -0
  56. package/resources/operations/fulfillment-recommendations/actions.d.ts.map +1 -0
  57. package/resources/operations/fulfillment-recommendations/actions.js +40 -0
  58. package/resources/operations/fulfillment-recommendations/actions.js.map +1 -0
  59. package/resources/operations/fulfillment-recommendations/actions.mjs +36 -0
  60. package/resources/operations/fulfillment-recommendations/actions.mjs.map +1 -0
  61. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.d.mts +165 -0
  62. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.d.mts.map +1 -0
  63. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.d.ts +165 -0
  64. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.d.ts.map +1 -0
  65. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.js +52 -0
  66. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.js.map +1 -0
  67. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.mjs +47 -0
  68. package/resources/operations/fulfillment-recommendations/fulfillment-recommendations.mjs.map +1 -0
  69. package/resources/operations/fulfillment-recommendations/index.d.mts +3 -0
  70. package/resources/operations/fulfillment-recommendations/index.d.mts.map +1 -0
  71. package/resources/operations/fulfillment-recommendations/index.d.ts +3 -0
  72. package/resources/operations/fulfillment-recommendations/index.d.ts.map +1 -0
  73. package/resources/operations/fulfillment-recommendations/index.js +9 -0
  74. package/resources/operations/fulfillment-recommendations/index.js.map +1 -0
  75. package/resources/operations/fulfillment-recommendations/index.mjs +4 -0
  76. package/resources/operations/fulfillment-recommendations/index.mjs.map +1 -0
  77. package/resources/operations/fulfillment-recommendations.d.mts +2 -0
  78. package/resources/operations/fulfillment-recommendations.d.mts.map +1 -0
  79. package/resources/operations/fulfillment-recommendations.d.ts +2 -0
  80. package/resources/operations/fulfillment-recommendations.d.ts.map +1 -0
  81. package/resources/operations/fulfillment-recommendations.js +6 -0
  82. package/resources/operations/fulfillment-recommendations.js.map +1 -0
  83. package/resources/operations/fulfillment-recommendations.mjs +3 -0
  84. package/resources/operations/fulfillment-recommendations.mjs.map +1 -0
  85. package/resources/operations/index.d.mts +2 -1
  86. package/resources/operations/index.d.mts.map +1 -1
  87. package/resources/operations/index.d.ts +2 -1
  88. package/resources/operations/index.d.ts.map +1 -1
  89. package/resources/operations/index.js +11 -9
  90. package/resources/operations/index.js.map +1 -1
  91. package/resources/operations/index.mjs +1 -0
  92. package/resources/operations/index.mjs.map +1 -1
  93. package/resources/operations/operations.d.mts +6 -2
  94. package/resources/operations/operations.d.mts.map +1 -1
  95. package/resources/operations/operations.d.ts +6 -2
  96. package/resources/operations/operations.d.ts.map +1 -1
  97. package/resources/operations/operations.js +4 -0
  98. package/resources/operations/operations.js.map +1 -1
  99. package/resources/operations/operations.mjs +4 -0
  100. package/resources/operations/operations.mjs.map +1 -1
  101. package/resources/operations/production-schedule-settings/index.d.mts +1 -0
  102. package/resources/operations/production-schedule-settings/index.d.mts.map +1 -1
  103. package/resources/operations/production-schedule-settings/index.d.ts +1 -0
  104. package/resources/operations/production-schedule-settings/index.d.ts.map +1 -1
  105. package/resources/operations/production-schedule-settings/index.js +3 -1
  106. package/resources/operations/production-schedule-settings/index.js.map +1 -1
  107. package/resources/operations/production-schedule-settings/index.mjs +1 -0
  108. package/resources/operations/production-schedule-settings/index.mjs.map +1 -1
  109. package/resources/operations/production-schedule-settings/items.d.mts +228 -0
  110. package/resources/operations/production-schedule-settings/items.d.mts.map +1 -0
  111. package/resources/operations/production-schedule-settings/items.d.ts +228 -0
  112. package/resources/operations/production-schedule-settings/items.d.ts.map +1 -0
  113. package/resources/operations/production-schedule-settings/items.js +109 -0
  114. package/resources/operations/production-schedule-settings/items.js.map +1 -0
  115. package/resources/operations/production-schedule-settings/items.mjs +105 -0
  116. package/resources/operations/production-schedule-settings/items.mjs.map +1 -0
  117. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts +60 -0
  118. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts.map +1 -1
  119. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts +60 -0
  120. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts.map +1 -1
  121. package/resources/operations/production-schedule-settings/production-schedule-settings.js +6 -0
  122. package/resources/operations/production-schedule-settings/production-schedule-settings.js.map +1 -1
  123. package/resources/operations/production-schedule-settings/production-schedule-settings.mjs +6 -0
  124. package/resources/operations/production-schedule-settings/production-schedule-settings.mjs.map +1 -1
  125. package/resources/operations/production-schedules/actions.d.mts +117 -1
  126. package/resources/operations/production-schedules/actions.d.mts.map +1 -1
  127. package/resources/operations/production-schedules/actions.d.ts +117 -1
  128. package/resources/operations/production-schedules/actions.d.ts.map +1 -1
  129. package/resources/operations/production-schedules/actions.js +34 -0
  130. package/resources/operations/production-schedules/actions.js.map +1 -1
  131. package/resources/operations/production-schedules/actions.mjs +34 -0
  132. package/resources/operations/production-schedules/actions.mjs.map +1 -1
  133. package/resources/operations/production-schedules/index.d.mts +2 -2
  134. package/resources/operations/production-schedules/index.d.mts.map +1 -1
  135. package/resources/operations/production-schedules/index.d.ts +2 -2
  136. package/resources/operations/production-schedules/index.d.ts.map +1 -1
  137. package/resources/operations/production-schedules/index.js.map +1 -1
  138. package/resources/operations/production-schedules/index.mjs.map +1 -1
  139. package/resources/operations/production-schedules/production-schedules.d.mts +260 -3
  140. package/resources/operations/production-schedules/production-schedules.d.mts.map +1 -1
  141. package/resources/operations/production-schedules/production-schedules.d.ts +260 -3
  142. package/resources/operations/production-schedules/production-schedules.d.ts.map +1 -1
  143. package/resources/operations/production-schedules/production-schedules.js +29 -0
  144. package/resources/operations/production-schedules/production-schedules.js.map +1 -1
  145. package/resources/operations/production-schedules/production-schedules.mjs +29 -0
  146. package/resources/operations/production-schedules/production-schedules.mjs.map +1 -1
  147. package/resources/sales/account-groups.d.mts +27 -0
  148. package/resources/sales/account-groups.d.mts.map +1 -1
  149. package/resources/sales/account-groups.d.ts +27 -0
  150. package/resources/sales/account-groups.d.ts.map +1 -1
  151. package/resources/sales/customers/customers.d.mts +99 -1
  152. package/resources/sales/customers/customers.d.mts.map +1 -1
  153. package/resources/sales/customers/customers.d.ts +99 -1
  154. package/resources/sales/customers/customers.d.ts.map +1 -1
  155. package/resources/sales/customers/customers.js +27 -0
  156. package/resources/sales/customers/customers.js.map +1 -1
  157. package/resources/sales/customers/customers.mjs +27 -0
  158. package/resources/sales/customers/customers.mjs.map +1 -1
  159. package/resources/sales/customers/index.d.mts +1 -1
  160. package/resources/sales/customers/index.d.mts.map +1 -1
  161. package/resources/sales/customers/index.d.ts +1 -1
  162. package/resources/sales/customers/index.d.ts.map +1 -1
  163. package/resources/sales/customers/index.js.map +1 -1
  164. package/resources/sales/customers/index.mjs.map +1 -1
  165. package/resources/sales/index.d.mts +1 -1
  166. package/resources/sales/index.d.mts.map +1 -1
  167. package/resources/sales/index.d.ts +1 -1
  168. package/resources/sales/index.d.ts.map +1 -1
  169. package/resources/sales/index.js.map +1 -1
  170. package/resources/sales/index.mjs.map +1 -1
  171. package/resources/sales/sales-orders/sales-orders.d.mts +35 -0
  172. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  173. package/resources/sales/sales-orders/sales-orders.d.ts +35 -0
  174. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  175. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  176. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  177. package/resources/sales/sales.d.mts +2 -2
  178. package/resources/sales/sales.d.mts.map +1 -1
  179. package/resources/sales/sales.d.ts +2 -2
  180. package/resources/sales/sales.d.ts.map +1 -1
  181. package/resources/sales/sales.js.map +1 -1
  182. package/resources/sales/sales.mjs.map +1 -1
  183. package/src/resources/catalog/product-lines/product-lines.ts +58 -0
  184. package/src/resources/core/analytics.ts +300 -0
  185. package/src/resources/core/audit-events.ts +40 -0
  186. package/src/resources/core/core.ts +34 -0
  187. package/src/resources/core/index.ts +7 -0
  188. package/src/resources/messaging/conversations/conversations.ts +30 -0
  189. package/src/resources/messaging/conversations/links.ts +20 -0
  190. package/src/resources/messaging/conversations/messages.ts +20 -0
  191. package/src/resources/messaging/notifications/notifications.ts +20 -0
  192. package/src/resources/operations/fulfillment-recommendations/actions.ts +75 -0
  193. package/src/resources/operations/fulfillment-recommendations/fulfillment-recommendations.ts +206 -0
  194. package/src/resources/operations/fulfillment-recommendations/index.ts +8 -0
  195. package/src/resources/operations/fulfillment-recommendations.ts +3 -0
  196. package/src/resources/operations/index.ts +11 -0
  197. package/src/resources/operations/operations.ts +27 -0
  198. package/src/resources/operations/production-schedule-settings/index.ts +8 -0
  199. package/src/resources/operations/production-schedule-settings/items.ts +273 -0
  200. package/src/resources/operations/production-schedule-settings/production-schedule-settings.ts +82 -0
  201. package/src/resources/operations/production-schedules/actions.ts +144 -0
  202. package/src/resources/operations/production-schedules/index.ts +9 -0
  203. package/src/resources/operations/production-schedules/production-schedules.ts +310 -0
  204. package/src/resources/sales/account-groups.ts +32 -0
  205. package/src/resources/sales/customers/customers.ts +112 -0
  206. package/src/resources/sales/customers/index.ts +1 -0
  207. package/src/resources/sales/index.ts +1 -0
  208. package/src/resources/sales/sales-orders/sales-orders.ts +41 -0
  209. package/src/resources/sales/sales.ts +2 -0
  210. package/src/version.ts +1 -1
  211. package/version.d.mts +1 -1
  212. package/version.d.ts +1 -1
  213. package/version.js +1 -1
  214. package/version.mjs +1 -1
@@ -8,6 +8,7 @@ import * as ActionsAPI from './actions';
8
8
  import {
9
9
  ActionPreviewParams,
10
10
  ActionPreviewRegenerateParams,
11
+ ActionQuotePromiseDateParams,
11
12
  ActionRegenerateParams,
12
13
  ActionReleaseWeekParams,
13
14
  Actions,
@@ -19,6 +20,8 @@ import {
19
20
  PreviewRegenerateProductionScheduleRequest,
20
21
  ProductionSchedulePreview,
21
22
  ProductionScheduleRegeneratePreview,
23
+ PromiseDateQuote,
24
+ QuotePromiseDateRequest,
22
25
  RegenerateProductionScheduleRequest,
23
26
  ReleaseProductionScheduleWeekRequest,
24
27
  ReleaseScheduleWeekResult,
@@ -228,6 +231,36 @@ export class ProductionSchedules extends APIResource {
228
231
  });
229
232
  }
230
233
 
234
+ /**
235
+ * Returns the customer commitments this schedule version does not meet, soonest
236
+ * first.
237
+ *
238
+ * Three ways an order lands here. `past_due` means the constraint stage needed to
239
+ * start before this plan begins. `undated` means the order carries no ship-by
240
+ * commitment at all, so it is treated as owed now. `short` means the plan simply
241
+ * does not build enough of it in time — the campaigns it does allocate are listed
242
+ * alongside, because building three hundred of five hundred is a different
243
+ * conversation from building none.
244
+ *
245
+ * Read from the version's own record rather than re-solved, so what comes back is
246
+ * what was decided when the plan was made. A version generated before commitments
247
+ * were tracked reports nothing, which is correct: it made no promises it could
248
+ * break.
249
+ *
250
+ * This endpoint requires the permission: `production_schedules:read`.
251
+ *
252
+ * @example
253
+ * ```ts
254
+ * const listScheduleOrderCoverage =
255
+ * await client.operations.productionSchedules.retrieveAtRiskOrders(
256
+ * 'pnsc_m4zt3z8g8src',
257
+ * );
258
+ * ```
259
+ */
260
+ retrieveAtRiskOrders(id: string, options?: RequestOptions): APIPromise<ListScheduleOrderCoverage> {
261
+ return this._client.get(path`/v1/operations/production-schedules/${id}/at-risk-orders`, options);
262
+ }
263
+
231
264
  /**
232
265
  * Returns the append-only log of hand changes made to a schedule, most recent
233
266
  * first.
@@ -570,6 +603,87 @@ export interface ListScheduleAppliedOverride {
570
603
  page_info: APIKeysAPI.PageInfo;
571
604
  }
572
605
 
606
+ /**
607
+ * A single page of resources, together with the metadata needed to page through
608
+ * the rest of the result set.
609
+ */
610
+ export interface ListScheduleAtRiskOrder {
611
+ /**
612
+ * Resources in this page.
613
+ */
614
+ data: Array<ScheduleAtRiskOrder>;
615
+
616
+ /**
617
+ * Resource type identifier.
618
+ */
619
+ object: 'list';
620
+
621
+ /**
622
+ * PageInfo describes where the current page sits within a paginated result set and
623
+ * how to move to the adjacent pages.
624
+ *
625
+ * Page a list by following the URLs below rather than assembling cursors yourself.
626
+ * For a top-level list endpoint the URL repeats the original request's query
627
+ * string with only the cursor swapped, so following it preserves the same filters,
628
+ * search term, and page size.
629
+ */
630
+ page_info: APIKeysAPI.PageInfo;
631
+ }
632
+
633
+ /**
634
+ * A single page of resources, together with the metadata needed to page through
635
+ * the rest of the result set.
636
+ */
637
+ export interface ListScheduleOrderCoverage {
638
+ /**
639
+ * Resources in this page.
640
+ */
641
+ data: Array<ScheduleOrderCoverage>;
642
+
643
+ /**
644
+ * Resource type identifier.
645
+ */
646
+ object: 'list';
647
+
648
+ /**
649
+ * PageInfo describes where the current page sits within a paginated result set and
650
+ * how to move to the adjacent pages.
651
+ *
652
+ * Page a list by following the URLs below rather than assembling cursors yourself.
653
+ * For a top-level list endpoint the URL repeats the original request's query
654
+ * string with only the cursor swapped, so following it preserves the same filters,
655
+ * search term, and page size.
656
+ */
657
+ page_info: APIKeysAPI.PageInfo;
658
+ }
659
+
660
+ /**
661
+ * A single page of resources, together with the metadata needed to page through
662
+ * the rest of the result set.
663
+ */
664
+ export interface ListScheduleOrderCoverageLine {
665
+ /**
666
+ * Resources in this page.
667
+ */
668
+ data: Array<ScheduleOrderCoverageLine>;
669
+
670
+ /**
671
+ * Resource type identifier.
672
+ */
673
+ object: 'list';
674
+
675
+ /**
676
+ * PageInfo describes where the current page sits within a paginated result set and
677
+ * how to move to the adjacent pages.
678
+ *
679
+ * Page a list by following the URLs below rather than assembling cursors yourself.
680
+ * For a top-level list endpoint the URL repeats the original request's query
681
+ * string with only the cursor swapped, so following it preserves the same filters,
682
+ * search term, and page size.
683
+ */
684
+ page_info: APIKeysAPI.PageInfo;
685
+ }
686
+
573
687
  /**
574
688
  * A saved production schedule.
575
689
  *
@@ -1140,6 +1254,26 @@ export interface ProductionScheduleItemPolicy {
1140
1254
  */
1141
1255
  finish_lead_time_weeks: number;
1142
1256
 
1257
+ /**
1258
+ * Outstanding quantity the order book already owed for this item over the horizon.
1259
+ */
1260
+ firm_demand_units: number;
1261
+
1262
+ /**
1263
+ * Quantity the forecast projected for the same window.
1264
+ */
1265
+ forecast_demand_units: number;
1266
+
1267
+ /**
1268
+ * How this item was planned.
1269
+ *
1270
+ * - `make_to_stock`: built to the forecast, holding a safety stock against its
1271
+ * variability.
1272
+ * - `make_to_order`: built only against orders already on the book, holding no
1273
+ * buffer, so its safety stocks and reorder point are all zero.
1274
+ */
1275
+ fulfillment_policy: 'make_to_stock' | 'make_to_order';
1276
+
1143
1277
  /**
1144
1278
  * Annual cost of holding one unit.
1145
1279
  */
@@ -1181,6 +1315,12 @@ export interface ProductionScheduleItemPolicy {
1181
1315
  */
1182
1316
  order_up_to: number;
1183
1317
 
1318
+ /**
1319
+ * Which rule decided that policy: the item itself, its product line, or the
1320
+ * account default.
1321
+ */
1322
+ policy_source: 'item' | 'product_line' | 'account_default';
1323
+
1184
1324
  /**
1185
1325
  * Entity is a polymorphic reference to any resource in the system.
1186
1326
  */
@@ -1479,6 +1619,53 @@ export interface ScheduleAppliedOverride {
1479
1619
  | null;
1480
1620
  }
1481
1621
 
1622
+ /**
1623
+ * An order commitment the plan does not meet.
1624
+ */
1625
+ export interface ScheduleAtRiskOrder {
1626
+ /**
1627
+ * Horizon week the constraint stage has to finish in for the order to ship on
1628
+ * time.
1629
+ */
1630
+ due_week: number;
1631
+
1632
+ /**
1633
+ * Entity is a polymorphic reference to any resource in the system.
1634
+ */
1635
+ item: CoreAPI.Entity | null;
1636
+
1637
+ /**
1638
+ * Resource type identifier.
1639
+ */
1640
+ object: 'schedule_at_risk_order';
1641
+
1642
+ /**
1643
+ * Why the commitment is at risk.
1644
+ *
1645
+ * - `past_due`: production needed to start before this plan begins.
1646
+ * - `undated`: the order carries no ship-by commitment, so it is treated as owed
1647
+ * now.
1648
+ * - `short`: the plan projects less stock than the order needs in the week it is
1649
+ * needed.
1650
+ */
1651
+ reason: 'past_due' | 'undated' | 'short';
1652
+
1653
+ /**
1654
+ * Entity is a polymorphic reference to any resource in the system.
1655
+ */
1656
+ sales_order: CoreAPI.Entity | null;
1657
+
1658
+ /**
1659
+ * SKU of that item.
1660
+ */
1661
+ sku: string;
1662
+
1663
+ /**
1664
+ * Outstanding quantity still owed.
1665
+ */
1666
+ units: number;
1667
+ }
1668
+
1482
1669
  /**
1483
1670
  * What the solver could not do, and why the plan differs from raw history.
1484
1671
  */
@@ -1489,6 +1676,12 @@ export interface ScheduleDiagnostics {
1489
1676
  */
1490
1677
  applied_overrides: ListScheduleAppliedOverride | null;
1491
1678
 
1679
+ /**
1680
+ * A single page of resources, together with the metadata needed to page through
1681
+ * the rest of the result set.
1682
+ */
1683
+ at_risk_orders: ListScheduleAtRiskOrder | null;
1684
+
1492
1685
  /**
1493
1686
  * Average inputs a product transition introduces, measured from history.
1494
1687
  */
@@ -1527,6 +1720,14 @@ export interface ScheduleDiagnostics {
1527
1720
  */
1528
1721
  excluded_item_count: number;
1529
1722
 
1723
+ /**
1724
+ * Outstanding order quantity this plan owes, expressed in the constraint item's
1725
+ * own unit.
1726
+ *
1727
+ * Zero means nothing is on order and the plan is driven purely by the forecast.
1728
+ */
1729
+ firm_demand_units: number;
1730
+
1530
1731
  /**
1531
1732
  * Items with no measured run rate, which cannot be scheduled because their machine
1532
1733
  * time is unknown.
@@ -1540,6 +1741,11 @@ export interface ScheduleDiagnostics {
1540
1741
  */
1541
1742
  machines_without_step: number;
1542
1743
 
1744
+ /**
1745
+ * Planned items built only against the order book rather than to a forecast.
1746
+ */
1747
+ make_to_order_item_count: number;
1748
+
1543
1749
  /**
1544
1750
  * Batches found on those machines in the demand window.
1545
1751
  *
@@ -1548,6 +1754,15 @@ export interface ScheduleDiagnostics {
1548
1754
  */
1549
1755
  measured_batch_count: number;
1550
1756
 
1757
+ /**
1758
+ * Open orders carrying no ship-by commitment, dated at the front of the horizon
1759
+ * because they are issued and unshipped.
1760
+ *
1761
+ * A non-zero count means orders placed before commitments were tracked still need
1762
+ * a ship-by date.
1763
+ */
1764
+ undated_firm_order_count: number;
1765
+
1551
1766
  /**
1552
1767
  * Items that cannot fit even a single lot into a machine-week and are therefore
1553
1768
  * never scheduled.
@@ -1555,6 +1770,92 @@ export interface ScheduleDiagnostics {
1555
1770
  unschedulable_skus: Array<string>;
1556
1771
  }
1557
1772
 
1773
+ /**
1774
+ * An order this schedule does not build in time, with the campaigns covering the
1775
+ * part it does.
1776
+ */
1777
+ export interface ScheduleOrderCoverage {
1778
+ /**
1779
+ * A single page of resources, together with the metadata needed to page through
1780
+ * the rest of the result set.
1781
+ */
1782
+ covering_lines: ListScheduleOrderCoverageLine | null;
1783
+
1784
+ /**
1785
+ * Horizon week the constraint stage has to finish in for the order to ship on
1786
+ * time.
1787
+ */
1788
+ due_week: number;
1789
+
1790
+ /**
1791
+ * Entity is a polymorphic reference to any resource in the system.
1792
+ */
1793
+ item: CoreAPI.Entity | null;
1794
+
1795
+ /**
1796
+ * Resource type identifier.
1797
+ */
1798
+ object: 'schedule_order_coverage';
1799
+
1800
+ /**
1801
+ * Why the commitment is at risk.
1802
+ */
1803
+ reason: 'past_due' | 'undated' | 'short';
1804
+
1805
+ /**
1806
+ * Entity is a polymorphic reference to any resource in the system.
1807
+ */
1808
+ sales_order: CoreAPI.Entity | null;
1809
+
1810
+ /**
1811
+ * The date this order is contractually due to ship.
1812
+ */
1813
+ ship_by_date: string | null;
1814
+
1815
+ /**
1816
+ * SKU of that item.
1817
+ */
1818
+ sku: string;
1819
+
1820
+ /**
1821
+ * Quantity the plan does not build in time.
1822
+ *
1823
+ * Less than the whole order when the plan builds part of it — a mostly-built order
1824
+ * is mostly built, and reporting the full quantity would read as a total miss.
1825
+ */
1826
+ units_at_risk: number;
1827
+ }
1828
+
1829
+ /**
1830
+ * One campaign earmarked for an order.
1831
+ */
1832
+ export interface ScheduleOrderCoverageLine {
1833
+ /**
1834
+ * Quantity of that campaign earmarked for this order.
1835
+ */
1836
+ allocated_quantity: number;
1837
+
1838
+ /**
1839
+ * Entity is a polymorphic reference to any resource in the system.
1840
+ */
1841
+ machine: CoreAPI.Entity | null;
1842
+
1843
+ /**
1844
+ * Resource type identifier.
1845
+ */
1846
+ object: 'schedule_order_coverage_line';
1847
+
1848
+ /**
1849
+ * Entity is a polymorphic reference to any resource in the system.
1850
+ */
1851
+ production_schedule_line: CoreAPI.Entity | null;
1852
+
1853
+ /**
1854
+ * Horizon week it runs in.
1855
+ */
1856
+ week_index: number;
1857
+ }
1858
+
1558
1859
  export interface ProductionScheduleDeleteResponse {}
1559
1860
 
1560
1861
  export interface ProductionScheduleListParams {
@@ -1693,6 +1994,9 @@ export declare namespace ProductionSchedules {
1693
1994
  type ListReleaseScheduleBatch as ListReleaseScheduleBatch,
1694
1995
  type ListReleasedScheduleLine as ListReleasedScheduleLine,
1695
1996
  type ListScheduleAppliedOverride as ListScheduleAppliedOverride,
1997
+ type ListScheduleAtRiskOrder as ListScheduleAtRiskOrder,
1998
+ type ListScheduleOrderCoverage as ListScheduleOrderCoverage,
1999
+ type ListScheduleOrderCoverageLine as ListScheduleOrderCoverageLine,
1696
2000
  type ProductionSchedule as ProductionSchedule,
1697
2001
  type ProductionScheduleDerivedLine as ProductionScheduleDerivedLine,
1698
2002
  type ProductionScheduleDeviation as ProductionScheduleDeviation,
@@ -1702,7 +2006,10 @@ export declare namespace ProductionSchedules {
1702
2006
  type ReleaseScheduleWeekPreview as ReleaseScheduleWeekPreview,
1703
2007
  type ReleasedScheduleLine as ReleasedScheduleLine,
1704
2008
  type ScheduleAppliedOverride as ScheduleAppliedOverride,
2009
+ type ScheduleAtRiskOrder as ScheduleAtRiskOrder,
1705
2010
  type ScheduleDiagnostics as ScheduleDiagnostics,
2011
+ type ScheduleOrderCoverage as ScheduleOrderCoverage,
2012
+ type ScheduleOrderCoverageLine as ScheduleOrderCoverageLine,
1706
2013
  type ProductionScheduleDeleteResponse as ProductionScheduleDeleteResponse,
1707
2014
  type ProductionScheduleListParams as ProductionScheduleListParams,
1708
2015
  type ProductionScheduleCreateParams as ProductionScheduleCreateParams,
@@ -1734,6 +2041,8 @@ export declare namespace ProductionSchedules {
1734
2041
  type PreviewRegenerateProductionScheduleRequest as PreviewRegenerateProductionScheduleRequest,
1735
2042
  type ProductionSchedulePreview as ProductionSchedulePreview,
1736
2043
  type ProductionScheduleRegeneratePreview as ProductionScheduleRegeneratePreview,
2044
+ type PromiseDateQuote as PromiseDateQuote,
2045
+ type QuotePromiseDateRequest as QuotePromiseDateRequest,
1737
2046
  type RegenerateProductionScheduleRequest as RegenerateProductionScheduleRequest,
1738
2047
  type ReleaseProductionScheduleWeekRequest as ReleaseProductionScheduleWeekRequest,
1739
2048
  type ReleaseScheduleWeekResult as ReleaseScheduleWeekResult,
@@ -1744,6 +2053,7 @@ export declare namespace ProductionSchedules {
1744
2053
  type ActionPreviewParams as ActionPreviewParams,
1745
2054
  type ActionPreviewRegenerateParams as ActionPreviewRegenerateParams,
1746
2055
  type ActionRegenerateParams as ActionRegenerateParams,
2056
+ type ActionQuotePromiseDateParams as ActionQuotePromiseDateParams,
1747
2057
  type ActionReleaseWeekParams as ActionReleaseWeekParams,
1748
2058
  };
1749
2059
  }
@@ -162,6 +162,12 @@ export interface AccountGroup {
162
162
  */
163
163
  created_at: string;
164
164
 
165
+ /**
166
+ * Calendar days between an order being issued and it being due to ship, inherited
167
+ * by every customer in this group that has not set its own.
168
+ */
169
+ default_lead_time_days: number | null;
170
+
165
171
  /**
166
172
  * Free-form description of the account group.
167
173
  */
@@ -242,6 +248,12 @@ export interface CreateAccountGroupRequest {
242
248
  */
243
249
  commission_policy?: 'commission_applied' | 'commission_exempt';
244
250
 
251
+ /**
252
+ * Calendar days between an order being issued and it being due to ship, inherited
253
+ * by every customer in this group that has not set its own.
254
+ */
255
+ default_lead_time_days?: number;
256
+
245
257
  /**
246
258
  * Free-form description of the account group.
247
259
  */
@@ -298,6 +310,13 @@ export interface UpdateAccountGroupRequest {
298
310
  */
299
311
  commission_policy?: 'commission_applied' | 'commission_exempt';
300
312
 
313
+ /**
314
+ * Calendar days between an order being issued and it being due to ship, inherited
315
+ * by every customer in this group that has not set its own. Clearing it returns
316
+ * the group's customers to the account default.
317
+ */
318
+ default_lead_time_days?: number | null;
319
+
301
320
  /**
302
321
  * Free-form description of the account group.
303
322
  */
@@ -383,6 +402,12 @@ export interface AccountGroupCreateParams {
383
402
  */
384
403
  commission_policy?: 'commission_applied' | 'commission_exempt';
385
404
 
405
+ /**
406
+ * Calendar days between an order being issued and it being due to ship, inherited
407
+ * by every customer in this group that has not set its own.
408
+ */
409
+ default_lead_time_days?: number;
410
+
386
411
  /**
387
412
  * Free-form description of the account group.
388
413
  */
@@ -409,6 +434,13 @@ export interface AccountGroupUpdateParams {
409
434
  */
410
435
  commission_policy?: 'commission_applied' | 'commission_exempt';
411
436
 
437
+ /**
438
+ * Calendar days between an order being issued and it being due to ship, inherited
439
+ * by every customer in this group that has not set its own. Clearing it returns
440
+ * the group's customers to the account default.
441
+ */
442
+ default_lead_time_days?: number | null;
443
+
412
444
  /**
413
445
  * Free-form description of the account group.
414
446
  */
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
+ import * as CoreAPI from '../../core/core';
4
5
  import * as BlocksAPI from '../../messaging/blocks';
5
6
  import * as AccountGroupsAPI from '../account-groups';
6
7
  import * as AddressesAPI from '../addresses';
@@ -178,6 +179,34 @@ export class Customers extends APIResource {
178
179
  delete(id: string, options?: RequestOptions): APIPromise<CustomerDeleteResponse> {
179
180
  return this._client.delete(path`/v1/sales/customers/${id}`, options);
180
181
  }
182
+
183
+ /**
184
+ * Returns the ship-by lead time a new order for this customer would be committed
185
+ * to.
186
+ *
187
+ * Resolved through the same chain the issue path stamps onto an order, most
188
+ * specific first: a lead time set on the customer, then on the customer's account
189
+ * group, then the account-wide default. `source` names which rule applied, so a
190
+ * form can show where the number came from rather than leaving a rep to guess.
191
+ *
192
+ * This is a preview of a commitment, not the commitment itself. An order takes its
193
+ * own `ship_by_date` when it is issued and keeps it afterwards, so changing a lead
194
+ * time here moves what future orders will promise and leaves promises already made
195
+ * alone.
196
+ *
197
+ * This endpoint requires the permission: `customers:read`.
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * const customerLeadTime =
202
+ * await client.sales.customers.retrieveLeadTime(
203
+ * 'ac_opnlh43ymyee',
204
+ * );
205
+ * ```
206
+ */
207
+ retrieveLeadTime(id: string, options?: RequestOptions): APIPromise<CustomerLeadTime> {
208
+ return this._client.get(path`/v1/sales/customers/${id}/lead-time`, options);
209
+ }
181
210
  }
182
211
 
183
212
  /**
@@ -387,6 +416,14 @@ export interface CreateCustomerRequest {
387
416
  */
388
417
  freight_policy?: 'free_freight' | 'billed_freight';
389
418
 
419
+ /**
420
+ * Calendar days between an order being issued and it being due to ship.
421
+ *
422
+ * Sets each order's `ship_by_date` when it is issued. Leave unset to inherit the
423
+ * customer's account group lead time, then the account default.
424
+ */
425
+ lead_time_days?: number;
426
+
390
427
  /**
391
428
  * Free-form note about the customer.
392
429
  */
@@ -611,6 +648,14 @@ export interface CustomerContactInfo {
611
648
  * not supply its own.
612
649
  */
613
650
  export interface CustomerDefaults {
651
+ /**
652
+ * Calendar days between an order being issued and it being due to ship.
653
+ *
654
+ * Sets each order's `ship_by_date` when it is issued. With none set here the
655
+ * customer inherits its account group's lead time, then the account default.
656
+ */
657
+ lead_time_days: number | null;
658
+
614
659
  /**
615
660
  * Resource type identifier.
616
661
  */
@@ -704,6 +749,46 @@ export interface CustomerFreightPreferences {
704
749
  status: 'free_freight' | 'billed_freight';
705
750
  }
706
751
 
752
+ /**
753
+ * The ship-by lead time a new order for this customer would be committed to.
754
+ */
755
+ export interface CustomerLeadTime {
756
+ /**
757
+ * Entity is a polymorphic reference to any resource in the system.
758
+ */
759
+ account_group: CoreAPI.Entity | null;
760
+
761
+ /**
762
+ * Entity is a polymorphic reference to any resource in the system.
763
+ */
764
+ customer: CoreAPI.Entity | null;
765
+
766
+ /**
767
+ * Calendar days between an order being issued and it being due to ship.
768
+ *
769
+ * `0` means same-day: an order issued today would be due to ship today.
770
+ */
771
+ days: number;
772
+
773
+ /**
774
+ * Resource type identifier.
775
+ */
776
+ object: 'customer_lead_time';
777
+
778
+ /**
779
+ * Which rule in the chain produced this lead time.
780
+ *
781
+ * - `customer`: a lead time set on the customer itself.
782
+ * - `account_group`: inherited from the customer's account group.
783
+ * - `account`: the account-wide fallback.
784
+ *
785
+ * The shared `manual` value cannot appear here: it means a promised date was set
786
+ * on one specific order, which is a fact about that order rather than about the
787
+ * customer.
788
+ */
789
+ source: 'customer' | 'account_group' | 'account' | 'manual';
790
+ }
791
+
707
792
  /**
708
793
  * Customer notification settings.
709
794
  */
@@ -1078,6 +1163,14 @@ export interface UpdateCustomerRequest {
1078
1163
  */
1079
1164
  freight_policy?: 'free_freight' | 'billed_freight';
1080
1165
 
1166
+ /**
1167
+ * Calendar days between an order being issued and it being due to ship.
1168
+ *
1169
+ * Sets each order's `ship_by_date` when it is issued. Leave unset to inherit the
1170
+ * customer's account group lead time, then the account default.
1171
+ */
1172
+ lead_time_days?: number | null;
1173
+
1081
1174
  /**
1082
1175
  * The customer's business name, as shown throughout the app and on documents.
1083
1176
  */
@@ -1450,6 +1543,15 @@ export interface CustomerCreateParams {
1450
1543
  */
1451
1544
  freight_policy?: 'free_freight' | 'billed_freight';
1452
1545
 
1546
+ /**
1547
+ * Body param: Calendar days between an order being issued and it being due to
1548
+ * ship.
1549
+ *
1550
+ * Sets each order's `ship_by_date` when it is issued. Leave unset to inherit the
1551
+ * customer's account group lead time, then the account default.
1552
+ */
1553
+ lead_time_days?: number;
1554
+
1453
1555
  /**
1454
1556
  * Body param: Free-form note about the customer.
1455
1557
  */
@@ -1625,6 +1727,15 @@ export interface CustomerUpdateParams {
1625
1727
  */
1626
1728
  freight_policy?: 'free_freight' | 'billed_freight';
1627
1729
 
1730
+ /**
1731
+ * Body param: Calendar days between an order being issued and it being due to
1732
+ * ship.
1733
+ *
1734
+ * Sets each order's `ship_by_date` when it is issued. Leave unset to inherit the
1735
+ * customer's account group lead time, then the account default.
1736
+ */
1737
+ lead_time_days?: number | null;
1738
+
1628
1739
  /**
1629
1740
  * Body param: The customer's business name, as shown throughout the app and on
1630
1741
  * documents.
@@ -1683,6 +1794,7 @@ export declare namespace Customers {
1683
1794
  type CustomerContactInfo as CustomerContactInfo,
1684
1795
  type CustomerDefaults as CustomerDefaults,
1685
1796
  type CustomerFreightPreferences as CustomerFreightPreferences,
1797
+ type CustomerLeadTime as CustomerLeadTime,
1686
1798
  type CustomerNotificationPreferences as CustomerNotificationPreferences,
1687
1799
  type ListCustomer as ListCustomer,
1688
1800
  type ListServiceLevel as ListServiceLevel,
@@ -9,6 +9,7 @@ export {
9
9
  type CustomerContactInfo,
10
10
  type CustomerDefaults,
11
11
  type CustomerFreightPreferences,
12
+ type CustomerLeadTime,
12
13
  type CustomerNotificationPreferences,
13
14
  type ListCustomer,
14
15
  type ListServiceLevel,
@@ -38,6 +38,7 @@ export {
38
38
  type CustomerContactInfo,
39
39
  type CustomerDefaults,
40
40
  type CustomerFreightPreferences,
41
+ type CustomerLeadTime,
41
42
  type CustomerNotificationPreferences,
42
43
  type ListCustomer,
43
44
  type ListServiceLevel,