@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
@@ -1,96 +1,105 @@
1
1
  import { Button as e } from "../ui.js";
2
2
  import { ContainerEvidencePicker as t } from "../ContainerEvidencePicker.js";
3
- import { FreightCurrency as n, FreightSelect as r, FreightText as i } from "./FreightFields.js";
4
- import { freightInstant as a, freightLocalTime as o, newFreightFacts as s, newFreightLine as c } from "../../utils/freightDraft.js";
5
- import { FreightLineEditor as l } from "./FreightLineEditor.js";
6
- import { FreightScopeEditor as u } from "./FreightScopeEditor.js";
7
- import { FreightFxEditor as d } from "./FreightFxEditor.js";
8
- import { FreightTotals as f } from "./FreightTotals.js";
9
- import { useRef as p, useState as m } from "react";
10
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
3
+ import { commercialCanonical as n, commercialCaptureInput as r } from "../../utils/freightCommercial.js";
4
+ import { FreightCurrency as i, FreightSelect as a, FreightText as o } from "./FreightFields.js";
5
+ import { freightInstant as s, freightLocalTime as c, newFreightFacts as l, newFreightLine as u } from "../../utils/freightDraft.js";
6
+ import { FreightCommercialEditor as d } from "./FreightCommercialEditor.js";
7
+ import { FreightLineEditor as f } from "./FreightLineEditor.js";
8
+ import { FreightScopeEditor as p } from "./FreightScopeEditor.js";
9
+ import { FreightFxEditor as m } from "./FreightFxEditor.js";
10
+ import { FreightTotals as h } from "./FreightTotals.js";
11
+ import { useRef as g, useState as _ } from "react";
12
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
11
13
  //#region src/movethewheels/components/freight-cost/FreightDraftForm.tsx
