@burdenoff/microfe-movethewheels 2026.1016.1 → 2026.1016.3

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 (200) hide show
  1. package/dist/components/freight-cost/FreightCommercialEditor.js +217 -0
  2. package/dist/components/freight-cost/FreightCommercialFactEditor.js +217 -0
  3. package/dist/components/freight-cost/FreightCommercialHistory.js +115 -0
  4. package/dist/components/freight-cost/FreightDraftForm.js +106 -91
  5. package/dist/components/freight-cost/FreightHistory.js +42 -40
  6. package/dist/dev/main.d.ts +0 -1
  7. package/dist/generated/freight-cost-operations.d.ts +959 -0
  8. package/dist/hooks/useFreightRecoveryAction.js +20 -20
  9. package/dist/index.d.ts +2 -4
  10. package/dist/movethewheels/MoveTheWheelsRoot.d.ts +0 -1
  11. package/dist/movethewheels/MoveTheWheelsRoutes.d.ts +1 -1
  12. package/dist/movethewheels/components/AssignmentSuggestions.d.ts +1 -2
  13. package/dist/movethewheels/components/CarbonFootprintPanel.d.ts +1 -1
  14. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +1 -2
  15. package/dist/movethewheels/components/CustomerPicker.d.ts +1 -2
  16. package/dist/movethewheels/components/DataTable.d.ts +1 -2
  17. package/dist/movethewheels/components/DocumentsCard.d.ts +1 -2
  18. package/dist/movethewheels/components/EntityCombobox.d.ts +1 -1
  19. package/dist/movethewheels/components/FleetAlertsPanel.d.ts +1 -2
  20. package/dist/movethewheels/components/FormError.d.ts +1 -1
  21. package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +1 -2
  22. package/dist/movethewheels/components/GlassPanel.d.ts +1 -2
  23. package/dist/movethewheels/components/MetricCard.d.ts +3 -4
  24. package/dist/movethewheels/components/Notice.d.ts +1 -1
  25. package/dist/movethewheels/components/OrderItemRow.d.ts +1 -2
  26. package/dist/movethewheels/components/PageLayout.d.ts +5 -6
  27. package/dist/movethewheels/components/ProofOfDeliveryCard.d.ts +1 -1
  28. package/dist/movethewheels/components/ReturnInstructionForm.d.ts +1 -2
  29. package/dist/movethewheels/components/ReuseControls.d.ts +4 -5
  30. package/dist/movethewheels/components/ReusePermissionForm.d.ts +1 -2
  31. package/dist/movethewheels/components/ReuseProposalForm.d.ts +1 -2
  32. package/dist/movethewheels/components/ReuseSourceFields.d.ts +1 -2
  33. package/dist/movethewheels/components/ShippingQuoteResults.d.ts +1 -2
  34. package/dist/movethewheels/components/StatusBadge.d.ts +5 -6
  35. package/dist/movethewheels/components/StockActionDialogs.d.ts +3 -3
  36. package/dist/movethewheels/components/UpcomingDemandPanel.d.ts +1 -2
  37. package/dist/movethewheels/components/VehicleServiceCard.d.ts +1 -2
  38. package/dist/movethewheels/components/charts/ChartShell.d.ts +2 -3
  39. package/dist/movethewheels/components/charts/Sparkline.d.ts +1 -1
  40. package/dist/movethewheels/components/charts/StatusDonut.d.ts +1 -1
  41. package/dist/movethewheels/components/charts/TrendChart.d.ts +1 -1
  42. package/dist/movethewheels/components/charts/VolumeBar.d.ts +1 -1
  43. package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +3 -4
  44. package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +1 -2
  45. package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +1 -2
  46. package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +1 -2
  47. package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +1 -2
  48. package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +1 -2
  49. package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +1 -2
  50. package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +1 -2
  51. package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +1 -2
  52. package/dist/movethewheels/components/freight-cost/FreightCommercialEditor.d.ts +8 -0
  53. package/dist/movethewheels/components/freight-cost/FreightCommercialFactEditor.d.ts +8 -0
  54. package/dist/movethewheels/components/freight-cost/FreightCommercialHistory.d.ts +4 -0
  55. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +5 -4
  56. package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +3 -4
  57. package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +1 -2
  58. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +3 -4
  59. package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +1 -2
  60. package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +1 -2
  61. package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +1 -2
  62. package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +2 -3
  63. package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +3 -4
  64. package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +1 -2
  65. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +1 -2
  66. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +1 -2
  67. package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +1 -2
  68. package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +1 -2
  69. package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +1 -2
  70. package/dist/movethewheels/components/maps/LogisticsMap.d.ts +1 -2
  71. package/dist/movethewheels/components/maps/MapCanvas.d.ts +1 -2
  72. package/dist/movethewheels/components/maps/RouteMap.d.ts +1 -1
  73. package/dist/movethewheels/components/maps/TrackingMap.d.ts +1 -1
  74. package/dist/movethewheels/components/maps/leaflet-setup.d.ts +0 -1
  75. package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +1 -2
  76. package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +1 -1
  77. package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +1 -2
  78. package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +1 -2
  79. package/dist/movethewheels/components/pending-pick/PickReviewPanel.d.ts +1 -2
  80. package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +1 -2
  81. package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +1 -2
  82. package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +1 -2
  83. package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +1 -2
  84. package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +1 -2
  85. package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +1 -2
  86. package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +1 -1
  87. package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +1 -2
  88. package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +1 -2
  89. package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +1 -2
  90. package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +1 -2
  91. package/dist/movethewheels/hooks/useAnalytics.d.ts +0 -1
  92. package/dist/movethewheels/hooks/useConsolidationAction.d.ts +0 -1
  93. package/dist/movethewheels/hooks/useContainerCondition.d.ts +0 -1
  94. package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +0 -1
  95. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  96. package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +0 -1
  97. package/dist/movethewheels/hooks/useEpod.d.ts +0 -1
  98. package/dist/movethewheels/hooks/useFleet.d.ts +0 -1
  99. package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +0 -1
  100. package/dist/movethewheels/hooks/useInventory.d.ts +0 -1
  101. package/dist/movethewheels/hooks/useOrders.d.ts +0 -1
  102. package/dist/movethewheels/hooks/useProcedureAction.d.ts +0 -1
  103. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +0 -1
  104. package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +0 -1
  105. package/dist/movethewheels/hooks/useRoutes.d.ts +0 -1
  106. package/dist/movethewheels/hooks/useShipmentStatusAuthority.d.ts +0 -1
  107. package/dist/movethewheels/hooks/useTracking.d.ts +0 -1
  108. package/dist/movethewheels/hooks/useTrackingEventQuality.d.ts +0 -1
  109. package/dist/movethewheels/pages/AIAssistantPage.d.ts +1 -1
  110. package/dist/movethewheels/pages/AnalyticsPage.d.ts +1 -1
  111. package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -1
  112. package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -1
  113. package/dist/movethewheels/pages/ContainersPage.d.ts +1 -1
  114. package/dist/movethewheels/pages/CreateOrderPage.d.ts +1 -1
  115. package/dist/movethewheels/pages/CustomerDetailsPage.d.ts +1 -1
  116. package/dist/movethewheels/pages/CustomersPage.d.ts +1 -1
  117. package/dist/movethewheels/pages/DashboardPage.d.ts +1 -1
  118. package/dist/movethewheels/pages/DeliveryCapturePage.d.ts +1 -1
  119. package/dist/movethewheels/pages/DriverDetailsPage.d.ts +1 -1
  120. package/dist/movethewheels/pages/DriversPage.d.ts +1 -1
  121. package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -1
  122. package/dist/movethewheels/pages/FinancePage.d.ts +1 -1
  123. package/dist/movethewheels/pages/FleetPage.d.ts +1 -1
  124. package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -1
  125. package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -1
  126. package/dist/movethewheels/pages/ImportExportPage.d.ts +1 -1
  127. package/dist/movethewheels/pages/InventoryPage.d.ts +1 -1
  128. package/dist/movethewheels/pages/LiveTrackingPage.d.ts +1 -1
  129. package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -1
  130. package/dist/movethewheels/pages/MarketplacePage.d.ts +1 -1
  131. package/dist/movethewheels/pages/MultiModalShipmentPage.d.ts +1 -1
  132. package/dist/movethewheels/pages/OrderDetailsPage.d.ts +1 -1
  133. package/dist/movethewheels/pages/OrdersListPage.d.ts +1 -1
  134. package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -1
  135. package/dist/movethewheels/pages/ProductDetailsPage.d.ts +1 -1
  136. package/dist/movethewheels/pages/ProductsPage.d.ts +1 -1
  137. package/dist/movethewheels/pages/ReportsPage.d.ts +1 -1
  138. package/dist/movethewheels/pages/RouteDetailsPage.d.ts +1 -1
  139. package/dist/movethewheels/pages/RoutesPage.d.ts +1 -1
  140. package/dist/movethewheels/pages/SettingsPage.d.ts +1 -1
  141. package/dist/movethewheels/pages/ShipmentStatusAuthorityPage.d.ts +1 -1
  142. package/dist/movethewheels/pages/ShippingRatesPage.d.ts +1 -1
  143. package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -1
  144. package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -1
  145. package/dist/movethewheels/pages/TrackingEventQualityPage.d.ts +1 -1
  146. package/dist/movethewheels/pages/TrackingPage.d.ts +1 -1
  147. package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -1
  148. package/dist/movethewheels/pages/VehicleDetailsPage.d.ts +1 -1
  149. package/dist/movethewheels/pages/VehiclesPage.d.ts +1 -1
  150. package/dist/movethewheels/pages/WarehouseDetailsPage.d.ts +1 -1
  151. package/dist/movethewheels/pages/WarehousesPage.d.ts +1 -1
  152. package/dist/movethewheels/providers/MoveTheWheelsProvider.d.ts +0 -1
  153. package/dist/movethewheels/store/movethewheelsStore.d.ts +0 -1
  154. package/dist/movethewheels/types/index.d.ts +0 -1
  155. package/dist/movethewheels/utils/cn.d.ts +0 -1
  156. package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +0 -1
  157. package/dist/movethewheels/utils/consolidationInput.d.ts +0 -1
  158. package/dist/movethewheels/utils/consolidationLot.d.ts +0 -1
  159. package/dist/movethewheels/utils/consolidationPins.d.ts +0 -1
  160. package/dist/movethewheels/utils/consolidationRecovery.d.ts +0 -1
  161. package/dist/movethewheels/utils/consolidationReportHead.d.ts +0 -1
  162. package/dist/movethewheels/utils/formatters.d.ts +0 -1
  163. package/dist/movethewheels/utils/freightCommercial.d.ts +44 -0
  164. package/dist/movethewheels/utils/freightDraft.d.ts +0 -1
  165. package/dist/movethewheels/utils/freightRecovery.d.ts +0 -1
  166. package/dist/movethewheels/utils/mapMarkers.d.ts +0 -1
  167. package/dist/movethewheels/utils/orderValidation.d.ts +0 -1
  168. package/dist/movethewheels/utils/pendingPickDraft.d.ts +0 -1
  169. package/dist/movethewheels/utils/pickReviewAcknowledgement.d.ts +0 -1
  170. package/dist/movethewheels/utils/procedureInput.d.ts +0 -1
  171. package/dist/movethewheels/utils/procedureRecovery.d.ts +0 -1
  172. package/dist/movethewheels/utils/reuseForm.d.ts +0 -1
  173. package/dist/movethewheels/utils/reuseRecovery.d.ts +0 -1
  174. package/dist/movethewheels/utils/stockBindingForm.d.ts +0 -1
  175. package/dist/movethewheels/utils/stockObservationForm.d.ts +0 -1
  176. package/dist/movethewheels/utils/tripDraftContext.d.ts +0 -1
  177. package/dist/movethewheels/utils/tripUtilizationForm.d.ts +0 -1
  178. package/dist/pages/FreightEstimatePage.js +96 -92
  179. package/dist/services/createSandboxAssistantTransport.d.ts +2 -1
  180. package/dist/src/generated/freight-cost-operations.js +495 -6
  181. package/dist/stories/EntityCombobox.stories.d.ts +1 -2
  182. package/dist/stories/MetricCard.stories.d.ts +0 -1
  183. package/dist/stories/Notice.stories.d.ts +0 -1
  184. package/dist/stories/StatusBadge.stories.d.ts +0 -1
  185. package/dist/utils/freightAcknowledgement.js +6 -5
  186. package/dist/utils/freightCommercial.js +194 -0
  187. package/dist/utils/freightRecovery.js +22 -22
  188. package/package.json +6 -5
  189. package/src/generated/freight-cost-operations.ts +831 -1
  190. package/src/movethewheels/components/freight-cost/FreightCommercialEditor.tsx +236 -0
  191. package/src/movethewheels/components/freight-cost/FreightCommercialFactEditor.tsx +258 -0
  192. package/src/movethewheels/components/freight-cost/FreightCommercialHistory.tsx +90 -0
  193. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +33 -4
  194. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +4 -2
  195. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +2 -1
  196. package/src/movethewheels/pages/FreightEstimatePage.tsx +14 -7
  197. package/src/movethewheels/utils/freightAcknowledgement.ts +3 -1
  198. package/src/movethewheels/utils/freightCommercial.ts +388 -0
  199. package/src/movethewheels/utils/freightRecovery.ts +6 -2
  200. package/src/operations/freight-cost/commercial.graphql +483 -0
