@burdenoff/microfe-movethewheels 2026.1016.2 → 2026.1016.4

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 (113) hide show
  1. package/README.md +10 -0
  2. package/dist/MoveTheWheelsRoot.js +5 -0
  3. package/dist/MoveTheWheelsRoutes.js +25 -21
  4. package/dist/components/ContainerEvidencePicker.js +55 -55
  5. package/dist/components/FleetAlertsPanel.js +2 -2
  6. package/dist/components/freight-cost/FreightCommercialEditor.js +217 -0
  7. package/dist/components/freight-cost/FreightCommercialFactEditor.js +217 -0
  8. package/dist/components/freight-cost/FreightCommercialHistory.js +115 -0
  9. package/dist/components/freight-cost/FreightDraftForm.js +106 -91
  10. package/dist/components/freight-cost/FreightHistory.js +42 -40
  11. package/dist/components/freight-invoice/InvoiceForm.js +366 -0
  12. package/dist/components/freight-invoice/InvoiceResults.js +240 -0
  13. package/dist/generated/consolidation-operations.d.ts +195 -265
  14. package/dist/generated/container-condition-operations.d.ts +124 -187
  15. package/dist/generated/container-operations.d.ts +59 -85
  16. package/dist/generated/empty-reuse-operations.d.ts +165 -271
  17. package/dist/generated/free-time-operations.d.ts +120 -184
  18. package/dist/generated/freight-cost-operations.d.ts +955 -165
  19. package/dist/generated/freight-invoice-operations.d.ts +1447 -0
  20. package/dist/generated/logistics-procedure-operations.d.ts +100 -156
  21. package/dist/generated/pending-pick-operations.d.ts +769 -1025
  22. package/dist/generated/shipment-status-authority-operations.d.ts +82 -103
  23. package/dist/generated/stock-binding-operations.d.ts +188 -260
  24. package/dist/generated/stock-observation-operations.d.ts +103 -138
  25. package/dist/generated/tracking-quality-operations.d.ts +27 -41
  26. package/dist/generated/trip-utilization-operations.d.ts +137 -185
  27. package/dist/generated/wspace-operations.d.ts +628 -2272
  28. package/dist/generated/wspace-types.d.ts +4 -23
  29. package/dist/hooks/useFreightRecoveryAction.js +20 -20
  30. package/dist/hooks/useInvoiceComparisonRecovery.js +118 -0
  31. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +2 -1
  32. package/dist/movethewheels/components/freight-cost/FreightCommercialEditor.d.ts +8 -0
  33. package/dist/movethewheels/components/freight-cost/FreightCommercialFactEditor.d.ts +8 -0
  34. package/dist/movethewheels/components/freight-cost/FreightCommercialHistory.d.ts +4 -0
  35. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +4 -2
  36. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +2 -2
  37. package/dist/movethewheels/components/freight-invoice/InvoiceForm.d.ts +19 -0
  38. package/dist/movethewheels/components/freight-invoice/InvoiceResults.d.ts +9 -0
  39. package/dist/movethewheels/hooks/useFleet.d.ts +1 -1
  40. package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +1 -1
  41. package/dist/movethewheels/hooks/useInvoiceComparisonRecovery.d.ts +22 -0
  42. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +1 -3
  43. package/dist/movethewheels/pages/FreightInvoicePage.d.ts +10 -0
  44. package/dist/movethewheels/utils/driverLicenseExpiry.d.ts +6 -0
  45. package/dist/movethewheels/utils/freightCommercial.d.ts +44 -0
  46. package/dist/movethewheels/utils/invoiceComparison.d.ts +32 -0
  47. package/dist/pages/DriverDetailsPage.js +306 -282
  48. package/dist/pages/FreightEstimatePage.js +97 -92
  49. package/dist/pages/FreightInvoicePage.js +346 -0
  50. package/dist/src/generated/consolidation-operations.js +3961 -503
  51. package/dist/src/generated/container-condition-operations.js +2968 -206
  52. package/dist/src/generated/container-operations.js +997 -99
  53. package/dist/src/generated/empty-reuse-operations.js +4811 -747
  54. package/dist/src/generated/free-time-operations.js +2824 -233
  55. package/dist/src/generated/freight-cost-operations.js +4852 -323
  56. package/dist/src/generated/freight-invoice-operations.js +4894 -0
  57. package/dist/src/generated/logistics-procedure-operations.js +2707 -360
  58. package/dist/src/generated/pending-pick-operations.js +8244 -1196
  59. package/dist/src/generated/shipment-status-authority-operations.js +1157 -84
  60. package/dist/src/generated/stock-binding-operations.js +2779 -173
  61. package/dist/src/generated/stock-observation-operations.js +1274 -91
  62. package/dist/src/generated/tracking-quality-operations.js +407 -42
  63. package/dist/src/generated/trip-utilization-operations.js +1765 -138
  64. package/dist/src/generated/wspace-operations.js +428 -706
  65. package/dist/utils/driverLicenseExpiry.js +14 -0
  66. package/dist/utils/freightAcknowledgement.js +6 -5
  67. package/dist/utils/freightCommercial.js +194 -0
  68. package/dist/utils/freightRecovery.js +22 -22
  69. package/dist/utils/invoiceComparison.js +272 -0
  70. package/package.json +30 -29
  71. package/src/generated/consolidation-operations.ts +60 -559
  72. package/src/generated/container-condition-operations.ts +63 -265
  73. package/src/generated/container-operations.ts +37 -132
  74. package/src/generated/empty-reuse-operations.ts +83 -824
  75. package/src/generated/free-time-operations.ts +55 -284
  76. package/src/generated/freight-cost-operations.ts +373 -349
  77. package/src/generated/freight-invoice-operations.ts +830 -0
  78. package/src/generated/logistics-procedure-operations.ts +60 -414
  79. package/src/generated/pending-pick-operations.ts +48 -1239
  80. package/src/generated/shipment-status-authority-operations.ts +33 -113
  81. package/src/generated/stock-binding-operations.ts +29 -198
  82. package/src/generated/stock-observation-operations.ts +24 -111
  83. package/src/generated/tracking-quality-operations.ts +19 -57
  84. package/src/generated/trip-utilization-operations.ts +32 -166
  85. package/src/generated/wspace-operations.ts +284 -2906
  86. package/src/generated/wspace-types.ts +2 -8
  87. package/src/movethewheels/MoveTheWheelsRoot.tsx +6 -0
  88. package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
  89. package/src/movethewheels/components/ContainerEvidencePicker.tsx +12 -4
  90. package/src/movethewheels/components/FleetAlertsPanel.tsx +4 -2
  91. package/src/movethewheels/components/freight-cost/FreightCommercialEditor.tsx +236 -0
  92. package/src/movethewheels/components/freight-cost/FreightCommercialFactEditor.tsx +258 -0
  93. package/src/movethewheels/components/freight-cost/FreightCommercialHistory.tsx +90 -0
  94. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +33 -4
  95. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +4 -2
  96. package/src/movethewheels/components/freight-invoice/InvoiceForm.tsx +412 -0
  97. package/src/movethewheels/components/freight-invoice/InvoiceResults.tsx +162 -0
  98. package/src/movethewheels/hooks/useFleet.ts +1 -1
  99. package/src/movethewheels/hooks/useFleetIntelligence.ts +5 -1
  100. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +2 -1
  101. package/src/movethewheels/hooks/useInvoiceComparisonRecovery.ts +227 -0
  102. package/src/movethewheels/pages/DriverDetailsPage.tsx +35 -9
  103. package/src/movethewheels/pages/FreightEstimatePage.tsx +15 -7
  104. package/src/movethewheels/pages/FreightInvoicePage.tsx +477 -0
  105. package/src/movethewheels/utils/driverLicenseExpiry.ts +25 -0
  106. package/src/movethewheels/utils/freightAcknowledgement.ts +3 -1
  107. package/src/movethewheels/utils/freightCommercial.ts +388 -0
  108. package/src/movethewheels/utils/freightRecovery.ts +6 -2
  109. package/src/movethewheels/utils/invoiceComparison.ts +520 -0
  110. package/src/operations/freight-cost/commercial.graphql +483 -0
  111. package/src/operations/freight-invoice/comparison.graphql +40 -0
  112. package/src/operations/wspace/freight-invoice-evidence.graphql +6 -0
  113. package/patches/braces@3.0.3.patch +0 -87
