@burdenoff/microfe-movethewheels 2026.930.5 → 2026.1010.1

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 (373) hide show
  1. package/dist/MoveTheWheelsRoot.js +177 -102
  2. package/dist/MoveTheWheelsRoutes.js +55 -11
  3. package/dist/_virtual/_rolldown/runtime.js +1 -1
  4. package/dist/components/ContainerEvidencePicker.js +143 -0
  5. package/dist/components/FreeTimeAgreementForm.js +496 -0
  6. package/dist/components/ReturnInstructionForm.js +108 -0
  7. package/dist/components/ReuseControls.js +91 -0
  8. package/dist/components/ReusePermissionForm.js +114 -0
  9. package/dist/components/ReuseProposalForm.js +455 -0
  10. package/dist/components/ReuseSourceFields.js +78 -0
  11. package/dist/components/consolidation/ConsolidationHistory.js +244 -0
  12. package/dist/components/consolidation/ConsolidationLotEditor.js +133 -0
  13. package/dist/components/consolidation/ConsolidationManifestWorkbench.js +143 -0
  14. package/dist/components/consolidation/ConsolidationPlanForm.js +172 -0
  15. package/dist/components/consolidation/ConsolidationPlanWorkbench.js +321 -0
  16. package/dist/components/consolidation/ConsolidationReportForm.js +94 -0
  17. package/dist/components/consolidation/ConsolidationReportsWorkbench.js +195 -0
  18. package/dist/components/consolidation/ConsolidationSummary.js +76 -0
  19. package/dist/components/consolidation/OriginalConsolidationHistory.js +112 -0
  20. package/dist/components/freight-cost/FreightDraftForm.js +213 -0
  21. package/dist/components/freight-cost/FreightFields.js +70 -0
  22. package/dist/components/freight-cost/FreightFxEditor.js +90 -0
  23. package/dist/components/freight-cost/FreightHistory.js +164 -0
  24. package/dist/components/freight-cost/FreightLineEditor.js +191 -0
  25. package/dist/components/freight-cost/FreightScopeEditor.js +72 -0
  26. package/dist/components/freight-cost/FreightTotals.js +66 -0
  27. package/dist/components/logistics-procedure/ProcedureDecisionForm.js +197 -0
  28. package/dist/components/logistics-procedure/ProcedureFields.js +31 -0
  29. package/dist/components/logistics-procedure/ProcedureHistory.js +177 -0
  30. package/dist/components/logistics-procedure/ProcedurePolicyForm.js +227 -0
  31. package/dist/components/logistics-procedure/ProcedurePolicyWorkbench.js +155 -0
  32. package/dist/components/logistics-procedure/ProcedureReviewWorkbench.js +221 -0
  33. package/dist/components/logistics-procedure/ProcedureRunWorkbench.js +190 -0
  34. package/dist/components/logistics-procedure/ProcedureSubjectPicker.js +130 -0
  35. package/dist/components/pending-pick/PendingPickDraft.js +84 -0
  36. package/dist/components/pending-pick/PendingPickHistory.js +113 -0
  37. package/dist/components/pending-pick/PickCapture.js +166 -0
  38. package/dist/components/pending-pick/PickLineSelection.js +111 -0
  39. package/dist/components/stock-binding/StockAssessmentDraft.js +48 -0
  40. package/dist/components/stock-binding/StockAssessmentHistory.js +61 -0
  41. package/dist/components/stock-binding/StockAssessmentSummary.js +199 -0
  42. package/dist/components/stock-binding/StockFactForm.js +232 -0
  43. package/dist/components/stock-observation/StockIssueForm.js +148 -0
  44. package/dist/components/stock-observation/StockIssueHistory.js +116 -0
  45. package/dist/components/stock-observation/StockIssueReadPanel.js +70 -0
  46. package/dist/components/trip-utilization/TripReportForm.js +118 -0
  47. package/dist/components/trip-utilization/TripReportHistory.js +54 -0
  48. package/dist/components/trip-utilization/TripReportSummary.js +216 -0
  49. package/dist/components/trip-utilization/TripSegmentFields.js +166 -0
  50. package/dist/generated/consolidation-operations.d.ts +1060 -0
  51. package/dist/generated/container-condition-operations.d.ts +868 -0
  52. package/dist/generated/container-operations.d.ts +356 -0
  53. package/dist/generated/empty-reuse-operations.d.ts +1578 -0
  54. package/dist/generated/free-time-operations.d.ts +938 -0
  55. package/dist/generated/freight-cost-operations.d.ts +716 -0
  56. package/dist/generated/logistics-procedure-operations.d.ts +938 -0
  57. package/dist/generated/pending-pick-operations.d.ts +1969 -0
  58. package/dist/generated/stock-binding-operations.d.ts +930 -0
  59. package/dist/generated/stock-observation-operations.d.ts +476 -0
  60. package/dist/generated/trip-utilization-operations.d.ts +651 -0
  61. package/dist/generated/wspace-operations.d.ts +143 -50
  62. package/dist/hooks/useConsolidationAction.js +119 -0
  63. package/dist/hooks/useContainerCondition.js +105 -0
  64. package/dist/hooks/useContainerLifecycle.js +192 -0
  65. package/dist/hooks/useEmptyReuseAction.js +45 -0
  66. package/dist/hooks/useFreightRecoveryAction.js +117 -0
  67. package/dist/hooks/useProcedureAction.js +119 -0
  68. package/dist/hooks/useProcedureSelection.js +53 -0
  69. package/dist/hooks/useReuseRecoveryAction.js +116 -0
  70. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +10 -0
  71. package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +14 -0
  72. package/dist/movethewheels/components/ReturnInstructionForm.d.ts +8 -0
  73. package/dist/movethewheels/components/ReuseControls.d.ts +42 -0
  74. package/dist/movethewheels/components/ReusePermissionForm.d.ts +9 -0
  75. package/dist/movethewheels/components/ReuseProposalForm.d.ts +11 -0
  76. package/dist/movethewheels/components/ReuseSourceFields.d.ts +9 -0
  77. package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +13 -0
  78. package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +6 -0
  79. package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +8 -0
  80. package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +8 -0
  81. package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +5 -0
  82. package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +9 -0
  83. package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +7 -0
  84. package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +6 -0
  85. package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +8 -0
  86. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +8 -0
  87. package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +23 -0
  88. package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +6 -0
  89. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +5 -0
  90. package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +8 -0
  91. package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +6 -0
  92. package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +6 -0
  93. package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +20 -0
  94. package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +17 -0
  95. package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +7 -0
  96. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +10 -0
  97. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +5 -0
  98. package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +5 -0
  99. package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +6 -0
  100. package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +7 -0
  101. package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +16 -0
  102. package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +5 -0
  103. package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +6 -0
  104. package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +17 -0
  105. package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +13 -0
  106. package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +18 -0
  107. package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +9 -0
  108. package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +6 -0
  109. package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +7 -0
  110. package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +7 -0
  111. package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +5 -0
  112. package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +6 -0
  113. package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +14 -0
  114. package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +5 -0
  115. package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +9 -0
  116. package/dist/movethewheels/hooks/useConsolidationAction.d.ts +19 -0
  117. package/dist/movethewheels/hooks/useContainerCondition.d.ts +21 -0
  118. package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +40 -0
  119. package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +14 -0
  120. package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +23 -0
  121. package/dist/movethewheels/hooks/useProcedureAction.d.ts +18 -0
  122. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +51 -0
  123. package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +18 -0
  124. package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -0
  125. package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -0
  126. package/dist/movethewheels/pages/ContainersPage.d.ts +2 -0
  127. package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -0
  128. package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -0
  129. package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -0
  130. package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -0
  131. package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -0
  132. package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -0
  133. package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -0
  134. package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -0
  135. package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +12 -0
  136. package/dist/movethewheels/utils/consolidationInput.d.ts +15 -0
  137. package/dist/movethewheels/utils/consolidationLot.d.ts +3 -0
  138. package/dist/movethewheels/utils/consolidationPins.d.ts +20 -0
  139. package/dist/movethewheels/utils/consolidationRecovery.d.ts +5 -0
  140. package/dist/movethewheels/utils/consolidationReportHead.d.ts +5 -0
  141. package/dist/movethewheels/utils/freeTimeDate.d.ts +1 -0
  142. package/dist/movethewheels/utils/freightAcknowledgement.d.ts +2 -0
  143. package/dist/movethewheels/utils/freightDraft.d.ts +36 -0
  144. package/dist/movethewheels/utils/freightRecovery.d.ts +5 -0
  145. package/dist/movethewheels/utils/graphqlClient.d.ts +2 -1
  146. package/dist/movethewheels/utils/pendingPickDraft.d.ts +8 -0
  147. package/dist/movethewheels/utils/procedureInput.d.ts +18 -0
  148. package/dist/movethewheels/utils/procedureRecovery.d.ts +5 -0
  149. package/dist/movethewheels/utils/reuseAttempt.d.ts +7 -0
  150. package/dist/movethewheels/utils/reuseForm.d.ts +6 -0
  151. package/dist/movethewheels/utils/reuseRecovery.d.ts +26 -0
  152. package/dist/movethewheels/utils/stockBindingForm.d.ts +23 -0
  153. package/dist/movethewheels/utils/stockBindingLabels.d.ts +10 -0
  154. package/dist/movethewheels/utils/stockObservationForm.d.ts +5 -0
  155. package/dist/movethewheels/utils/tripDraftContext.d.ts +25 -0
  156. package/dist/movethewheels/utils/tripUtilizationForm.d.ts +6 -0
  157. package/dist/node_modules/@react-leaflet/core/lib/component.js +5 -5
  158. package/dist/node_modules/fast-equals/dist/es/index.js +87 -74
  159. package/dist/node_modules/leaflet/dist/leaflet-src.js +8 -5
  160. package/dist/node_modules/lodash/_Stack.js +2 -1
  161. package/dist/node_modules/lucide-react/dist/esm/icons/clipboard-list.js +35 -0
  162. package/dist/node_modules/lucide-react/dist/esm/icons/repeat-2.js +22 -0
  163. package/dist/node_modules/react-leaflet/lib/MapContainer.js +3 -3
  164. package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
  165. package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
  166. package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
  167. package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
  168. package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
  169. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +13 -13
  170. package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
  171. package/dist/node_modules/recharts/es6/cartesian/Line.js +10 -10
  172. package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
  173. package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
  174. package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
  175. package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
  176. package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
  177. package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
  178. package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
  179. package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
  180. package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
  181. package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
  182. package/dist/node_modules/recharts/es6/component/Label.js +14 -14
  183. package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
  184. package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
  185. package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
  186. package/dist/node_modules/recharts/es6/component/Text.js +2 -2
  187. package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
  188. package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
  189. package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
  190. package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
  191. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
  192. package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
  193. package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
  194. package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
  195. package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
  196. package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
  197. package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
  198. package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
  199. package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
  200. package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
  201. package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
  202. package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
  203. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
  204. package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
  205. package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
  206. package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
  207. package/dist/node_modules/recharts/es6/util/ReactUtils.js +2 -2
  208. package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
  209. package/dist/node_modules/recharts/es6/util/types.js +1 -1
  210. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.development.js +2 -2
  211. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.production.min.js +2 -2
  212. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/index.js +2 -2
  213. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +97 -18
  214. package/dist/node_modules/zustand/esm/middleware.js +2 -2
  215. package/dist/pages/ConsolidationPage.js +76 -0
  216. package/dist/pages/ContainerConditionPage.js +972 -0
  217. package/dist/pages/ContainersPage.js +522 -0
  218. package/dist/pages/EmptyReusePage.js +777 -0
  219. package/dist/pages/FreeTimePage.js +657 -0
  220. package/dist/pages/FreightEstimatePage.js +284 -0
  221. package/dist/pages/LogisticsProceduresPage.js +100 -0
  222. package/dist/pages/PendingPickPage.js +155 -0
  223. package/dist/pages/StockBindingPage.js +236 -0
  224. package/dist/pages/StockObservationsPage.js +168 -0
  225. package/dist/pages/TripUtilizationPage.js +227 -0
  226. package/dist/src/generated/consolidation-operations.js +505 -0
  227. package/dist/src/generated/container-condition-operations.js +208 -0
  228. package/dist/src/generated/container-operations.js +101 -0
  229. package/dist/src/generated/empty-reuse-operations.js +749 -0
  230. package/dist/src/generated/free-time-operations.js +235 -0
  231. package/dist/src/generated/freight-cost-operations.js +325 -0
  232. package/dist/src/generated/logistics-procedure-operations.js +362 -0
  233. package/dist/src/generated/pending-pick-operations.js +1128 -0
  234. package/dist/src/generated/stock-binding-operations.js +175 -0
  235. package/dist/src/generated/stock-observation-operations.js +93 -0
  236. package/dist/src/generated/trip-utilization-operations.js +140 -0
  237. package/dist/src/generated/wspace-operations.js +708 -0
  238. package/dist/utils/consolidationHistoryTarget.js +27 -0
  239. package/dist/utils/consolidationInput.js +21 -0
  240. package/dist/utils/consolidationLot.js +29 -0
  241. package/dist/utils/consolidationPins.js +13 -0
  242. package/dist/utils/consolidationRecovery.js +40 -0
  243. package/dist/utils/consolidationReportHead.js +18 -0
  244. package/dist/utils/freeTimeDate.js +26 -0
  245. package/dist/utils/freightAcknowledgement.js +8 -0
  246. package/dist/utils/freightDraft.js +125 -0
  247. package/dist/utils/freightRecovery.js +36 -0
  248. package/dist/utils/graphqlClient.js +28 -28
  249. package/dist/utils/pendingPickDraft.js +46 -0
  250. package/dist/utils/procedureInput.js +43 -0
  251. package/dist/utils/procedureRecovery.js +42 -0
  252. package/dist/utils/reuseAttempt.js +20 -0
  253. package/dist/utils/reuseForm.js +25 -0
  254. package/dist/utils/reuseRecovery.js +71 -0
  255. package/dist/utils/stockBindingForm.js +142 -0
  256. package/dist/utils/stockBindingLabels.js +23 -0
  257. package/dist/utils/stockObservationForm.js +55 -0
  258. package/dist/utils/tripDraftContext.js +19 -0
  259. package/dist/utils/tripUtilizationForm.js +60 -0
  260. package/package.json +19 -5
  261. package/src/generated/consolidation-operations.ts +1138 -0
  262. package/src/generated/container-condition-operations.ts +771 -0
  263. package/src/generated/container-operations.ts +376 -0
  264. package/src/generated/empty-reuse-operations.ts +1648 -0
  265. package/src/generated/free-time-operations.ts +814 -0
  266. package/src/generated/freight-cost-operations.ts +753 -0
  267. package/src/generated/logistics-procedure-operations.ts +1047 -0
  268. package/src/generated/pending-pick-operations.ts +1508 -0
  269. package/src/generated/stock-binding-operations.ts +631 -0
  270. package/src/generated/stock-observation-operations.ts +373 -0
  271. package/src/generated/trip-utilization-operations.ts +500 -0
  272. package/src/generated/wspace-operations.ts +116 -0
  273. package/src/movethewheels/MoveTheWheelsRoot.tsx +79 -0
  274. package/src/movethewheels/MoveTheWheelsRoutes.tsx +22 -0
  275. package/src/movethewheels/components/ContainerEvidencePicker.tsx +146 -0
  276. package/src/movethewheels/components/FreeTimeAgreementForm.tsx +483 -0
  277. package/src/movethewheels/components/ReturnInstructionForm.tsx +102 -0
  278. package/src/movethewheels/components/ReuseControls.tsx +138 -0
  279. package/src/movethewheels/components/ReusePermissionForm.tsx +123 -0
  280. package/src/movethewheels/components/ReuseProposalForm.tsx +484 -0
  281. package/src/movethewheels/components/ReuseSourceFields.tsx +80 -0
  282. package/src/movethewheels/components/consolidation/ConsolidationHistory.tsx +159 -0
  283. package/src/movethewheels/components/consolidation/ConsolidationLotEditor.tsx +144 -0
  284. package/src/movethewheels/components/consolidation/ConsolidationManifestWorkbench.tsx +168 -0
  285. package/src/movethewheels/components/consolidation/ConsolidationPlanForm.tsx +185 -0
  286. package/src/movethewheels/components/consolidation/ConsolidationPlanWorkbench.tsx +395 -0
  287. package/src/movethewheels/components/consolidation/ConsolidationReportForm.tsx +124 -0
  288. package/src/movethewheels/components/consolidation/ConsolidationReportsWorkbench.tsx +233 -0
  289. package/src/movethewheels/components/consolidation/ConsolidationSummary.tsx +84 -0
  290. package/src/movethewheels/components/consolidation/OriginalConsolidationHistory.tsx +133 -0
  291. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +224 -0
  292. package/src/movethewheels/components/freight-cost/FreightFields.tsx +91 -0
  293. package/src/movethewheels/components/freight-cost/FreightFxEditor.tsx +98 -0
  294. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +91 -0
  295. package/src/movethewheels/components/freight-cost/FreightLineEditor.tsx +192 -0
  296. package/src/movethewheels/components/freight-cost/FreightScopeEditor.tsx +64 -0
  297. package/src/movethewheels/components/freight-cost/FreightTotals.tsx +68 -0
  298. package/src/movethewheels/components/logistics-procedure/ProcedureDecisionForm.tsx +204 -0
  299. package/src/movethewheels/components/logistics-procedure/ProcedureFields.tsx +43 -0
  300. package/src/movethewheels/components/logistics-procedure/ProcedureHistory.tsx +102 -0
  301. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyForm.tsx +226 -0
  302. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.tsx +174 -0
  303. package/src/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.tsx +278 -0
  304. package/src/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.tsx +292 -0
  305. package/src/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.tsx +111 -0
  306. package/src/movethewheels/components/pending-pick/PendingPickDraft.tsx +82 -0
  307. package/src/movethewheels/components/pending-pick/PendingPickHistory.tsx +93 -0
  308. package/src/movethewheels/components/pending-pick/PickCapture.tsx +70 -0
  309. package/src/movethewheels/components/pending-pick/PickLineSelection.tsx +130 -0
  310. package/src/movethewheels/components/stock-binding/StockAssessmentDraft.tsx +52 -0
  311. package/src/movethewheels/components/stock-binding/StockAssessmentHistory.tsx +56 -0
  312. package/src/movethewheels/components/stock-binding/StockAssessmentSummary.tsx +108 -0
  313. package/src/movethewheels/components/stock-binding/StockFactForm.tsx +186 -0
  314. package/src/movethewheels/components/stock-observation/StockIssueForm.tsx +103 -0
  315. package/src/movethewheels/components/stock-observation/StockIssueHistory.tsx +96 -0
  316. package/src/movethewheels/components/stock-observation/StockIssueReadPanel.tsx +72 -0
  317. package/src/movethewheels/components/trip-utilization/TripReportForm.tsx +116 -0
  318. package/src/movethewheels/components/trip-utilization/TripReportHistory.tsx +51 -0
  319. package/src/movethewheels/components/trip-utilization/TripReportSummary.tsx +127 -0
  320. package/src/movethewheels/components/trip-utilization/TripSegmentFields.tsx +118 -0
  321. package/src/movethewheels/hooks/useConsolidationAction.ts +196 -0
  322. package/src/movethewheels/hooks/useContainerCondition.ts +129 -0
  323. package/src/movethewheels/hooks/useContainerLifecycle.ts +291 -0
  324. package/src/movethewheels/hooks/useEmptyReuseAction.ts +72 -0
  325. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +201 -0
  326. package/src/movethewheels/hooks/useProcedureAction.ts +196 -0
  327. package/src/movethewheels/hooks/useProcedureSelection.ts +75 -0
  328. package/src/movethewheels/hooks/useReuseRecoveryAction.ts +192 -0
  329. package/src/movethewheels/pages/ConsolidationPage.tsx +70 -0
  330. package/src/movethewheels/pages/ContainerConditionPage.tsx +959 -0
  331. package/src/movethewheels/pages/ContainersPage.tsx +490 -0
  332. package/src/movethewheels/pages/EmptyReusePage.tsx +823 -0
  333. package/src/movethewheels/pages/FreeTimePage.tsx +720 -0
  334. package/src/movethewheels/pages/FreightEstimatePage.tsx +353 -0
  335. package/src/movethewheels/pages/LogisticsProceduresPage.tsx +86 -0
  336. package/src/movethewheels/pages/PendingPickPage.tsx +226 -0
  337. package/src/movethewheels/pages/StockBindingPage.tsx +299 -0
  338. package/src/movethewheels/pages/StockObservationsPage.tsx +181 -0
  339. package/src/movethewheels/pages/TripUtilizationPage.tsx +315 -0
  340. package/src/movethewheels/utils/consolidationHistoryTarget.ts +39 -0
  341. package/src/movethewheels/utils/consolidationInput.ts +70 -0
  342. package/src/movethewheels/utils/consolidationLot.ts +24 -0
  343. package/src/movethewheels/utils/consolidationPins.ts +52 -0
  344. package/src/movethewheels/utils/consolidationRecovery.ts +88 -0
  345. package/src/movethewheels/utils/consolidationReportHead.ts +29 -0
  346. package/src/movethewheels/utils/freeTimeDate.ts +31 -0
  347. package/src/movethewheels/utils/freightAcknowledgement.ts +31 -0
  348. package/src/movethewheels/utils/freightDraft.ts +170 -0
  349. package/src/movethewheels/utils/freightRecovery.ts +79 -0
  350. package/src/movethewheels/utils/graphqlClient.ts +14 -5
  351. package/src/movethewheels/utils/pendingPickDraft.ts +61 -0
  352. package/src/movethewheels/utils/procedureInput.ts +98 -0
  353. package/src/movethewheels/utils/procedureRecovery.ts +92 -0
  354. package/src/movethewheels/utils/reuseAttempt.ts +29 -0
  355. package/src/movethewheels/utils/reuseForm.ts +30 -0
  356. package/src/movethewheels/utils/reuseRecovery.ts +151 -0
  357. package/src/movethewheels/utils/stockBindingForm.ts +209 -0
  358. package/src/movethewheels/utils/stockBindingLabels.ts +41 -0
  359. package/src/movethewheels/utils/stockObservationForm.ts +73 -0
  360. package/src/movethewheels/utils/tripDraftContext.ts +61 -0
  361. package/src/movethewheels/utils/tripUtilizationForm.ts +105 -0
  362. package/src/operations/condition/container-condition.graphql +41 -0
  363. package/src/operations/consolidation/consolidation.graphql +490 -0
  364. package/src/operations/container/container-lifecycle.graphql +80 -0
  365. package/src/operations/empty-reuse/empty-reuse.graphql +737 -0
  366. package/src/operations/free-time/free-time.graphql +47 -0
  367. package/src/operations/freight-cost/freight.graphql +6 -0
  368. package/src/operations/logistics-procedure/procedure.graphql +15 -0
  369. package/src/operations/pending-pick/pending-pick.graphql +1122 -0
  370. package/src/operations/stock-binding/stock-binding.graphql +160 -0
  371. package/src/operations/stock-observation/stock-observation.graphql +20 -0
  372. package/src/operations/trip-utilization/trip-utilization.graphql +126 -0
  373. package/src/operations/wspace/container-evidence.graphql +6 -0