12
- function _({ disabled: _, onPreview: v, onSave: y }) {
13
- let [b, x] = m(s), [S, C] = m([]), [w, T] = m(null), [E, D] = m(null), [O, k] = m(!1), A = p(!1), j = JSON.stringify(b), M = w?.body === j ? w.value : null, N = (e) => x({
14
- ...b,
14
+ function b({ disabled: b, shipmentId: x, onPreview: S, onSave: C }) {
15
+ let [w, T] = _(null), [E, D] = _(l), [O, k] = _([]), [A, j] = _(null), [M, N] = _(null), [P, F] = _(!1), I = g(!1), L = JSON.stringify(E), R = A?.body === L ? A.value : null, z = (e) => D({
16
+ ...E,
15
17
  ...e
16
- }), P = async () => {
17
- if (A.current) return;
18
- A.current = !0, k(!0), D(null);
19
- let e = structuredClone(b);
18
+ }), B = async () => {
19
+ if (I.current) return;
20
+ I.current = !0, F(!0), N(null);
21
+ let e = structuredClone(E);
20
22
  try {
21
- let t = await v(e);
22
- T({
23
+ let t = await S(e);
24
+ j({
23
25
  body: JSON.stringify(e),
24
26
  value: t
25
27
  });
26
28
  } catch (e) {
27
- D(e instanceof Error ? e.message : "Unable to preview these costs.");
29
+ N(e instanceof Error ? e.message : "Unable to preview these costs.");
28
30
  } finally {
29
- A.current = !1, k(!1);
31
+ I.current = !1, F(!1);
30
32
  }
31
33
  };
32
- return /* @__PURE__ */ g("form", {
34
+ return /* @__PURE__ */ y("form", {
33
35
  className: "space-y-6",
34
36
  onSubmit: (e) => {
35
- if (e.preventDefault(), !M) {
36
- P();
37
+ if (e.preventDefault(), !R) {
38
+ B();
37
39
  return;
38
40
  }
39
- D(null), y(structuredClone(b), structuredClone(S)).catch((e) => D(e instanceof Error ? e.message : "Unable to save this cost record."));
41
+ N(null);
42
+ try {
43
+ if (w && w.reviewed !== n(w.selectedLegs)) throw Error("Explicitly review the commercial leg selection before saving.");
44
+ let e = w ? r(w.facts, w.selectedLegs, O) : void 0;
45
+ C(structuredClone(E), structuredClone(O), e).catch((e) => N(e instanceof Error ? e.message : "Unable to save this cost record."));
46
+ } catch (e) {
47
+ N(e instanceof Error ? e.message : "Review commercial facts before saving.");
48
+ }
40
49
  },
41
50
  children: [
42
- /* @__PURE__ */ g("fieldset", {
43
- disabled: _ || O,
51
+ /* @__PURE__ */ y("fieldset", {
52
+ disabled: b || P,
44
53
  className: "space-y-5",
45
54
  children: [
46
- /* @__PURE__ */ h("legend", {
55
+ /* @__PURE__ */ v("legend", {
47
56
  className: "text-lg font-semibold",
48
57
  children: "Sourced cost draft"
49
58
  }),
50
- /* @__PURE__ */ g("div", {
59
+ /* @__PURE__ */ y("div", {
51
60
  className: "grid gap-3 md:grid-cols-2",
52
61
  children: [
53
- /* @__PURE__ */ h(i, {
62
+ /* @__PURE__ */ v(o, {
54
63
  label: "Estimate title",
55
- value: b.title,
64
+ value: E.title,
56
65
  required: !0,
57
- onChange: (e) => N({ title: e })
66
+ onChange: (e) => z({ title: e })
58
67
  }),
59
- /* @__PURE__ */ g(r, {
68
+ /* @__PURE__ */ y(a, {
60
69
  label: "Record type",
61
- value: b.kind,
70
+ value: E.kind,
62
71
  onChange: (e) => {
63
- (e === "ESTIMATE" || e === "QUOTE") && N({ kind: e });
72
+ (e === "ESTIMATE" || e === "QUOTE") && z({ kind: e });
64
73
  },
65
- children: [/* @__PURE__ */ h("option", {
74
+ children: [/* @__PURE__ */ v("option", {
66
75
  value: "ESTIMATE",
67
76
  children: "Estimate"
68
- }), /* @__PURE__ */ h("option", {
77
+ }), /* @__PURE__ */ v("option", {
69
78
  value: "QUOTE",
70
79
  children: "Reported quote"
71
80
  })]
72
81
  }),
73
- /* @__PURE__ */ h(i, {
82
+ /* @__PURE__ */ v(o, {
74
83
  label: "Commercial source",
75
- value: b.sourceReference,
84
+ value: E.sourceReference,
76
85
  required: !0,
77
- onChange: (e) => N({ sourceReference: e })
86
+ onChange: (e) => z({ sourceReference: e })
78
87
  }),
79
- /* @__PURE__ */ h(i, {
88
+ /* @__PURE__ */ v(o, {
80
89
  label: "Source version",
81
- value: b.sourceRevision,
90
+ value: E.sourceRevision,
82
91
  required: !0,
83
- onChange: (e) => N({ sourceRevision: e })
92
+ onChange: (e) => z({ sourceRevision: e })
84
93
  })
85
94
  ]
86
95
  }),
87
- /* @__PURE__ */ h(i, {
96
+ /* @__PURE__ */ v(o, {
88
97
  label: "Shipment and services covered by this source",
89
- value: b.commercialScope,
98
+ value: E.commercialScope,
90
99
  required: !0,
91
- onChange: (e) => N({ commercialScope: e })
100
+ onChange: (e) => z({ commercialScope: e })
92
101
  }),
93
- /* @__PURE__ */ g("p", {
102
+ /* @__PURE__ */ y("p", {
94
103
  className: "text-sm",
95
104
  children: [
96
105
  "Dates use your local time zone: ",
@@ -98,116 +107,122 @@ function _({ disabled: _, onPreview: v, onSave: y }) {
98
107
  ". They are recorded as exact UTC instants."
99
108
  ]
100
109
  }),
101
- /* @__PURE__ */ h(i, {
110
+ /* @__PURE__ */ v(o, {
102
111
  label: "Price applies at",
103
112
  type: "datetime-local",
104
- value: o(b.pricingAt),
113
+ value: c(E.pricingAt),
105
114
  required: !0,
106
115
  onChange: (e) => {
107
- e && N({ pricingAt: a(e) });
116
+ e && z({ pricingAt: s(e) });
108
117
  }
109
118
  }),
110
- /* @__PURE__ */ g("section", {
119
+ /* @__PURE__ */ y("section", {
111
120
  className: "space-y-4",
112
121
  children: [
113
- /* @__PURE__ */ h("h3", {
122
+ /* @__PURE__ */ v("h3", {
114
123
  className: "font-semibold",
115
124
  children: "Cost items"
116
125
  }),
117
- /* @__PURE__ */ h("p", {
126
+ /* @__PURE__ */ v("p", {
118
127
  className: "text-sm",
119
128
  children: "Blank amounts are unknown. Currency codes and decimal places are recorded conventions."
120
129
  }),
121
- b.lines.map((e) => /* @__PURE__ */ h(l, {
130
+ E.lines.map((e) => /* @__PURE__ */ v(f, {
122
131
  line: e,
123
- others: b.lines,
124
- onChange: (t) => N({ lines: b.lines.map((n) => n.id === e.id ? t : n) }),
125
- onRemove: () => N({ lines: b.lines.filter((t) => t.id !== e.id) })
132
+ others: E.lines,
133
+ onChange: (t) => z({ lines: E.lines.map((n) => n.id === e.id ? t : n) }),
134
+ onRemove: () => z({ lines: E.lines.filter((t) => t.id !== e.id) })
126
135
  }, e.id)),
127
- /* @__PURE__ */ h(e, {
136
+ /* @__PURE__ */ v(e, {
128
137
  type: "button",
129
138
  variant: "outline",
130
- disabled: b.lines.length >= 100,
131
- onClick: () => N({ lines: [...b.lines, c()] }),
139
+ disabled: E.lines.length >= 100,
140
+ onClick: () => z({ lines: [...E.lines, u()] }),
132
141
  children: "Add cost item"
133
142
  })
134
143
  ]
135
144
  }),
136
- /* @__PURE__ */ g("details", {
145
+ /* @__PURE__ */ y("details", {
137
146
  className: "space-y-4 rounded border p-4",
138
147
  children: [
139
- /* @__PURE__ */ h("summary", {
148
+ /* @__PURE__ */ v("summary", {
140
149
  className: "min-h-11 cursor-pointer font-medium",
141
150
  children: "Review cost scope, dates and conversion"
142
151
  }),
143
- /* @__PURE__ */ h(u, {
144
- value: b.requirements,
145
- onChange: (e) => N({ requirements: e })
152
+ /* @__PURE__ */ v(p, {
153
+ value: E.requirements,
154
+ onChange: (e) => z({ requirements: e })
146
155
  }),
147
- /* @__PURE__ */ g("section", {
156
+ /* @__PURE__ */ y("section", {
148
157
  className: "space-y-3",
149
- children: [/* @__PURE__ */ h("h3", {
158
+ children: [/* @__PURE__ */ v("h3", {
150
159
  className: "font-semibold",
151
160
  children: "Recorded quote dates"
152
161
  }), [
153
162
  "quotedAt",
154
163
  "validFrom",
155
164
  "validUntil"
156
- ].map((e) => /* @__PURE__ */ h(i, {
165
+ ].map((e) => /* @__PURE__ */ v(o, {
157
166
  label: e === "quotedAt" ? "Quote received at" : e === "validFrom" ? "Quote valid from" : "Quote valid until",
158
167
  type: "datetime-local",
159
- value: b[e] ? o(b[e]) : "",
160
- onChange: (t) => N({ [e]: t ? a(t) : null })
168
+ value: E[e] ? c(E[e]) : "",
169
+ onChange: (t) => z({ [e]: t ? s(t) : null })
161
170
  }, e))]
162
171
  }),
163
- /* @__PURE__ */ g(r, {
172
+ /* @__PURE__ */ y(a, {
164
173
  label: "Reporting total",
165
- value: b.reportingCurrency ? "RECORDED" : "UNKNOWN",
166
- onChange: (e) => N({ reportingCurrency: e === "RECORDED" ? {
174
+ value: E.reportingCurrency ? "RECORDED" : "UNKNOWN",
175
+ onChange: (e) => z({ reportingCurrency: e === "RECORDED" ? {
167
176
  code: "USD",
168
177
  minorUnitDigits: 2
169
178
  } : null }),
170
- children: [/* @__PURE__ */ h("option", {
179
+ children: [/* @__PURE__ */ v("option", {
171
180
  value: "UNKNOWN",
172
181
  children: "No reporting currency yet"
173
- }), /* @__PURE__ */ h("option", {
182
+ }), /* @__PURE__ */ v("option", {
174
183
  value: "RECORDED",
175
184
  children: "Use a recorded currency convention"
176
185
  })]
177
186
  }),
178
- b.reportingCurrency && /* @__PURE__ */ h(n, {
187
+ E.reportingCurrency && /* @__PURE__ */ v(i, {
179
188
  label: "Reporting currency convention",
180
- value: b.reportingCurrency,
181
- onChange: (e) => N({ reportingCurrency: e })
189
+ value: E.reportingCurrency,
190
+ onChange: (e) => z({ reportingCurrency: e })
182
191
  }),
183
- /* @__PURE__ */ h(d, {
184
- value: b.fx,
185
- onChange: (e) => N({ fx: e })
192
+ /* @__PURE__ */ v(m, {
193
+ value: E.fx,
194
+ onChange: (e) => z({ fx: e })
186
195
  })
187
196
  ]
188
197
  }),
189
- /* @__PURE__ */ h(t, {
190
- value: S,
191
- onChange: C,
198
+ /* @__PURE__ */ v(d, {
199
+ value: w,
200
+ onChange: T,
201
+ shipmentId: x,
202
+ evidence: O
203
+ }),
204
+ /* @__PURE__ */ v(t, {
205
+ value: O,
206
+ onChange: k,
192
207
  description: "Choose the exact source document versions. A readable document supports this reported record; it does not accept a quote or confirm capacity."
193
208
  })
194
209
  ]
195
210
  }),
196
- E && /* @__PURE__ */ h("p", {
211
+ M && /* @__PURE__ */ v("p", {
197
212
  role: "alert",
198
- children: E
213
+ children: M
199
214
  }),
200
- M && /* @__PURE__ */ h(f, {
201
- value: M,
202
- currency: b.reportingCurrency
215
+ R && /* @__PURE__ */ v(h, {
216
+ value: R,
217
+ currency: E.reportingCurrency
203
218
  }),
204
- /* @__PURE__ */ h(e, {
219
+ /* @__PURE__ */ v(e, {
205
220
  type: "submit",
206
- disabled: _ || O || b.lines.length === 0 || !!M && S.length === 0,
207
- children: O ? "Previewing…" : M ? "Save immutable cost version" : "Preview costs and missing facts"
221
+ disabled: b || P || E.lines.length === 0 || !!R && O.length === 0,
222
+ children: P ? "Previewing…" : R ? "Save immutable cost version" : "Preview costs and missing facts"
208
223
  })
209
224
  ]
210
225
  });
211
226
  }
212
227
  //#endregion
213
- export { _ as FreightDraftForm };
228
+ export { b as FreightDraftForm };
@@ -1,64 +1,66 @@
1
1
  import { freightLabel as e, freightMoney as t } from "../../utils/freightDraft.js";
2
2
  import { FreightTotals as n } from "./FreightTotals.js";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { FreightCommercialHistory as r } from "./FreightCommercialHistory.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
5
  //#region src/movethewheels/components/freight-cost/FreightHistory.tsx
5
- function a({ record: a }) {
6
- return /* @__PURE__ */ i("article", {
6
+ function o({ record: o }) {
7
+ return /* @__PURE__ */ a("article", {
7
8
  className: "min-w-0 space-y-4 break-words rounded border p-4",
8
9
  children: [
9
- /* @__PURE__ */ i("h2", {
10
+ /* @__PURE__ */ a("h2", {
10
11
  className: "text-lg font-semibold",
11
12
  children: [
12
- a.facts.title,
13
+ o.facts.title,
13
14
  " — version ",
14
- a.version
15
+ o.version
15
16
  ]
16
17
  }),
17
- /* @__PURE__ */ i("p", { children: [
18
- a.shipmentCapture.shipmentNumber,
18
+ /* @__PURE__ */ a("p", { children: [
19
+ o.shipmentCapture.shipmentNumber,
19
20
  " / ",
20
- a.shipmentCapture.primaryMode,
21
+ o.shipmentCapture.primaryMode,
21
22
  " — captured shipment context"
22
23
  ] }),
23
- /* @__PURE__ */ i("p", { children: [
24
- a.facts.kind === "QUOTE" ? "Reported quote" : "Estimate",
24
+ /* @__PURE__ */ a("p", { children: [
25
+ o.facts.kind === "QUOTE" ? "Reported quote" : "Estimate",
25
26
  ";",
26
27
  " ",
27
- e(a.validityAtRead),
28
+ e(o.validityAtRead),
28
29
  ". This record does not accept a quote or confirm capacity."
29
30
  ] }),
30
- /* @__PURE__ */ r("p", { children: a.facts.commercialScope }),
31
- /* @__PURE__ */ i("p", { children: [
31
+ /* @__PURE__ */ i("p", { children: o.facts.commercialScope }),
32
+ /* @__PURE__ */ a("p", { children: [
32
33
  "Source: ",
33
- a.facts.sourceReference,
34
+ o.facts.sourceReference,
34
35
  " / ",
35
- a.facts.sourceRevision
36
+ o.facts.sourceRevision
36
37
  ] }),
37
- /* @__PURE__ */ i("p", { children: [
38
+ /* @__PURE__ */ a("p", { children: [
38
39
  "Price at ",
39
- a.facts.pricingAt,
40
+ o.facts.pricingAt,
40
41
  "; recorded ",
41
- a.recordedAt,
42
+ o.recordedAt,
42
43
  " by ",
43
- a.createdBy,
44
+ o.createdBy,
44
45
  " (",
45
- e(a.actorProvenance),
46
+ e(o.actorProvenance),
46
47
  ")."
47
48
  ] }),
48
- /* @__PURE__ */ r(n, {
49
- value: a.totals,
50
- currency: a.facts.reportingCurrency
49
+ /* @__PURE__ */ i(r, { capture: o.commercialCapture }),
50
+ /* @__PURE__ */ i(n, {
51
+ value: o.totals,
52
+ currency: o.facts.reportingCurrency
51
53
  }),
52
- /* @__PURE__ */ i("details", { children: [/* @__PURE__ */ r("summary", {
54
+ /* @__PURE__ */ a("details", { children: [/* @__PURE__ */ i("summary", {
53
55
  className: "min-h-11 cursor-pointer font-medium",
54
56
  children: "Cost facts and evidence recorded with this version"
55
- }), /* @__PURE__ */ i("div", {
57
+ }), /* @__PURE__ */ a("div", {
56
58
  className: "space-y-3",
57
59
  children: [
58
- a.facts.lines.map((n) => /* @__PURE__ */ i("div", {
60
+ o.facts.lines.map((n) => /* @__PURE__ */ a("div", {
59
61
  className: "rounded border p-3",
60
62
  children: [
61
- /* @__PURE__ */ i("h3", {
63
+ /* @__PURE__ */ a("h3", {
62
64
  className: "font-medium",
63
65
  children: [
64
66
  n.description,
@@ -66,7 +68,7 @@ function a({ record: a }) {
66
68
  e(n.category)
67
69
  ]
68
70
  }),
69
- /* @__PURE__ */ i("p", { children: [
71
+ /* @__PURE__ */ a("p", { children: [
70
72
  e(n.disposition),
71
73
  "; payer ",
72
74
  n.payerLabel ?? "Unknown",
@@ -74,7 +76,7 @@ function a({ record: a }) {
74
76
  n.payerReference ?? "Unknown reference",
75
77
  ")."
76
78
  ] }),
77
- /* @__PURE__ */ i("p", { children: [
79
+ /* @__PURE__ */ a("p", { children: [
78
80
  "Reported amount: ",
79
81
  t(n.amountMinor, n.currency.minorUnitDigits),
80
82
  " ",
@@ -91,7 +93,7 @@ function a({ record: a }) {
91
93
  n.unitRateMajor ?? "Unknown",
92
94
  "."
93
95
  ] }),
94
- /* @__PURE__ */ i("p", { children: [
96
+ /* @__PURE__ */ a("p", { children: [
95
97
  "Source ",
96
98
  n.sourceReference ?? "Unknown",
97
99
  " /",
@@ -100,10 +102,10 @@ function a({ record: a }) {
100
102
  n.inclusionParentLineId ? `; included in recorded line ${n.inclusionParentLineId}` : "",
101
103
  "."
102
104
  ] }),
103
- n.zeroReason && /* @__PURE__ */ i("p", { children: ["Zero reason: ", n.zeroReason] })
105
+ n.zeroReason && /* @__PURE__ */ a("p", { children: ["Zero reason: ", n.zeroReason] })
104
106
  ]
105
107
  }, n.id)),
106
- a.facts.requirements.map((t) => /* @__PURE__ */ i("p", { children: [
108
+ o.facts.requirements.map((t) => /* @__PURE__ */ a("p", { children: [
107
109
  e(t.category),
108
110
  ": ",
109
111
  e(t.status),
@@ -116,17 +118,17 @@ function a({ record: a }) {
116
118
  " ",
117
119
  t.sourceRevision ?? "Unknown"
118
120
  ] }, t.category)),
119
- /* @__PURE__ */ i("p", { children: [
121
+ /* @__PURE__ */ a("p", { children: [
120
122
  "Quote occurred ",
121
- a.facts.quotedAt ?? "Unknown",
123
+ o.facts.quotedAt ?? "Unknown",
122
124
  "; validity",
123
125
  " ",
124
- a.facts.validFrom ?? "Unknown",
126
+ o.facts.validFrom ?? "Unknown",
125
127
  " to ",
126
- a.facts.validUntil ?? "Unknown",
128
+ o.facts.validUntil ?? "Unknown",
127
129
  "."
128
130
  ] }),
129
- a.facts.fx.map((e) => /* @__PURE__ */ i("p", { children: [
131
+ o.facts.fx.map((e) => /* @__PURE__ */ a("p", { children: [
130
132
  "1 ",
131
133
  e.fromCurrency.code,
132
134
  " = ",
@@ -146,7 +148,7 @@ function a({ record: a }) {
146
148
  "/",
147
149
  e.sourceRevision
148
150
  ] }, e.fromCurrency.code)),
149
- a.evidence.map((e) => /* @__PURE__ */ i("p", { children: [
151
+ o.evidence.map((e) => /* @__PURE__ */ a("p", { children: [
150
152
  "Recorded evidence: file ",
151
153
  e.fileId,
152
154
  ", version ",
@@ -161,4 +163,4 @@ function a({ record: a }) {
161
163
  });
162
164
  }
163
165
  //#endregion
164
- export { a as FreightHistory };
166
+ export { o as FreightHistory };
@@ -1 +0,0 @@
1
-