@@ -0,0 +1,240 @@
1
+ import { reuseCard as e } from "../ReuseControls.js";
2
+ import { freightLabel as t } from "../../utils/freightDraft.js";
3
+ import { invoiceMoney as n, invoiceRowDifference as r } from "../../utils/invoiceComparison.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/movethewheels/components/freight-invoice/InvoiceResults.tsx
6
+ function o({ value: o }) {
7
+ let { estimate: s, outcome: c } = o;
8
+ return /* @__PURE__ */ a("section", {
9
+ className: e,
10
+ "aria-label": "Invoice comparison results",
11
+ children: [
12
+ /* @__PURE__ */ i("h2", {
13
+ className: "text-lg font-semibold",
14
+ children: "Recorded-fact comparison"
15
+ }),
16
+ /* @__PURE__ */ a("p", { children: [
17
+ "Exact ",
18
+ s.kind.toLowerCase(),
19
+ " ",
20
+ s.estimateReference,
21
+ ", version ",
22
+ s.version,
23
+ ". Source ",
24
+ s.sourceReference,
25
+ " / ",
26
+ s.sourceRevision,
27
+ "."
28
+ ] }),
29
+ /* @__PURE__ */ a("p", { children: [
30
+ "Quote date ",
31
+ s.quotedAt ?? "Unknown",
32
+ "; source validity",
33
+ " ",
34
+ s.validFrom ?? "Unknown",
35
+ " to ",
36
+ s.validUntil ?? "Unknown",
37
+ ". Acceptance is not established by this comparison."
38
+ ] }),
39
+ "recordable" in o && /* @__PURE__ */ a("p", {
40
+ role: "status",
41
+ children: [
42
+ "Structural preview only.",
43
+ " ",
44
+ o.recordable ? "Source structure is recordable; current permission and Files eligibility are checked when recording." : `Not recordable: ${o.blockers.map(t).join(", ")}.`
45
+ ]
46
+ }),
47
+ /* @__PURE__ */ i("p", {
48
+ className: "font-medium",
49
+ children: c.allLinesMatched ? "All explicitly compared rows and expected coverage agree under this method." : "Differences or unknown coverage remain."
50
+ }),
51
+ /* @__PURE__ */ i("p", { children: "This is not an all-in cost, contracted-rate audit, liability finding, invoice approval or payment." }),
52
+ c.rows.map((e, n) => /* @__PURE__ */ a("article", {
53
+ className: "min-w-0 space-y-2 rounded border p-3",
54
+ children: [
55
+ /* @__PURE__ */ a("h3", {
56
+ className: "font-medium",
57
+ children: [
58
+ "Row ",
59
+ n + 1,
60
+ ":",
61
+ " ",
62
+ o.facts.rows.find((t) => t.id === e.invoiceLineId)?.description ?? "Reported charge"
63
+ ]
64
+ }),
65
+ /* @__PURE__ */ i("p", { children: e.estimateLineId ? "Mapped to the selected estimate row." : "No estimate row mapped." }),
66
+ /* @__PURE__ */ i("p", { children: e.flags.map(t).join(" · ") }),
67
+ e.reasons.length > 0 && /* @__PURE__ */ a("p", { children: ["Unknown reasons: ", e.reasons.map(t).join(", ")] }),
68
+ /* @__PURE__ */ a("p", { children: ["Comparable amount difference: ", r(o, e.invoiceLineId)] })
69
+ ]
70
+ }, e.invoiceLineId)),
71
+ c.missingExpectedLineIds.map((e) => /* @__PURE__ */ a("p", { children: [
72
+ "Missing expected line: ",
73
+ e,
74
+ ". An unknown value is not treated as zero."
75
+ ] }, e)),
76
+ c.unknownExpectedCoverage.map((e) => /* @__PURE__ */ a("p", { children: [
77
+ "Unknown expected-charge coverage: ",
78
+ e.estimateLineId,
79
+ ". This is not a proven missing charge."
80
+ ] }, e.estimateLineId)),
81
+ /* @__PURE__ */ a("section", {
82
+ className: "space-y-2",
83
+ children: [
84
+ /* @__PURE__ */ i("h3", {
85
+ className: "font-semibold",
86
+ children: "Comparable pairs only"
87
+ }),
88
+ c.comparableSubtotals.length === 0 && /* @__PURE__ */ i("p", { children: "No bounded comparable subtotal." }),
89
+ c.comparableSubtotals.map((e) => /* @__PURE__ */ a("p", { children: [
90
+ "Payer",
91
+ " ",
92
+ o.facts.rows.find((t) => t.payerReference === e.payerReference)?.payerLabel ?? e.payerReference,
93
+ ": estimate ",
94
+ n(e.estimateMinor, e.currency),
95
+ ", invoice",
96
+ " ",
97
+ n(e.invoiceMinor, e.currency),
98
+ ", difference",
99
+ " ",
100
+ n(e.deltaMinor, e.currency),
101
+ ". Included rows",
102
+ " ",
103
+ e.invoiceLineIds.map((e) => o.facts.rows.find((t) => t.id === e)?.description ?? "Reported charge").join(", "),
104
+ ". Other rows are omitted."
105
+ ] }, JSON.stringify([e.currency, e.payerReference])))
106
+ ]
107
+ }),
108
+ [["Declared estimate subtotals", o.estimateDeclaredSubtotals], ["Declared invoice subtotals", o.invoiceDeclaredSubtotals]].map(([e, t]) => /* @__PURE__ */ a("section", {
109
+ className: "space-y-2",
110
+ children: [/* @__PURE__ */ i("h3", {
111
+ className: "font-semibold",
112
+ children: e
113
+ }), t.map((e, t) => /* @__PURE__ */ a("p", { children: [
114
+ "Payer ",
115
+ e.payerLabel ?? "Unknown",
116
+ " (",
117
+ e.payerReference ?? "Unknown reference",
118
+ ");",
119
+ " ",
120
+ "known ",
121
+ n(e.knownAmountMinor, e.currency),
122
+ "; total",
123
+ " ",
124
+ n(e.totalAmountMinor, e.currency),
125
+ "."
126
+ ] }, JSON.stringify([
127
+ e.currency,
128
+ e.payerReference,
129
+ t
130
+ ])))]
131
+ }, e))
132
+ ]
133
+ });
134
+ }
135
+ function s({ record: e }) {
136
+ return /* @__PURE__ */ a("section", {
137
+ className: "min-w-0 space-y-4 break-words",
138
+ children: [
139
+ /* @__PURE__ */ a("h2", {
140
+ className: "text-lg font-semibold",
141
+ children: ["Immutable comparison revision ", e.revision]
142
+ }),
143
+ /* @__PURE__ */ a("p", { children: [
144
+ "Invoice ",
145
+ e.facts.invoiceReference,
146
+ "; supplier",
147
+ " ",
148
+ e.facts.supplierLabel ?? "Unknown label",
149
+ " (",
150
+ e.facts.supplierReference,
151
+ "). Source",
152
+ " ",
153
+ e.facts.sourceReference,
154
+ " / ",
155
+ e.facts.sourceRevision,
156
+ "; invoice date",
157
+ " ",
158
+ e.facts.invoiceDate ?? "Unknown",
159
+ "."
160
+ ] }),
161
+ /* @__PURE__ */ a("p", { children: [
162
+ "Recorded ",
163
+ e.recordedAt,
164
+ " by ",
165
+ e.createdBy,
166
+ ", ",
167
+ t(e.actorProvenance),
168
+ "; on behalf of ",
169
+ e.onBehalfOf ?? "Not declared",
170
+ ". Method ",
171
+ e.methodVersion,
172
+ "."
173
+ ] }),
174
+ e.correctionReason && /* @__PURE__ */ a("p", { children: [
175
+ "Correction reason: ",
176
+ e.correctionReason,
177
+ "; predecessor ",
178
+ e.previousComparisonId,
179
+ "."
180
+ ] }),
181
+ /* @__PURE__ */ a("details", { children: [/* @__PURE__ */ i("summary", {
182
+ className: "min-h-11 cursor-pointer font-medium",
183
+ children: "Original reported rows and exact evidence"
184
+ }), /* @__PURE__ */ a("div", {
185
+ className: "space-y-3",
186
+ children: [e.facts.rows.map((e) => /* @__PURE__ */ a("article", {
187
+ className: "rounded border p-3",
188
+ children: [
189
+ /* @__PURE__ */ a("h3", { children: [
190
+ e.description,
191
+ " (",
192
+ e.id,
193
+ ")"
194
+ ] }),
195
+ /* @__PURE__ */ a("p", { children: [
196
+ "Mapping ",
197
+ e.estimateLineId ?? "Unmatched",
198
+ "; amount",
199
+ " ",
200
+ n(e.amountMinor, e.currency),
201
+ "; payer ",
202
+ e.payerLabel ?? "Unknown",
203
+ " (",
204
+ e.payerReference ?? "Unknown reference",
205
+ ")."
206
+ ] }),
207
+ /* @__PURE__ */ a("p", { children: [
208
+ "Quantity ",
209
+ e.quantity ?? "Unknown",
210
+ " ",
211
+ e.unit ?? "unknown unit",
212
+ "; supplied rate",
213
+ " ",
214
+ e.unitRateMajor ?? "Unknown",
215
+ ". Invoice amount was not recalculated."
216
+ ] }),
217
+ e.zeroReason && /* @__PURE__ */ a("p", { children: ["Zero reason: ", e.zeroReason] })
218
+ ]
219
+ }, e.id)), e.evidence.map((e) => /* @__PURE__ */ a("p", {
220
+ className: "break-all",
221
+ children: [
222
+ "File ",
223
+ e.fileId,
224
+ ", exact version ",
225
+ e.versionId,
226
+ "; SHA256 ",
227
+ e.sha256Hash,
228
+ "; checked",
229
+ " ",
230
+ e.checkedAt,
231
+ ". Point-in-time eligibility only."
232
+ ]
233
+ }, e.versionId))]
234
+ })] }),
235
+ /* @__PURE__ */ i(o, { value: e })
236
+ ]
237
+ });
238
+ }
239
+ //#endregion
240
+ export { s as InvoiceHistoryRecord, o as InvoiceResults };