@@ -0,0 +1,484 @@
1
+ import { reuseText, reuseInteger, readReuseSource } from '../utils/reuseForm';
2
+ import { useState } from 'react';
3
+ import { Button } from './ui';
4
+ import { ContainerEvidencePicker, type SelectedEvidence } from './ContainerEvidencePicker';
5
+ import { ReuseField, ReusePager, ReuseState, PinnedSelect } from './ReuseControls';
6
+ import { ReuseSourceFields } from './ReuseSourceFields';
7
+ import { freeTimeIso } from '../utils/freeTimeDate';
8
+ import { useConditionQuery } from '../hooks/useContainerCondition';
9
+ import { EQUIPMENT_TYPES } from '../hooks/useContainerLifecycle';
10
+ import {
11
+ ReuseEventsDocument,
12
+ ReuseInspectionsDocument,
13
+ ReuseQualificationsDocument,
14
+ ReuseRouteDocument,
15
+ type ReuseEventsQuery,
16
+ type ReuseInspectionsQuery,
17
+ type ReuseQualificationsQuery,
18
+ type ReuseRouteQuery,
19
+ type ReuseProposalFieldsFragment,
20
+ type ReturnInstructionFieldsFragment,
21
+ type RecordMtwReuseProposalInput,
22
+ type MtwContainerCargoCategory,
23
+ type MtwEquipmentType,
24
+ } from '../../generated/empty-reuse-operations';
25
+ export type ReuseProposalDraft = Omit<
26
+ RecordMtwReuseProposalInput,
27
+ 'idempotencyKey' | 'expectedCycleVersion' | 'cycleId'
28
+ >;
29
+ const categories: MtwContainerCargoCategory[] = [
30
+ 'DRY',
31
+ 'REEFER',
32
+ 'FOOD_GRADE',
33
+ 'PEST',
34
+ 'DANGEROUS',
35
+ ];
36
+ export function ReuseProposalForm({
37
+ cycleId,
38
+ containerId,
39
+ instruction,
40
+ initial,
41
+ busy,
42
+ onSubmit,
43
+ }: {
44
+ cycleId: string;
45
+ containerId: string;
46
+ instruction: ReturnInstructionFieldsFragment;
47
+ initial?: ReuseProposalFieldsFragment;
48
+ busy: boolean;
49
+ onSubmit: (input: ReuseProposalDraft) => Promise<unknown>;
50
+ }) {
51
+ const [eventOffset, setEventOffset] = useState(0);
52
+ const [inspectionOffset, setInspectionOffset] = useState(0);
53
+ const [qualificationOffset, setQualificationOffset] = useState(0);
54
+ const [eventId, setEventId] = useState(initial?.emptyEventId ?? '');
55
+ const [inspectionId, setInspectionId] = useState(initial?.inspectionId ?? '');
56
+ const [qualificationId, setQualificationId] = useState(
57
+ initial?.assessment.conditionQualificationId ?? ''
58
+ );
59
+ const [routeInput, setRouteInput] = useState(initial?.transportRouteId ?? '');
60
+ const [routeRevision, setRouteRevision] = useState(0);
61
+ const [routeId, setRouteId] = useState(initial?.transportRouteId ?? '');
62
+ const [equipment, setEquipment] = useState<MtwEquipmentType>(
63
+ initial?.requiredEquipmentType ?? 'DRY_20'
64
+ );
65
+ const [cargo, setCargo] = useState<MtwContainerCargoCategory>(initial?.cargoCategory ?? 'DRY');
66
+ const [hasTiming, setHasTiming] = useState(!!initial?.assessment.timing);
67
+ const [hasBinding, setHasBinding] = useState(!!initial?.assessment.routeBinding);
68
+ const [evidence, setEvidence] = useState<SelectedEvidence[]>(
69
+ () =>
70
+ initial?.evidence.map((item) => ({
71
+ fileId: item.fileId,
72
+ versionId: item.versionId,
73
+ label: `Pinned evidence version ${item.versionId}`,
74
+ })) ?? []
75
+ );
76
+ const [error, setError] = useState<string | null>(null);
77
+ const events = useConditionQuery<ReuseEventsQuery>(ReuseEventsDocument, {
78
+ cycleId,
79
+ pagination: { limit: 25, offset: eventOffset },
80
+ });
81
+ const inspections = useConditionQuery<ReuseInspectionsQuery>(ReuseInspectionsDocument, {
82
+ containerId,
83
+ pagination: { limit: 25, offset: inspectionOffset },
84
+ });
85
+ const qualifications = useConditionQuery<ReuseQualificationsQuery>(ReuseQualificationsDocument, {
86
+ pagination: { limit: 25, offset: qualificationOffset },
87
+ });
88
+ const route = useConditionQuery<ReuseRouteQuery>(
89
+ ReuseRouteDocument,
90
+ routeId ? { id: routeId } : null,
91
+ routeRevision
92
+ );
93
+ const routeRecord = route.data?.route;
94
+ const waypoints = Array.isArray(routeRecord?.waypoints) ? routeRecord.waypoints : null;
95
+ const timing = initial?.assessment.timing;
96
+ return (
97
+ <form
98
+ className="space-y-5"
99
+ onSubmit={async (event) => {
100
+ event.preventDefault();
101
+ setError(null);
102
+ try {
103
+ const values = new FormData(event.currentTarget);
104
+ if (!eventId || !inspectionId || !routeRecord || routeInput.trim() !== routeId)
105
+ throw new Error('Select pinned empty event, inspection and a loaded current route.');
106
+ if (!evidence.length) throw new Error('Choose exact proposal evidence.');
107
+ const proposalReference = reuseText(values, 'proposalReference');
108
+ if (initial && proposalReference !== initial.proposalReference)
109
+ throw new Error(
110
+ 'Keep the same proposal reference when recording a revision; choose a new draft for a new reference.'
111
+ );
112
+ const input: ReuseProposalDraft = {
113
+ instructionId: instruction.id,
114
+ proposalReference,
115
+ expectedProposalRevision: initial?.revision ?? 0,
116
+ emptyEventId: eventId,
117
+ inspectionId,
118
+ transportRouteId: routeRecord.id,
119
+ transportRouteUpdatedAt: routeRecord.updatedAt,
120
+ exportBookingReference: reuseText(values, 'exportBookingReference'),
121
+ exporterReference: reuseText(values, 'exporterReference'),
122
+ handoffLocationReference: reuseText(values, 'handoffLocationReference'),
123
+ handoffFrom: freeTimeIso(reuseText(values, 'handoffFrom')),
124
+ handoffUntil: freeTimeIso(reuseText(values, 'handoffUntil')),
125
+ requiredEquipmentType: equipment,
126
+ cargoCategory: cargo,
127
+ conditionQualificationId: qualificationId || undefined,
128
+ evidence: evidence.map(({ fileId, versionId }) => ({ fileId, versionId })),
129
+ sources: {
130
+ booking: readReuseSource(values, 'booking', evidence),
131
+ roadAccess: readReuseSource(values, 'roadAccess', evidence),
132
+ conditionSuitability: readReuseSource(values, 'conditionSuitability', evidence),
133
+ retainedReturnPlan: readReuseSource(values, 'retainedReturnPlan', evidence),
134
+ },
135
+ };
136
+ if (hasTiming)
137
+ input.timing = {
138
+ departureAt: freeTimeIso(reuseText(values, 'departureAt')),
139
+ maxTravelSeconds: reuseInteger(values, 'maxTravelSeconds'),
140
+ maxWaitSeconds: reuseInteger(values, 'maxWaitSeconds'),
141
+ siteOpenAt: freeTimeIso(reuseText(values, 'siteOpenAt')),
142
+ siteCloseAt: freeTimeIso(reuseText(values, 'siteCloseAt')),
143
+ maxFullReuseAndReturnSeconds: reuseInteger(values, 'maxFullReuseAndReturnSeconds'),
144
+ plannedReturnFrom: freeTimeIso(reuseText(values, 'plannedReturnFrom')),
145
+ plannedReturnUntil: freeTimeIso(reuseText(values, 'plannedReturnUntil')),
146
+ siteWaitingLocationReference:
147
+ reuseText(values, 'siteWaitingLocationReference') || undefined,
148
+ returnWaitingLocationReference:
149
+ reuseText(values, 'returnWaitingLocationReference') || undefined,
150
+ };
151
+ if (hasBinding) {
152
+ const handoff = reuseInteger(values, 'handoffWaypointIndex');
153
+ const returning = reuseInteger(values, 'returnWaypointIndex');
154
+ if (!waypoints || handoff >= returning || returning >= waypoints.length)
155
+ throw new Error(
156
+ 'Choose ordered handoff then return waypoint indexes within the loaded route.'
157
+ );
158
+ input.routeBinding = { handoffWaypointIndex: handoff, returnWaypointIndex: returning };
159
+ }
160
+ await onSubmit(input);
161
+ } catch (failure) {
162
+ setError(failure instanceof Error ? failure.message : 'Invalid proposal.');
163
+ }
164
+ }}
165
+ >
166
+ <fieldset disabled={busy} className="space-y-5">
167
+ <p className="text-sm">
168
+ {initial
169
+ ? `Revision of ${initial.proposalReference}, selected revision${initial.revision}.`
170
+ : 'New immutable planning draft.'}{' '}
171
+ Current return instruction v{instruction.version}: {instruction.locationReference},{' '}
172
+ {instruction.returnFrom}–{instruction.returnUntil}. New revisions do not inherit
173
+ permission or allocation. Blank source, timing, route binding and qualification remain
174
+ UNKNOWN.
175
+ </p>
176
+ <div className="grid gap-3 md:grid-cols-2">
177
+ <ReuseField
178
+ label="Proposal reference"
179
+ name="proposalReference"
180
+ value={initial?.proposalReference}
181
+ maxLength={120}
182
+ />
183
+ <ReuseField
184
+ label="Exact export booking reference"
185
+ name="exportBookingReference"
186
+ value={initial?.exportBookingReference}
187
+ />
188
+ <ReuseField
189
+ label="Export recipient reference"
190
+ name="exporterReference"
191
+ value={initial?.exporterReference}
192
+ />
193
+ <ReuseField
194
+ label="Handoff location reference"
195
+ name="handoffLocationReference"
196
+ value={initial?.handoffLocationReference}
197
+ />
198
+ <ReuseField
199
+ label="Handoff from (ISO with timezone)"
200
+ name="handoffFrom"
201
+ value={initial?.handoffFrom}
202
+ />
203
+ <ReuseField
204
+ label="Handoff until (ISO with timezone)"
205
+ name="handoffUntil"
206
+ value={initial?.handoffUntil}
207
+ />
208
+ <PinnedSelect
209
+ label="Required equipment"
210
+ value={equipment}
211
+ onChange={(value) => {
212
+ const next = EQUIPMENT_TYPES.find((item) => item === value);
213
+ if (next) setEquipment(next);
214
+ }}
215
+ options={EQUIPMENT_TYPES.map((id) => ({ id, label: id }))}
216
+ />
217
+ <PinnedSelect
218
+ label="Cargo category"
219
+ value={cargo}
220
+ onChange={(value) => {
221
+ const next = categories.find((item) => item === value);
222
+ if (next) setCargo(next);
223
+ }}
224
+ options={categories.map((id) => ({ id, label: id }))}
225
+ />
226
+ </div>
227
+ <section className="space-y-3" aria-label="Actual empty observation">
228
+ <PinnedSelect
229
+ label="Actual empty observation"
230
+ value={eventId}
231
+ onChange={setEventId}
232
+ options={
233
+ events.data?.mtwContainerEventPage.items
234
+ .filter((item) => item.kind === 'ACTUAL' && item.eventType === 'EMPTY_READY')
235
+ .map((item) => ({
236
+ id: item.id,
237
+ label: `${item.occurredAt} — ${item.sourceReference ?? item.source} — ${item.id}`,
238
+ })) ?? []
239
+ }
240
+ />
241
+ <ReuseState {...events} />
242
+ <ReusePager
243
+ page={events.data?.mtwContainerEventPage}
244
+ offset={eventOffset}
245
+ onChange={setEventOffset}
246
+ busy={busy || events.loading}
247
+ />
248
+ <p className="text-sm">
249
+ Planned or estimated events cannot establish actual availability; later events can
250
+ supersede an earlier empty observation.
251
+ </p>
252
+ </section>
253
+ <section className="space-y-3" aria-label="Pinned condition inspection">
254
+ <PinnedSelect
255
+ label="Condition inspection"
256
+ value={inspectionId}
257
+ onChange={setInspectionId}
258
+ options={
259
+ inspections.data?.mtwContainerInspectionPage.items.map((item) => ({
260
+ id: item.id,
261
+ label: `${item.inspectedAt} — ${item.cargoCategory} — ${item.suitability} — inspector ${item.inspectorActorId} — ${item.id}`,
262
+ })) ?? []
263
+ }
264
+ />
265
+ <ReuseState {...inspections} />
266
+ <ReusePager
267
+ page={inspections.data?.mtwContainerInspectionPage}
268
+ offset={inspectionOffset}
269
+ onChange={setInspectionOffset}
270
+ busy={busy || inspections.loading}
271
+ />
272
+ </section>
273
+ <section className="space-y-3" aria-label="Condition examination qualification">
274
+ <PinnedSelect
275
+ label="Condition qualification"
276
+ value={qualificationId}
277
+ onChange={setQualificationId}
278
+ required={false}
279
+ options={
280
+ qualifications.data?.mtwContainerQualificationPage.items.map((item) => ({
281
+ id: item.id,
282
+ label: `${item.issuerName} — ${item.credentialReference} — ${item.status} — subject ${item.subjectActorId} — scopes ${item.scopes.join(', ')} — ${item.validFrom}–${item.validUntil}`,
283
+ })) ?? []
284
+ }
285
+ />
286
+ <ReuseState {...qualifications} />
287
+ <ReusePager
288
+ page={qualifications.data?.mtwContainerQualificationPage}
289
+ offset={qualificationOffset}
290
+ onChange={setQualificationOffset}
291
+ busy={busy || qualifications.loading}
292
+ />
293
+ <p className="text-sm">
294
+ A recorded human review is not software certification. The server checks the exact
295
+ qualification, scope, validity and latest condition.
296
+ </p>
297
+ </section>
298
+ <section className="space-y-3 rounded-lg border p-4" aria-label="Transport route binding">
299
+ <label className="block">
300
+ Same-workspace route ID
301
+ <input
302
+ className="mt-1 w-full rounded border p-2"
303
+ value={routeInput}
304
+ onChange={(event) => setRouteInput(event.target.value)}
305
+ required
306
+ />
307
+ </label>
308
+ <Button
309
+ type="button"
310
+ variant="outline"
311
+ disabled={!routeInput.trim() || route.loading}
312
+ onClick={() => {
313
+ setRouteId(routeInput.trim());
314
+ setRouteRevision((value) => value + 1);
315
+ }}
316
+ >
317
+ Load route revision
318
+ </Button>
319
+ <ReuseState {...route} />
320
+ {routeRecord && (
321
+ <>
322
+ <p>
323
+ {routeRecord.name} — {routeRecord.status}. Pinned updatedAt: {routeRecord.updatedAt}
324
+ </p>
325
+ <p className="text-sm">
326
+ Ordered waypoint indexes start at0. Complete route content is fingerprinted by the
327
+ server.
328
+ </p>
329
+ {waypoints ? (
330
+ <>
331
+ <pre className="max-h-48 overflow-auto whitespace-pre-wrap break-all text-xs">
332
+ {JSON.stringify(waypoints.slice(0, 50), null, 2)}
333
+ </pre>
334
+ {waypoints.length > 50 && (
335
+ <p>
336
+ Preview shows first50 of {waypoints.length} waypoints; confirm selected
337
+ indexes in the source route.
338
+ </p>
339
+ )}
340
+ </>
341
+ ) : (
342
+ <p>Route waypoints unavailable; binding remains unresolved.</p>
343
+ )}
344
+ </>
345
+ )}
346
+ <label className="block">
347
+ <input
348
+ type="checkbox"
349
+ checked={hasBinding}
350
+ onChange={(event) => setHasBinding(event.target.checked)}
351
+ />{' '}
352
+ Pin ordered handoff and return waypoints (otherwise UNKNOWN)
353
+ </label>
354
+ {hasBinding && (
355
+ <div className="grid gap-3 md:grid-cols-2">
356
+ <ReuseField
357
+ label="Handoff waypoint index"
358
+ name="handoffWaypointIndex"
359
+ type="number"
360
+ value={String(initial?.assessment.routeBinding?.handoffWaypointIndex ?? '')}
361
+ />
362
+ <ReuseField
363
+ label="Return waypoint index"
364
+ name="returnWaypointIndex"
365
+ type="number"
366
+ value={String(initial?.assessment.routeBinding?.returnWaypointIndex ?? '')}
367
+ />
368
+ </div>
369
+ )}
370
+ </section>
371
+ <section className="space-y-3 rounded-lg border p-4" aria-label="Reuse and return timing">
372
+ <label>
373
+ <input
374
+ type="checkbox"
375
+ checked={hasTiming}
376
+ onChange={(event) => setHasTiming(event.target.checked)}
377
+ />{' '}
378
+ Record bounded full-leg timing (otherwise UNKNOWN)
379
+ </label>
380
+ <p className="text-sm">
381
+ The full bound starts at departure and includes travel, loading/unloading, every
382
+ post-arrival wait and the return leg. Pre-arrival en-route delay is a separate arrival
383
+ bound. Site or return waiting needs the corresponding sourced location.
384
+ </p>
385
+ {hasTiming && (
386
+ <div className="grid gap-3 md:grid-cols-2">
387
+ <ReuseField
388
+ label="Departure (ISO with timezone)"
389
+ name="departureAt"
390
+ value={timing?.departureAt}
391
+ />
392
+ <ReuseField
393
+ label="Maximum travel seconds"
394
+ name="maxTravelSeconds"
395
+ type="number"
396
+ value={String(timing?.maxTravelSeconds ?? '')}
397
+ />
398
+ <ReuseField
399
+ label="Maximum en-route delay/wait before arrival (seconds)"
400
+ name="maxWaitSeconds"
401
+ type="number"
402
+ value={String(timing?.maxWaitSeconds ?? '')}
403
+ />
404
+ <ReuseField
405
+ label="Site opens (ISO with timezone)"
406
+ name="siteOpenAt"
407
+ value={timing?.siteOpenAt}
408
+ />
409
+ <ReuseField
410
+ label="Site closes (ISO with timezone)"
411
+ name="siteCloseAt"
412
+ value={timing?.siteCloseAt}
413
+ />
414
+ <ReuseField
415
+ label="Maximum full departure-to-return duration (seconds)"
416
+ name="maxFullReuseAndReturnSeconds"
417
+ type="number"
418
+ value={String(timing?.maxFullReuseAndReturnSeconds ?? '')}
419
+ />
420
+ <ReuseField
421
+ label="Site waiting location reference"
422
+ name="siteWaitingLocationReference"
423
+ required={false}
424
+ value={timing?.siteWaitingLocationReference ?? ''}
425
+ />
426
+ <ReuseField
427
+ label="Return waiting location reference"
428
+ name="returnWaitingLocationReference"
429
+ required={false}
430
+ value={timing?.returnWaitingLocationReference ?? ''}
431
+ />
432
+ <ReuseField
433
+ label="Planned return from (ISO with timezone)"
434
+ name="plannedReturnFrom"
435
+ value={timing?.plannedReturnFrom}
436
+ />
437
+ <ReuseField
438
+ label="Planned return until (ISO with timezone)"
439
+ name="plannedReturnUntil"
440
+ value={timing?.plannedReturnUntil}
441
+ />
442
+ </div>
443
+ )}
444
+ <p className="text-sm">
445
+ Covers travel, site waiting, reuse work and return; waiting locations need
446
+ purpose-specific road-access evidence. Does not calculate or stop commercial clocks.
447
+ </p>
448
+ </section>
449
+ <ContainerEvidencePicker value={evidence} onChange={setEvidence} />
450
+ <ReuseSourceFields
451
+ name="booking"
452
+ label="Export booking"
453
+ evidence={evidence}
454
+ initial={initial?.assessment.sources.booking}
455
+ />
456
+ <ReuseSourceFields
457
+ name="roadAccess"
458
+ label="Road and site access"
459
+ evidence={evidence}
460
+ initial={initial?.assessment.sources.roadAccess}
461
+ />
462
+ <ReuseSourceFields
463
+ name="conditionSuitability"
464
+ label="Condition and cargo suitability"
465
+ evidence={evidence}
466
+ initial={initial?.assessment.sources.conditionSuitability}
467
+ />
468
+ <ReuseSourceFields
469
+ name="retainedReturnPlan"
470
+ label="Retained return obligation"
471
+ evidence={evidence}
472
+ initial={initial?.assessment.sources.retainedReturnPlan}
473
+ />
474
+ {error && <p role="alert">{error}</p>}
475
+ <Button
476
+ type="submit"
477
+ disabled={busy || route.loading || !routeRecord || routeInput.trim() !== routeId}
478
+ >
479
+ Record planning revision
480
+ </Button>
481
+ </fieldset>
482
+ </form>
483
+ );
484
+ }
@@ -0,0 +1,80 @@
1
+ import { useState } from 'react';
2
+ import type { ReuseSourceFieldsFragment } from '../../generated/empty-reuse-operations';
3
+ import type { SelectedEvidence } from './ContainerEvidencePicker';
4
+ import { ReuseField } from './ReuseControls';
5
+ export function ReuseSourceFields({
6
+ name,
7
+ label,
8
+ evidence,
9
+ initial,
10
+ }: {
11
+ name: string;
12
+ label: string;
13
+ evidence: SelectedEvidence[];
14
+ initial?: ReuseSourceFieldsFragment | null;
15
+ }) {
16
+ const [recorded, setRecorded] = useState(!!initial);
17
+ return (
18
+ <fieldset className="space-y-3 rounded-lg border p-4">
19
+ <legend>{label} source</legend>
20
+ <label>
21
+ <select
22
+ name={`${name}.recorded`}
23
+ value={recorded ? 'yes' : ''}
24
+ onChange={(event) => setRecorded(event.target.value === 'yes')}
25
+ >
26
+ <option value="">UNKNOWN: no purpose-specific source</option>
27
+ <option value="yes">Record source attestation for this purpose</option>
28
+ </select>
29
+ </label>
30
+ {recorded && (
31
+ <>
32
+ <p className="text-sm">
33
+ Binding is limited to this exact proposal and source purpose. Recording a source is not
34
+ external approval or certification.
35
+ </p>
36
+ <div className="grid gap-3 md:grid-cols-2">
37
+ <ReuseField
38
+ label={`${label} source reference`}
39
+ name={`${name}.reference`}
40
+ value={initial?.sourceReference}
41
+ />
42
+ <ReuseField
43
+ label={`${label} source revision`}
44
+ name={`${name}.revision`}
45
+ value={initial?.sourceRevision}
46
+ />
47
+ <ReuseField
48
+ label={`${label} observed at (ISO with timezone)`}
49
+ name={`${name}.observed`}
50
+ value={initial?.observedAt}
51
+ />
52
+ <ReuseField
53
+ label={`${label} valid from (ISO with timezone)`}
54
+ name={`${name}.from`}
55
+ value={initial?.validFrom}
56
+ />
57
+ <ReuseField
58
+ label={`${label} valid until (ISO with timezone)`}
59
+ name={`${name}.until`}
60
+ value={initial?.validUntil}
61
+ />
62
+ </div>
63
+ <p>Select exact versions from this proposal’s evidence for this purpose.</p>
64
+ {!evidence.length && <p>No proposal evidence selected.</p>}
65
+ {evidence.map((item) => (
66
+ <label key={item.versionId} className="block text-sm">
67
+ <input
68
+ type="checkbox"
69
+ name={`${name}.evidence`}
70
+ value={item.versionId}
71
+ defaultChecked={initial?.evidence.some((row) => row.versionId === item.versionId)}
72
+ />{' '}
73
+ {item.label}
74
+ </label>
75
+ ))}
76
+ </>
77
+ )}
78
+ </fieldset>
79
+ );
80
+ }