@@ -0,0 +1,194 @@
1
+ //#region src/movethewheels/utils/freightCommercial.ts
2
+ var e = [
3
+ "origin",
4
+ "destination",
5
+ "carrier",
6
+ "service",
7
+ "cargo",
8
+ "weight",
9
+ "volume",
10
+ "equipment"
11
+ ], t = "Not recorded for this cost version";
12
+ function n() {
13
+ return {
14
+ facts: i(),
15
+ selectedLegs: [],
16
+ reviewed: null
17
+ };
18
+ }
19
+ function r(e = "UNKNOWN") {
20
+ return {
21
+ status: e,
22
+ reason: e === "UNKNOWN" ? t : "",
23
+ label: "",
24
+ reference: "",
25
+ description: "",
26
+ kind: "",
27
+ jurisdiction: "",
28
+ amount: "",
29
+ unit: "",
30
+ zeroReason: "",
31
+ count: "",
32
+ sourceReference: "",
33
+ sourceRevision: "",
34
+ observedAt: "",
35
+ evidenceLinks: []
36
+ };
37
+ }
38
+ function i() {
39
+ return {
40
+ origin: r(),
41
+ destination: r(),
42
+ carrier: r(),
43
+ service: r(),
44
+ cargo: r(),
45
+ weight: r(),
46
+ volume: r(),
47
+ equipment: r()
48
+ };
49
+ }
50
+ function a(e, t, n) {
51
+ let r = e.trim();
52
+ if (!r || r.length > t) throw Error(`${n}: enter 1–${t} characters.`);
53
+ return r;
54
+ }
55
+ function o(e) {
56
+ if (!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(e) || new Date(e).toISOString() !== e || Date.parse(e) > Date.now()) throw Error("Use a valid observed time no later than now.");
57
+ return e;
58
+ }
59
+ function s(e, t) {
60
+ if (!/^(0|[1-9][0-9]{0,17})(\.[0-9]{0,5}[1-9])?$/.test(e)) throw Error("Use a canonical nonnegative decimal: up to 18 integer and 6 fractional digits, no exponent or trailing fractional zero.");
61
+ if (e === "0") return a(t, 255, "Recorded zero reason");
62
+ if (t.trim()) throw Error("A zero reason belongs only to an amount of zero.");
63
+ return null;
64
+ }
65
+ function c(e, t) {
66
+ let n = e.evidenceLinks;
67
+ if (n.length < 1 || n.length > 2 || new Set(n.map((e) => JSON.stringify([e.fileId, e.versionId]))).size !== n.length || n.some((e) => !t.some((t) => t.fileId === e.fileId && t.versionId === e.versionId))) throw Error("Choose 1–2 distinct exact evidence versions already selected for this cost record.");
68
+ return {
69
+ sourceReference: a(e.sourceReference, 255, "Fact source"),
70
+ sourceRevision: a(e.sourceRevision, 255, "Fact source revision"),
71
+ observedAt: e.observedAt ? o(e.observedAt) : null,
72
+ evidenceLinks: [...n].sort((e, t) => JSON.stringify([e.fileId, e.versionId]) < JSON.stringify([t.fileId, t.versionId]) ? -1 : +(JSON.stringify([e.fileId, e.versionId]) > JSON.stringify([t.fileId, t.versionId]))).map((e) => ({ ...e }))
73
+ };
74
+ }
75
+ function l(e, t, n) {
76
+ let r = (t) => {
77
+ let r = e[t];
78
+ if (r.status === "UNKNOWN") return {
79
+ status: r.status,
80
+ value: null,
81
+ reason: a(r.reason, 255, t),
82
+ provenance: null
83
+ };
84
+ if (r.status !== "SOURCED" && r.status !== "NOT_APPLICABLE") throw Error("Choose a supported commercial fact status.");
85
+ return {
86
+ status: r.status,
87
+ value: null,
88
+ reason: r.status === "NOT_APPLICABLE" ? a(r.reason, 255, t) : null,
89
+ provenance: c(r, n)
90
+ };
91
+ }, i = (t) => {
92
+ let n = r(t), i = e[t];
93
+ if (n.status !== "SOURCED") return n;
94
+ if (i.kind !== "ADDRESS_LABEL" && i.kind !== "PORT_LABEL" && i.kind !== "TERMINAL_LABEL" && i.kind !== "POSTCODE_LABEL" && i.kind !== "CUSTOM_LABEL") throw Error("Choose a location label kind.");
95
+ return {
96
+ ...n,
97
+ value: {
98
+ kind: i.kind,
99
+ label: a(i.label, 255, t),
100
+ jurisdictionLabel: i.jurisdiction.trim() ? a(i.jurisdiction, 120, "Jurisdiction label") : null
101
+ }
102
+ };
103
+ }, o = r("weight"), l = r("volume"), u = r("carrier"), d = r("service"), f = r("cargo"), p = r("equipment"), m = e.weight, h = e.volume;
104
+ if (m.status === "SOURCED" && m.unit !== "KG" && m.unit !== "TONNE" && m.unit !== "LB") throw Error("Choose a recorded weight unit.");
105
+ if (h.status === "SOURCED" && h.unit !== "M3" && h.unit !== "FT3") throw Error("Choose a recorded volume unit.");
106
+ if (e.equipment.status === "SOURCED" && (!/^[1-9][0-9]{0,5}$/.test(e.equipment.count) || Number(e.equipment.count) > 1e5)) throw Error("Equipment count must be an integer from 1 to 100000.");
107
+ if (t.length > 16 || new Set(t.map((e) => e.id)).size !== t.length) throw Error("Select at most 16 distinct reviewed legs.");
108
+ let g = {
109
+ schemaVersion: 1,
110
+ selectedLegs: t.map((e) => ({
111
+ id: a(e.id, 200, "Leg ID"),
112
+ expectedUpdatedAt: e.expectedUpdatedAt
113
+ })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)),
114
+ origin: i("origin"),
115
+ destination: i("destination"),
116
+ carrier: u.status === "SOURCED" ? {
117
+ ...u,
118
+ value: {
119
+ reference: a(e.carrier.reference, 120, "Carrier reference"),
120
+ label: a(e.carrier.label, 255, "Carrier label")
121
+ }
122
+ } : u,
123
+ service: d.status === "SOURCED" ? {
124
+ ...d,
125
+ value: a(e.service.label, 120, "Service")
126
+ } : d,
127
+ cargo: f.status === "SOURCED" ? {
128
+ ...f,
129
+ value: {
130
+ classificationLabel: a(e.cargo.label, 120, "Cargo classification"),
131
+ description: a(e.cargo.description, 500, "Cargo description")
132
+ }
133
+ } : f,
134
+ weight: o.status === "SOURCED" ? {
135
+ ...o,
136
+ value: {
137
+ amount: m.amount,
138
+ unit: m.unit === "KG" ? "KG" : m.unit === "TONNE" ? "TONNE" : "LB",
139
+ zeroReason: s(m.amount, m.zeroReason)
140
+ }
141
+ } : o,
142
+ volume: l.status === "SOURCED" ? {
143
+ ...l,
144
+ value: {
145
+ amount: h.amount,
146
+ unit: h.unit === "M3" ? "M3" : "FT3",
147
+ zeroReason: s(h.amount, h.zeroReason)
148
+ }
149
+ } : l,
150
+ equipment: p.status === "SOURCED" ? {
151
+ ...p,
152
+ value: {
153
+ typeLabel: a(e.equipment.label, 120, "Equipment type"),
154
+ count: Number(e.equipment.count)
155
+ }
156
+ } : p
157
+ };
158
+ if (new TextEncoder().encode(JSON.stringify(g)).byteLength > 32768) throw Error("Commercial capture exceeds 32768 bytes. Shorten facts before saving.");
159
+ return g;
160
+ }
161
+ function u(e) {
162
+ function t(e) {
163
+ return Array.isArray(e) ? e.map(t) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== "__typename").sort(([e], [t]) => e.localeCompare(t)).map(([e, n]) => [e, t(n)])) : e;
164
+ }
165
+ return JSON.stringify(t(e));
166
+ }
167
+ function d(e, t) {
168
+ if (!e || typeof e != "object" || !("commercialCapture" in e) || !e.commercialCapture || typeof e.commercialCapture != "object") return !1;
169
+ let n = e.commercialCapture;
170
+ if (!t.commercialCapture || typeof t.commercialCapture != "object" || !("selectedLegs" in t.commercialCapture) || !Array.isArray(t.commercialCapture.selectedLegs) || !("ownerShipment" in n) || !n.ownerShipment || typeof n.ownerShipment != "object" || !("shipmentId" in n.ownerShipment) || n.ownerShipment.shipmentId !== t.shipmentId || !("updatedAt" in n.ownerShipment) || n.ownerShipment.updatedAt !== t.expectedShipmentUpdatedAt || !("primaryMode" in n.ownerShipment) || typeof n.ownerShipment.primaryMode != "string" || ![
171
+ "AIR",
172
+ "OCEAN",
173
+ "RAIL",
174
+ "ROAD"
175
+ ].includes(n.ownerShipment.primaryMode) || !("ownerLegs" in n) || !Array.isArray(n.ownerLegs) || u(Object.fromEntries(Object.entries(n).filter(([e]) => e !== "ownerShipment" && e !== "ownerLegs"))) !== u(t.commercialCapture)) return !1;
176
+ let r = t.commercialCapture.selectedLegs, i = n.ownerLegs;
177
+ return i.length === r.length && r.every((e) => e && typeof e == "object" && "id" in e && "expectedUpdatedAt" in e && i.some((t) => t && typeof t == "object" && "id" in t && t.id === e.id && "updatedAt" in t && t.updatedAt === e.expectedUpdatedAt && "legNumber" in t && typeof t.legNumber == "number" && Number.isInteger(t.legNumber) && t.legNumber > 0 && "mode" in t && typeof t.mode == "string" && [
178
+ "AIR",
179
+ "OCEAN",
180
+ "RAIL",
181
+ "ROAD"
182
+ ].includes(t.mode) && ["carrierId", "carrierName"].every((e) => e in t && (Reflect.get(t, e) === null || typeof Reflect.get(t, e) == "string")) && [
183
+ "weightKg",
184
+ "volumeCbm",
185
+ "containerCount"
186
+ ].every((e) => e in t && (Reflect.get(t, e) === null || typeof Reflect.get(t, e) == "number" && Number.isFinite(Reflect.get(t, e)))) && "containerType" in t && (t.containerType === null || typeof t.containerType == "string" && [
187
+ "FCL_20FT",
188
+ "FCL_40FT",
189
+ "FCL_40FT_HC",
190
+ "LCL"
191
+ ].includes(t.containerType))));
192
+ }
193
+ //#endregion
194
+ export { u as commercialCanonical, l as commercialCaptureInput, e as commercialSlots, d as matchesCommercialCapture, n as newCommercialEditor, r as newCommercialFact };
@@ -1,36 +1,36 @@
1
- import { SaveFreightCostsDocument as e } from "../src/generated/freight-cost-operations.js";
2
- import { print as t } from "graphql";
1
+ import { SaveFreightCommercialCostsDocument as e, SaveFreightCostsDocument as t } from "../src/generated/freight-cost-operations.js";
2
+ import { print as n } from "graphql";
3
3
  //#region src/movethewheels/utils/freightRecovery.ts
4
- var n = "movethewheels.freight.unresolved.v1";
5
- function r(n) {
6
- if (!n || new TextEncoder().encode(n).byteLength > 2e5) return null;
4
+ var r = "movethewheels.freight.unresolved.v1";
5
+ function i(r) {
6
+ if (!r || new TextEncoder().encode(r).byteLength > 2e5) return null;
7
7
  try {
8
- let r = JSON.parse(n);
9
- if (typeof r != "object" || !r || !("version" in r) || r.version !== 1 || !("scope" in r) || !("input" in r) || !("operation" in r) || r.operation !== t(e) || !("key" in r) || typeof r.key != "string" || !r.key || r.key.length > 200 || !("success" in r) || typeof r.success != "string" || r.success.length > 500 || typeof r.input != "object" || r.input === null || Array.isArray(r.input) || typeof r.scope != "object" || r.scope === null) return null;
10
- let i = r.scope;
11
- return !("actorId" in i) || typeof i.actorId != "string" || !i.actorId || !("workspaceId" in i) || typeof i.workspaceId != "string" || !i.workspaceId || !("tenantId" in i) || typeof i.tenantId != "string" || !("organizationId" in i) || typeof i.organizationId != "string" || !i.organizationId || !("gateway" in i) || typeof i.gateway != "string" || !("projectId" in i) || i.projectId !== null && typeof i.projectId != "string" ? null : {
8
+ let i = JSON.parse(r);
9
+ if (typeof i != "object" || !i || !("version" in i) || i.version !== 1 || !("scope" in i) || !("input" in i) || !("operation" in i) || i.operation !== n(t) && i.operation !== n(e) || !("key" in i) || typeof i.key != "string" || !i.key || i.key.length > 200 || !("success" in i) || typeof i.success != "string" || i.success.length > 500 || typeof i.input != "object" || i.input === null || Array.isArray(i.input) || typeof i.scope != "object" || i.scope === null) return null;
10
+ let a = i.scope;
11
+ return !("actorId" in a) || typeof a.actorId != "string" || !a.actorId || !("workspaceId" in a) || typeof a.workspaceId != "string" || !a.workspaceId || !("tenantId" in a) || typeof a.tenantId != "string" || !("organizationId" in a) || typeof a.organizationId != "string" || !a.organizationId || !("gateway" in a) || typeof a.gateway != "string" || !("projectId" in a) || a.projectId !== null && typeof a.projectId != "string" ? null : {
12
12
  version: 1,
13
13
  scope: {
14
- actorId: i.actorId,
15
- workspaceId: i.workspaceId,
16
- tenantId: i.tenantId,
17
- organizationId: i.organizationId,
18
- gateway: i.gateway,
19
- projectId: i.projectId
14
+ actorId: a.actorId,
15
+ workspaceId: a.workspaceId,
16
+ tenantId: a.tenantId,
17
+ organizationId: a.organizationId,
18
+ gateway: a.gateway,
19
+ projectId: a.projectId
20
20
  },
21
- operation: r.operation,
22
- input: structuredClone(r.input),
23
- key: r.key,
24
- success: r.success
21
+ operation: i.operation,
22
+ input: structuredClone(i.input),
23
+ key: i.key,
24
+ success: i.success
25
25
  };
26
26
  } catch {
27
27
  return null;
28
28
  }
29
29
  }
30
- function i(e) {
30
+ function a(e) {
31
31
  let t = JSON.stringify(e);
32
- if (!r(t)) throw Error("Cannot safely retain this freight request. Nothing was sent.");
32
+ if (!i(t)) throw Error("Cannot safely retain this freight request. Nothing was sent.");
33
33
  return t;
34
34
  }
35
35
  //#endregion
36
- export { n as FREIGHT_RECOVERY_STORAGE, r as decodeFreightRecovery, i as encodeFreightRecovery };
36
+ export { r as FREIGHT_RECOVERY_STORAGE, i as decodeFreightRecovery, a as encodeFreightRecovery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.1016.1",
3
+ "version": "2026.1016.3",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
37
37
  "type:check": "bash scripts/build-limits.sh tsc --noEmit",
38
38
  "validate:schema-drift": "graphql-schema-drift",
39
- "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:braces-depth && bun run build && bun run build-storybook'",
39
+ "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:freight-commercial && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:braces-depth && bun run build && bun run build-storybook'",
40
40
  "storybook": "storybook dev -p 6006",
41
41
  "build-storybook": "storybook build",
42
42
  "test:storybook": "test-storybook",
@@ -66,7 +66,8 @@
66
66
  "verify:tracking-quality-outcomes": "bun test scripts/verify-tracking-quality-outcomes.test.ts",
67
67
  "verify:braces-depth": "bun test scripts/braces-depth-patch.test.ts",
68
68
  "verify:shipment-status-authority": "bun scripts/verify-shipment-status-command.mjs",
69
- "verify:free-time-permissions": "bun scripts/verify-free-time-permission-gates.mjs"
69
+ "verify:free-time-permissions": "bun scripts/verify-free-time-permission-gates.mjs",
70
+ "verify:freight-commercial": "bun scripts/verify-freight-commercial.mjs && bun scripts/verify-freight-commercial-recovery.mjs && bun scripts/verify-freight-commercial-mounted.mjs"
70
71
  },
71
72
  "dependencies": {
72
73
  "@apollo/client": "^4.0.11",
@@ -107,6 +108,7 @@
107
108
  "@types/react-dom": "^19.0.2",
108
109
  "@vitejs/plugin-react": "^4.3.4",
109
110
  "autoprefixer": "^10.4.20",
111
+ "braces": "3.0.3",
110
112
  "eslint": "^9.18.0",
111
113
  "eslint-plugin-react": "^7.37.5",
112
114
  "eslint-plugin-react-hooks": "^7.0.1",
@@ -121,8 +123,7 @@
121
123
  "typescript": "^5.9.0",
122
124
  "typescript-eslint": "^8.54.0",
123
125
  "vite": "8.0.16",
124
- "vite-plugin-dts": "3.9.1",
125
- "braces": "3.0.3"
126
+ "vite-plugin-dts": "5.1.2"
126
127
  },
127
128
  "peerDependencies": {
128
129
  "@apollo/client": "^4.0.11",