@burdenoff/microfe-movethewheels 2026.930.4 → 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 (377) 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/useInventory.js +12 -1
  68. package/dist/hooks/useProcedureAction.js +119 -0
  69. package/dist/hooks/useProcedureSelection.js +53 -0
  70. package/dist/hooks/useReuseRecoveryAction.js +116 -0
  71. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +10 -0
  72. package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +14 -0
  73. package/dist/movethewheels/components/ReturnInstructionForm.d.ts +8 -0
  74. package/dist/movethewheels/components/ReuseControls.d.ts +42 -0
  75. package/dist/movethewheels/components/ReusePermissionForm.d.ts +9 -0
  76. package/dist/movethewheels/components/ReuseProposalForm.d.ts +11 -0
  77. package/dist/movethewheels/components/ReuseSourceFields.d.ts +9 -0
  78. package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +13 -0
  79. package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +6 -0
  80. package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +8 -0
  81. package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +8 -0
  82. package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +5 -0
  83. package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +9 -0
  84. package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +7 -0
  85. package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +6 -0
  86. package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +8 -0
  87. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +8 -0
  88. package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +23 -0
  89. package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +6 -0
  90. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +5 -0
  91. package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +8 -0
  92. package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +6 -0
  93. package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +6 -0
  94. package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +20 -0
  95. package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +17 -0
  96. package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +7 -0
  97. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +10 -0
  98. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +5 -0
  99. package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +5 -0
  100. package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +6 -0
  101. package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +7 -0
  102. package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +16 -0
  103. package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +5 -0
  104. package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +6 -0
  105. package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +17 -0
  106. package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +13 -0
  107. package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +18 -0
  108. package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +9 -0
  109. package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +6 -0
  110. package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +7 -0
  111. package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +7 -0
  112. package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +5 -0
  113. package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +6 -0
  114. package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +14 -0
  115. package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +5 -0
  116. package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +9 -0
  117. package/dist/movethewheels/hooks/useConsolidationAction.d.ts +19 -0
  118. package/dist/movethewheels/hooks/useContainerCondition.d.ts +21 -0
  119. package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +40 -0
  120. package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +14 -0
  121. package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +23 -0
  122. package/dist/movethewheels/hooks/useProcedureAction.d.ts +18 -0
  123. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +51 -0
  124. package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +18 -0
  125. package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -0
  126. package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -0
  127. package/dist/movethewheels/pages/ContainersPage.d.ts +2 -0
  128. package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -0
  129. package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -0
  130. package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -0
  131. package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -0
  132. package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -0
  133. package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -0
  134. package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -0
  135. package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -0
  136. package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +12 -0
  137. package/dist/movethewheels/utils/consolidationInput.d.ts +15 -0
  138. package/dist/movethewheels/utils/consolidationLot.d.ts +3 -0
  139. package/dist/movethewheels/utils/consolidationPins.d.ts +20 -0
  140. package/dist/movethewheels/utils/consolidationRecovery.d.ts +5 -0
  141. package/dist/movethewheels/utils/consolidationReportHead.d.ts +5 -0
  142. package/dist/movethewheels/utils/freeTimeDate.d.ts +1 -0
  143. package/dist/movethewheels/utils/freightAcknowledgement.d.ts +2 -0
  144. package/dist/movethewheels/utils/freightDraft.d.ts +36 -0
  145. package/dist/movethewheels/utils/freightRecovery.d.ts +5 -0
  146. package/dist/movethewheels/utils/graphqlClient.d.ts +2 -1
  147. package/dist/movethewheels/utils/pendingPickDraft.d.ts +8 -0
  148. package/dist/movethewheels/utils/procedureInput.d.ts +18 -0
  149. package/dist/movethewheels/utils/procedureRecovery.d.ts +5 -0
  150. package/dist/movethewheels/utils/reuseAttempt.d.ts +7 -0
  151. package/dist/movethewheels/utils/reuseForm.d.ts +6 -0
  152. package/dist/movethewheels/utils/reuseRecovery.d.ts +26 -0
  153. package/dist/movethewheels/utils/stockBindingForm.d.ts +23 -0
  154. package/dist/movethewheels/utils/stockBindingLabels.d.ts +10 -0
  155. package/dist/movethewheels/utils/stockObservationForm.d.ts +5 -0
  156. package/dist/movethewheels/utils/tripDraftContext.d.ts +25 -0
  157. package/dist/movethewheels/utils/tripUtilizationForm.d.ts +6 -0
  158. package/dist/node_modules/@react-leaflet/core/lib/component.js +5 -5
  159. package/dist/node_modules/fast-equals/dist/es/index.js +87 -74
  160. package/dist/node_modules/leaflet/dist/leaflet-src.js +8 -5
  161. package/dist/node_modules/lodash/_Stack.js +2 -1
  162. package/dist/node_modules/lucide-react/dist/esm/icons/clipboard-list.js +35 -0
  163. package/dist/node_modules/lucide-react/dist/esm/icons/repeat-2.js +22 -0
  164. package/dist/node_modules/react-leaflet/lib/MapContainer.js +3 -3
  165. package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
  166. package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
  167. package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
  168. package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
  169. package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
  170. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +13 -13
  171. package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
  172. package/dist/node_modules/recharts/es6/cartesian/Line.js +10 -10
  173. package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
  174. package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
  175. package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
  176. package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
  177. package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
  178. package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
  179. package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
  180. package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
  181. package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
  182. package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
  183. package/dist/node_modules/recharts/es6/component/Label.js +14 -14
  184. package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
  185. package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
  186. package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
  187. package/dist/node_modules/recharts/es6/component/Text.js +2 -2
  188. package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
  189. package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
  190. package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
  191. package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
  192. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
  193. package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
  194. package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
  195. package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
  196. package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
  197. package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
  198. package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
  199. package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
  200. package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
  201. package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
  202. package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
  203. package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
  204. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
  205. package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
  206. package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
  207. package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
  208. package/dist/node_modules/recharts/es6/util/ReactUtils.js +2 -2
  209. package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
  210. package/dist/node_modules/recharts/es6/util/types.js +1 -1
  211. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.development.js +2 -2
  212. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.production.min.js +2 -2
  213. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/index.js +2 -2
  214. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +97 -18
  215. package/dist/node_modules/zustand/esm/middleware.js +2 -2
  216. package/dist/pages/ConsolidationPage.js +76 -0
  217. package/dist/pages/ContainerConditionPage.js +972 -0
  218. package/dist/pages/ContainersPage.js +522 -0
  219. package/dist/pages/EmptyReusePage.js +777 -0
  220. package/dist/pages/FreeTimePage.js +657 -0
  221. package/dist/pages/FreightEstimatePage.js +284 -0
  222. package/dist/pages/InventoryPage.js +77 -73
  223. package/dist/pages/LogisticsProceduresPage.js +100 -0
  224. package/dist/pages/PendingPickPage.js +155 -0
  225. package/dist/pages/StockBindingPage.js +236 -0
  226. package/dist/pages/StockObservationsPage.js +168 -0
  227. package/dist/pages/TripUtilizationPage.js +227 -0
  228. package/dist/src/generated/consolidation-operations.js +505 -0
  229. package/dist/src/generated/container-condition-operations.js +208 -0
  230. package/dist/src/generated/container-operations.js +101 -0
  231. package/dist/src/generated/empty-reuse-operations.js +749 -0
  232. package/dist/src/generated/free-time-operations.js +235 -0
  233. package/dist/src/generated/freight-cost-operations.js +325 -0
  234. package/dist/src/generated/logistics-procedure-operations.js +362 -0
  235. package/dist/src/generated/pending-pick-operations.js +1128 -0
  236. package/dist/src/generated/stock-binding-operations.js +175 -0
  237. package/dist/src/generated/stock-observation-operations.js +93 -0
  238. package/dist/src/generated/trip-utilization-operations.js +140 -0
  239. package/dist/src/generated/wspace-operations.js +708 -0
  240. package/dist/utils/consolidationHistoryTarget.js +27 -0
  241. package/dist/utils/consolidationInput.js +21 -0
  242. package/dist/utils/consolidationLot.js +29 -0
  243. package/dist/utils/consolidationPins.js +13 -0
  244. package/dist/utils/consolidationRecovery.js +40 -0
  245. package/dist/utils/consolidationReportHead.js +18 -0
  246. package/dist/utils/freeTimeDate.js +26 -0
  247. package/dist/utils/freightAcknowledgement.js +8 -0
  248. package/dist/utils/freightDraft.js +125 -0
  249. package/dist/utils/freightRecovery.js +36 -0
  250. package/dist/utils/graphqlClient.js +28 -28
  251. package/dist/utils/pendingPickDraft.js +46 -0
  252. package/dist/utils/procedureInput.js +43 -0
  253. package/dist/utils/procedureRecovery.js +42 -0
  254. package/dist/utils/reuseAttempt.js +20 -0
  255. package/dist/utils/reuseForm.js +25 -0
  256. package/dist/utils/reuseRecovery.js +71 -0
  257. package/dist/utils/stockBindingForm.js +142 -0
  258. package/dist/utils/stockBindingLabels.js +23 -0
  259. package/dist/utils/stockObservationForm.js +55 -0
  260. package/dist/utils/tripDraftContext.js +19 -0
  261. package/dist/utils/tripUtilizationForm.js +60 -0
  262. package/package.json +19 -5
  263. package/src/generated/consolidation-operations.ts +1138 -0
  264. package/src/generated/container-condition-operations.ts +771 -0
  265. package/src/generated/container-operations.ts +376 -0
  266. package/src/generated/empty-reuse-operations.ts +1648 -0
  267. package/src/generated/free-time-operations.ts +814 -0
  268. package/src/generated/freight-cost-operations.ts +753 -0
  269. package/src/generated/logistics-procedure-operations.ts +1047 -0
  270. package/src/generated/pending-pick-operations.ts +1508 -0
  271. package/src/generated/stock-binding-operations.ts +631 -0
  272. package/src/generated/stock-observation-operations.ts +373 -0
  273. package/src/generated/trip-utilization-operations.ts +500 -0
  274. package/src/generated/wspace-operations.ts +116 -0
  275. package/src/movethewheels/MoveTheWheelsRoot.tsx +79 -0
  276. package/src/movethewheels/MoveTheWheelsRoutes.tsx +22 -0
  277. package/src/movethewheels/components/ContainerEvidencePicker.tsx +146 -0
  278. package/src/movethewheels/components/FreeTimeAgreementForm.tsx +483 -0
  279. package/src/movethewheels/components/ReturnInstructionForm.tsx +102 -0
  280. package/src/movethewheels/components/ReuseControls.tsx +138 -0
  281. package/src/movethewheels/components/ReusePermissionForm.tsx +123 -0
  282. package/src/movethewheels/components/ReuseProposalForm.tsx +484 -0
  283. package/src/movethewheels/components/ReuseSourceFields.tsx +80 -0
  284. package/src/movethewheels/components/consolidation/ConsolidationHistory.tsx +159 -0
  285. package/src/movethewheels/components/consolidation/ConsolidationLotEditor.tsx +144 -0
  286. package/src/movethewheels/components/consolidation/ConsolidationManifestWorkbench.tsx +168 -0
  287. package/src/movethewheels/components/consolidation/ConsolidationPlanForm.tsx +185 -0
  288. package/src/movethewheels/components/consolidation/ConsolidationPlanWorkbench.tsx +395 -0
  289. package/src/movethewheels/components/consolidation/ConsolidationReportForm.tsx +124 -0
  290. package/src/movethewheels/components/consolidation/ConsolidationReportsWorkbench.tsx +233 -0
  291. package/src/movethewheels/components/consolidation/ConsolidationSummary.tsx +84 -0
  292. package/src/movethewheels/components/consolidation/OriginalConsolidationHistory.tsx +133 -0
  293. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +224 -0
  294. package/src/movethewheels/components/freight-cost/FreightFields.tsx +91 -0
  295. package/src/movethewheels/components/freight-cost/FreightFxEditor.tsx +98 -0
  296. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +91 -0
  297. package/src/movethewheels/components/freight-cost/FreightLineEditor.tsx +192 -0
  298. package/src/movethewheels/components/freight-cost/FreightScopeEditor.tsx +64 -0
  299. package/src/movethewheels/components/freight-cost/FreightTotals.tsx +68 -0
  300. package/src/movethewheels/components/logistics-procedure/ProcedureDecisionForm.tsx +204 -0
  301. package/src/movethewheels/components/logistics-procedure/ProcedureFields.tsx +43 -0
  302. package/src/movethewheels/components/logistics-procedure/ProcedureHistory.tsx +102 -0
  303. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyForm.tsx +226 -0
  304. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.tsx +174 -0
  305. package/src/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.tsx +278 -0
  306. package/src/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.tsx +292 -0
  307. package/src/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.tsx +111 -0
  308. package/src/movethewheels/components/pending-pick/PendingPickDraft.tsx +82 -0
  309. package/src/movethewheels/components/pending-pick/PendingPickHistory.tsx +93 -0
  310. package/src/movethewheels/components/pending-pick/PickCapture.tsx +70 -0
  311. package/src/movethewheels/components/pending-pick/PickLineSelection.tsx +130 -0
  312. package/src/movethewheels/components/stock-binding/StockAssessmentDraft.tsx +52 -0
  313. package/src/movethewheels/components/stock-binding/StockAssessmentHistory.tsx +56 -0
  314. package/src/movethewheels/components/stock-binding/StockAssessmentSummary.tsx +108 -0
  315. package/src/movethewheels/components/stock-binding/StockFactForm.tsx +186 -0
  316. package/src/movethewheels/components/stock-observation/StockIssueForm.tsx +103 -0
  317. package/src/movethewheels/components/stock-observation/StockIssueHistory.tsx +96 -0
  318. package/src/movethewheels/components/stock-observation/StockIssueReadPanel.tsx +72 -0
  319. package/src/movethewheels/components/trip-utilization/TripReportForm.tsx +116 -0
  320. package/src/movethewheels/components/trip-utilization/TripReportHistory.tsx +51 -0
  321. package/src/movethewheels/components/trip-utilization/TripReportSummary.tsx +127 -0
  322. package/src/movethewheels/components/trip-utilization/TripSegmentFields.tsx +118 -0
  323. package/src/movethewheels/hooks/useConsolidationAction.ts +196 -0
  324. package/src/movethewheels/hooks/useContainerCondition.ts +129 -0
  325. package/src/movethewheels/hooks/useContainerLifecycle.ts +291 -0
  326. package/src/movethewheels/hooks/useEmptyReuseAction.ts +72 -0
  327. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +201 -0
  328. package/src/movethewheels/hooks/useInventory.ts +2 -20
  329. package/src/movethewheels/hooks/useProcedureAction.ts +196 -0
  330. package/src/movethewheels/hooks/useProcedureSelection.ts +75 -0
  331. package/src/movethewheels/hooks/useReuseRecoveryAction.ts +192 -0
  332. package/src/movethewheels/pages/ConsolidationPage.tsx +70 -0
  333. package/src/movethewheels/pages/ContainerConditionPage.tsx +959 -0
  334. package/src/movethewheels/pages/ContainersPage.tsx +490 -0
  335. package/src/movethewheels/pages/EmptyReusePage.tsx +823 -0
  336. package/src/movethewheels/pages/FreeTimePage.tsx +720 -0
  337. package/src/movethewheels/pages/FreightEstimatePage.tsx +353 -0
  338. package/src/movethewheels/pages/InventoryPage.tsx +16 -2
  339. package/src/movethewheels/pages/LogisticsProceduresPage.tsx +86 -0
  340. package/src/movethewheels/pages/PendingPickPage.tsx +226 -0
  341. package/src/movethewheels/pages/StockBindingPage.tsx +299 -0
  342. package/src/movethewheels/pages/StockObservationsPage.tsx +181 -0
  343. package/src/movethewheels/pages/TripUtilizationPage.tsx +315 -0
  344. package/src/movethewheels/utils/consolidationHistoryTarget.ts +39 -0
  345. package/src/movethewheels/utils/consolidationInput.ts +70 -0
  346. package/src/movethewheels/utils/consolidationLot.ts +24 -0
  347. package/src/movethewheels/utils/consolidationPins.ts +52 -0
  348. package/src/movethewheels/utils/consolidationRecovery.ts +88 -0
  349. package/src/movethewheels/utils/consolidationReportHead.ts +29 -0
  350. package/src/movethewheels/utils/freeTimeDate.ts +31 -0
  351. package/src/movethewheels/utils/freightAcknowledgement.ts +31 -0
  352. package/src/movethewheels/utils/freightDraft.ts +170 -0
  353. package/src/movethewheels/utils/freightRecovery.ts +79 -0
  354. package/src/movethewheels/utils/graphqlClient.ts +14 -5
  355. package/src/movethewheels/utils/pendingPickDraft.ts +61 -0
  356. package/src/movethewheels/utils/procedureInput.ts +98 -0
  357. package/src/movethewheels/utils/procedureRecovery.ts +92 -0
  358. package/src/movethewheels/utils/reuseAttempt.ts +29 -0
  359. package/src/movethewheels/utils/reuseForm.ts +30 -0
  360. package/src/movethewheels/utils/reuseRecovery.ts +151 -0
  361. package/src/movethewheels/utils/stockBindingForm.ts +209 -0
  362. package/src/movethewheels/utils/stockBindingLabels.ts +41 -0
  363. package/src/movethewheels/utils/stockObservationForm.ts +73 -0
  364. package/src/movethewheels/utils/tripDraftContext.ts +61 -0
  365. package/src/movethewheels/utils/tripUtilizationForm.ts +105 -0
  366. package/src/operations/condition/container-condition.graphql +41 -0
  367. package/src/operations/consolidation/consolidation.graphql +490 -0
  368. package/src/operations/container/container-lifecycle.graphql +80 -0
  369. package/src/operations/empty-reuse/empty-reuse.graphql +737 -0
  370. package/src/operations/free-time/free-time.graphql +47 -0
  371. package/src/operations/freight-cost/freight.graphql +6 -0
  372. package/src/operations/logistics-procedure/procedure.graphql +15 -0
  373. package/src/operations/pending-pick/pending-pick.graphql +1122 -0
  374. package/src/operations/stock-binding/stock-binding.graphql +160 -0
  375. package/src/operations/stock-observation/stock-observation.graphql +20 -0
  376. package/src/operations/trip-utilization/trip-utilization.graphql +126 -0
  377. package/src/operations/wspace/container-evidence.graphql +6 -0
@@ -0,0 +1,130 @@
1
+ import { useState } from 'react';
2
+ import type { PickInventoryQuery } from '../../../generated/pending-pick-operations';
3
+ import { Button, Input } from '../ui';
4
+ import { PinnedSelect, ReusePager, ReuseState, reuseCard } from '../ReuseControls';
5
+ export function PickLineSelection({
6
+ inventory,
7
+ sourceId,
8
+ destinationId,
9
+ locked,
10
+ offset,
11
+ onOffset,
12
+ onSelect,
13
+ onRefresh,
14
+ refreshBusy,
15
+ }: {
16
+ inventory: { data: PickInventoryQuery | null; loading: boolean; error: string | null };
17
+ sourceId: string;
18
+ destinationId: string;
19
+ locked: boolean;
20
+ offset: number;
21
+ onOffset: (value: number) => void;
22
+ onSelect: (side: 'source' | 'destination', id: string) => void;
23
+ onRefresh: () => void;
24
+ refreshBusy: boolean;
25
+ }) {
26
+ const [knownSource, setKnownSource] = useState(''),
27
+ [knownDestination, setKnownDestination] = useState('');
28
+ const rows = inventory.data?.inventoryItems ?? [];
29
+ const source = rows.find((row) => row.id === sourceId);
30
+ const label = (row: (typeof rows)[number]) =>
31
+ `${row.cargoItem?.name ?? 'Unknown cargo'} · ${row.cargoItem?.sku ?? 'Unknown SKU'} · ${row.warehouse?.name ?? 'Unknown warehouse'} · ${row.location?.locationCode ?? 'No bin'} · line ${row.id}`;
32
+ const sourceOptions = rows
33
+ .filter((row) => row.locationId != null)
34
+ .map((row) => ({ id: row.id, label: label(row) }));
35
+ const destinationOptions = rows
36
+ .filter(
37
+ (row) =>
38
+ row.id !== sourceId &&
39
+ row.locationId != null &&
40
+ (!source ||
41
+ (row.cargoItemId === source.cargoItemId &&
42
+ row.warehouseId === source.warehouseId &&
43
+ row.locationId !== source.locationId))
44
+ )
45
+ .map((row) => ({ id: row.id, label: label(row) }));
46
+ if (sourceId && !sourceOptions.some((row) => row.id === sourceId))
47
+ sourceOptions.unshift({ id: sourceId, label: `Known source line ${sourceId}` });
48
+ if (destinationId && !destinationOptions.some((row) => row.id === destinationId))
49
+ destinationOptions.unshift({ id: destinationId, label: `Known staging line ${destinationId}` });
50
+ const page = inventory.data
51
+ ? {
52
+ total: inventory.data.inventoryItemsCount,
53
+ limit: 25,
54
+ offset,
55
+ hasMore: offset + rows.length < inventory.data.inventoryItemsCount,
56
+ nextOffset: offset + 25,
57
+ }
58
+ : undefined;
59
+ return (
60
+ <section className={reuseCard}>
61
+ <p>
62
+ This records a plan needing review. It does not reserve stock, authorize handling, or record
63
+ movement.
64
+ </p>
65
+ <ReuseState loading={inventory.loading} error={inventory.error} />
66
+ <PinnedSelect
67
+ label="Source inventory line"
68
+ value={sourceId}
69
+ options={sourceOptions}
70
+ disabled={locked}
71
+ onChange={(id) => onSelect('source', id)}
72
+ />
73
+ <PinnedSelect
74
+ label="Staging inventory line"
75
+ value={destinationId}
76
+ options={destinationOptions}
77
+ disabled={locked || !sourceId}
78
+ onChange={(id) => onSelect('destination', id)}
79
+ />
80
+ <div className="grid gap-3 sm:grid-cols-2">
81
+ <label>
82
+ Known source line ID
83
+ <Input
84
+ value={knownSource}
85
+ maxLength={255}
86
+ disabled={locked}
87
+ onChange={(e) => setKnownSource(e.target.value)}
88
+ />
89
+ <Button
90
+ type="button"
91
+ variant="outline"
92
+ disabled={locked || !knownSource.trim()}
93
+ onClick={() => onSelect('source', knownSource.trim())}
94
+ >
95
+ Choose exact source
96
+ </Button>
97
+ </label>
98
+ <label>
99
+ Known staging line ID
100
+ <Input
101
+ value={knownDestination}
102
+ maxLength={255}
103
+ disabled={locked || !sourceId}
104
+ onChange={(e) => setKnownDestination(e.target.value)}
105
+ />
106
+ <Button
107
+ type="button"
108
+ variant="outline"
109
+ disabled={locked || !sourceId || !knownDestination.trim()}
110
+ onClick={() => onSelect('destination', knownDestination.trim())}
111
+ >
112
+ Choose exact staging line
113
+ </Button>
114
+ </label>
115
+ </div>
116
+ <p className="break-all text-sm">
117
+ Selected source {sourceId || 'None'}; staging {destinationId || 'None'}.
118
+ </p>
119
+ <ReusePager
120
+ page={page}
121
+ offset={offset}
122
+ onChange={onOffset}
123
+ busy={locked || inventory.loading}
124
+ />
125
+ <Button type="button" variant="outline" disabled={refreshBusy} onClick={onRefresh}>
126
+ Refresh current context and history
127
+ </Button>
128
+ </section>
129
+ );
130
+ }
@@ -0,0 +1,52 @@
1
+ import type { StockDraftPin, StockFactDraft } from '../../utils/stockBindingForm';
2
+ import { reuseCard } from '../ReuseControls';
3
+ import { Button } from '../ui';
4
+ import { StockFactForm } from './StockFactForm';
5
+ export function StockAssessmentDraft({
6
+ pin,
7
+ mismatch,
8
+ uncertain,
9
+ startDisabled,
10
+ formDisabled,
11
+ onStart,
12
+ onSubmit,
13
+ }: {
14
+ pin: (StockDraftPin & { generation: string }) | null;
15
+ mismatch: boolean;
16
+ uncertain: boolean;
17
+ startDisabled: boolean;
18
+ formDisabled: boolean;
19
+ onStart: () => void;
20
+ onSubmit: (draft: StockFactDraft) => Promise<void>;
21
+ }) {
22
+ return (
23
+ <section className={reuseCard} aria-label="Record declared source facts">
24
+ <h2 className="text-lg font-semibold">Review and record reported facts</h2>
25
+ <p className="text-sm">
26
+ Review this stock line before entering facts. If it or its recorded history changes, start a
27
+ new draft.
28
+ </p>
29
+ {pin && (
30
+ <p>
31
+ Reviewed stock line: {pin.label}; after recorded version {pin.expectedVersion}. Continuity
32
+ revision: {pin.expectedCompositionEpoch}.
33
+ </p>
34
+ )}
35
+ {mismatch && (
36
+ <p role="alert">
37
+ This stock line or its recorded history changed. Refresh and review a new draft. Unsaved
38
+ fields are cleared; the original uncertain request is kept for retry.
39
+ </p>
40
+ )}
41
+ {uncertain && (
42
+ <p>Check history and retry or discard the uncertain request before starting a new draft.</p>
43
+ )}
44
+ <Button type="button" variant="outline" disabled={startDisabled} onClick={onStart}>
45
+ Review stock line and start a draft
46
+ </Button>
47
+ {pin && !mismatch && (
48
+ <StockFactForm key={pin.generation} busy={formDisabled} onSubmit={onSubmit} />
49
+ )}
50
+ </section>
51
+ );
52
+ }
@@ -0,0 +1,56 @@
1
+ import type {
2
+ StockAssessmentFragment,
3
+ StockBindingHistoryQuery,
4
+ } from '../../../generated/stock-binding-operations';
5
+ import { ReuseState, ReusePager, reuseCard } from '../ReuseControls';
6
+ import { Button } from '../ui';
7
+ import { StockAssessmentSummary } from './StockAssessmentSummary';
8
+ import { stockCompletenessLabel } from '../../utils/stockBindingLabels';
9
+ export function StockAssessmentHistory({
10
+ query,
11
+ current,
12
+ selected,
13
+ onSelect,
14
+ offset,
15
+ onPage,
16
+ busy,
17
+ }: {
18
+ query: { data: StockBindingHistoryQuery | null; loading: boolean; error: string | null };
19
+ current?: { id: string; compositionEpoch: number } | null;
20
+ selected: StockAssessmentFragment | null;
21
+ onSelect: (value: StockAssessmentFragment) => void;
22
+ offset: number;
23
+ onPage: (offset: number) => void;
24
+ busy: boolean;
25
+ }) {
26
+ const page = query.data?.mtwStockBindingAssessmentPage;
27
+ return (
28
+ <section className={reuseCard} aria-label="Immutable source assessment history">
29
+ <h2 className="text-lg font-semibold">Recorded assessment history</h2>
30
+ <p>History follows recorded order, including future effective dates.</p>
31
+ <ReuseState {...query} />
32
+ {page?.items.length === 0 && <p>No assessments recorded for this inventory line.</p>}
33
+ {page?.items.map((item) => (
34
+ <div key={item.id} className="flex flex-wrap items-center gap-3 rounded border p-3">
35
+ <p>
36
+ Version {item.version}; effective {item.effectiveAt}; recorded {item.recordedAt};{' '}
37
+ {stockCompletenessLabel(item.completeness.status)}. Continuity revision{' '}
38
+ {item.capturedCompositionEpoch ?? 'not recorded'}.
39
+ </p>
40
+ <Button type="button" variant="outline" disabled={busy} onClick={() => onSelect(item)}>
41
+ Inspect recorded version
42
+ </Button>
43
+ </div>
44
+ ))}
45
+ <ReusePager page={page} offset={offset} onChange={onPage} busy={busy || query.loading} />
46
+ {selected && (
47
+ <>
48
+ <p className="text-sm">
49
+ The selected recorded version stays available as you browse history.
50
+ </p>
51
+ <StockAssessmentSummary assessment={selected} current={current} />
52
+ </>
53
+ )}
54
+ </section>
55
+ );
56
+ }
@@ -0,0 +1,108 @@
1
+ import type { StockAssessmentFragment } from '../../../generated/stock-binding-operations';
2
+ import {
3
+ stockContinuityLabel,
4
+ stockCompletenessLabel,
5
+ stockFactLabel,
6
+ stockMissingFactLabel,
7
+ } from '../../utils/stockBindingLabels';
8
+ export function StockAssessmentSummary({
9
+ assessment,
10
+ current,
11
+ }: {
12
+ assessment: StockAssessmentFragment;
13
+ current?: { id: string; compositionEpoch: number } | null;
14
+ }) {
15
+ const { facts, criticalOwnerSnapshot: owner, capturedStockQuantityAudit: quantity } = assessment;
16
+ const known = (value: string | number | null | undefined) => value ?? 'Unknown';
17
+ return (
18
+ <article className="space-y-3 rounded border p-4">
19
+ <h3 className="font-semibold">
20
+ Recorded version {assessment.version} — {owner.warehouseCode} / {owner.cargoSku} /{' '}
21
+ {owner.locationId === null ? 'Unbinned' : known(owner.locationCode)}
22
+ </h3>
23
+ <p>{stockContinuityLabel(assessment, current)}</p>
24
+ <p>
25
+ Effective {assessment.effectiveAt}; recorded {assessment.recordedAt}.
26
+ </p>
27
+ <p>
28
+ {stockCompletenessLabel(assessment.completeness.status)}. These are recorded declarations;
29
+ they do not verify scans or authorize picking.
30
+ </p>
31
+ {assessment.completeness.reasons.length > 0 && (
32
+ <ul className="list-disc pl-5">
33
+ {assessment.completeness.reasons.map((reason) => (
34
+ <li key={reason}>{stockMissingFactLabel(reason)}</li>
35
+ ))}
36
+ </ul>
37
+ )}
38
+ <p>
39
+ Scope {stockFactLabel(facts.scope)}; source {known(facts.source.reference)} / revision{' '}
40
+ {known(facts.source.revision)}.
41
+ </p>
42
+ <p>
43
+ Count unit {stockFactLabel(facts.countUnit?.kind)}; source{' '}
44
+ {known(facts.countUnit?.reference)} / {known(facts.countUnit?.revision)}.
45
+ </p>
46
+ <p>
47
+ Reported item {known(facts.scanMapping?.reportedItemLabel)}; bin{' '}
48
+ {known(facts.scanMapping?.reportedBinLabel)}; mapping{' '}
49
+ {known(facts.scanMapping?.mappingReference)} / {known(facts.scanMapping?.mappingRevision)}.
50
+ </p>
51
+ <p>
52
+ Declared lot requirement {stockFactLabel(facts.declaredLotPolicy)}; lot{' '}
53
+ {known(facts.lot?.reference)} / {known(facts.lot?.revision)}; disposition{' '}
54
+ {stockFactLabel(facts.lot?.declaredDisposition)}.
55
+ </p>
56
+ <p>
57
+ Lot expiry policy {stockFactLabel(facts.lot?.expiry.policy)}; cutoff{' '}
58
+ {known(facts.lot?.expiry.expiresAt)}; source {known(facts.lot?.expiry.sourceReference)} /{' '}
59
+ {known(facts.lot?.expiry.sourceRevision)}.
60
+ </p>
61
+ <p>
62
+ Physical source validity {stockFactLabel(facts.sourceValidity.policy)};{' '}
63
+ {known(facts.sourceValidity.from)}–{known(facts.sourceValidity.until)}; source{' '}
64
+ {known(facts.sourceValidity.sourceReference)} / {known(facts.sourceValidity.sourceRevision)}
65
+ .
66
+ </p>
67
+ <details className="space-y-2">
68
+ <summary>Captured owner and evidence audit</summary>
69
+ <p>
70
+ Recorded by {assessment.createdBy}; actor provenance {assessment.actorProvenance}.
71
+ </p>
72
+ <p>
73
+ These fixed captured labels and revisions are historical; they are not substituted from
74
+ the current inventory record.
75
+ </p>
76
+ <p>
77
+ Warehouse status {owner.warehouseStatus}; location status {known(owner.locationStatus)};
78
+ cargo hazardous {String(owner.cargoHazardous)}, fragile {String(owner.cargoFragile)},
79
+ temperature controlled {String(owner.cargoTemperatureControlled)}.
80
+ </p>
81
+ <p>
82
+ At capture: on hand {quantity.onHand}, available {quantity.available}, allocated{' '}
83
+ {quantity.allocated}, damaged {quantity.damaged}. This assessment does not change
84
+ balances.
85
+ </p>
86
+ <p>
87
+ Inventory {assessment.inventoryItemId}; cargo {assessment.capturedCargoItemId}; warehouse{' '}
88
+ {assessment.capturedWarehouseId}; location {known(assessment.capturedLocationId)}.
89
+ </p>
90
+ <p>
91
+ Revisions: inventory {assessment.capturedInventoryUpdatedAt}; cargo{' '}
92
+ {assessment.capturedCargoUpdatedAt}; warehouse {assessment.capturedWarehouseUpdatedAt};
93
+ location {known(assessment.capturedLocationUpdatedAt)}.
94
+ </p>
95
+ <p>
96
+ Assessment {assessment.id}; predecessor {known(assessment.previousAssessmentId)}; critical
97
+ fingerprint {assessment.criticalFingerprint}; on behalf of {known(assessment.onBehalfOf)}.
98
+ </p>
99
+ {assessment.evidence.map((item) => (
100
+ <p key={item.versionId}>
101
+ File {item.fileId}; exact version {item.versionId}; SHA-256 {item.sha256Hash};
102
+ point-in-time Files receipt {item.checkedAt}.
103
+ </p>
104
+ ))}
105
+ </details>
106
+ </article>
107
+ );
108
+ }
@@ -0,0 +1,186 @@
1
+ import { useState } from 'react';
2
+ import { ContainerEvidencePicker, type SelectedEvidence } from '../ContainerEvidencePicker';
3
+ import { ReuseField, reuseSelect } from '../ReuseControls';
4
+ import { Button } from '../ui';
5
+ import { stockFactLabel } from '../../utils/stockBindingLabels';
6
+ import { readStockFactDraft, type StockFactDraft } from '../../utils/stockBindingForm';
7
+
8
+ function Choice({
9
+ name,
10
+ label,
11
+ options,
12
+ onChange,
13
+ }: {
14
+ name: string;
15
+ label: string;
16
+ options: string[];
17
+ onChange?: (value: string) => void;
18
+ }) {
19
+ return (
20
+ <label className="block">
21
+ {label}
22
+ <select
23
+ name={name}
24
+ className={reuseSelect}
25
+ defaultValue="UNKNOWN"
26
+ onChange={(event) => onChange?.(event.target.value)}
27
+ >
28
+ {options.map((value) => (
29
+ <option key={value} value={value}>
30
+ {stockFactLabel(value)}
31
+ </option>
32
+ ))}
33
+ </select>
34
+ </label>
35
+ );
36
+ }
37
+ function SourcePair({ prefix, label }: { prefix: string; label: string }) {
38
+ return (
39
+ <div className="grid gap-3 md:grid-cols-2">
40
+ <ReuseField
41
+ label={`${label} reference (blank = unknown)`}
42
+ name={`${prefix}Reference`}
43
+ required={false}
44
+ />
45
+ <ReuseField
46
+ label={`${label} revision (blank = unknown)`}
47
+ name={`${prefix}Revision`}
48
+ required={false}
49
+ maxLength={120}
50
+ />
51
+ </div>
52
+ );
53
+ }
54
+ export function StockFactForm({
55
+ busy,
56
+ onSubmit,
57
+ }: {
58
+ busy: boolean;
59
+ onSubmit: (draft: StockFactDraft) => Promise<void>;
60
+ }) {
61
+ const [evidence, setEvidence] = useState<SelectedEvidence[]>([]);
62
+ const [lotPresent, setLotPresent] = useState(false);
63
+ const [unitPresent, setUnitPresent] = useState(false);
64
+ const [error, setError] = useState<string | null>(null);
65
+ return (
66
+ <form
67
+ className="space-y-4"
68
+ onSubmit={async (event) => {
69
+ event.preventDefault();
70
+ setError(null);
71
+ try {
72
+ await onSubmit(readStockFactDraft(new FormData(event.currentTarget), evidence));
73
+ } catch (failure) {
74
+ setError(failure instanceof Error ? failure.message : 'Unable to record assessment.');
75
+ }
76
+ }}
77
+ >
78
+ <fieldset disabled={busy} className="space-y-4">
79
+ <p className="text-sm">
80
+ Blank facts remain unknown. Physical labels are your reported observations; the selected
81
+ database item and bin do not populate or authenticate scans. No EACH/case/pallet
82
+ conversion is inferred.
83
+ </p>
84
+ <ReuseField
85
+ label="Assessment effective time (ISO with seconds and timezone)"
86
+ name="effectiveAt"
87
+ />
88
+ <p className="text-sm">
89
+ Use Z or an explicit offset, e.g. 2026-10-04T08:00:00+05:30. A future effective time is
90
+ recordable and does not replace current operational eligibility.
91
+ </p>
92
+ <Choice
93
+ name="scope"
94
+ label="Declared line scope"
95
+ options={['UNKNOWN', 'WHOLE_LINE', 'UNSUPPORTED_MIXED_LOT']}
96
+ />
97
+ <SourcePair prefix="source" label="Physical assessment source" />
98
+ <section className="space-y-3 rounded border p-3">
99
+ <h3 className="font-semibold">Count unit declaration</h3>
100
+ <Choice
101
+ name="unitPresent"
102
+ label="Explicit unit kind"
103
+ options={['UNKNOWN', 'COUNT_UNIT']}
104
+ onChange={(value) => setUnitPresent(value === 'COUNT_UNIT')}
105
+ />
106
+ {unitPresent && <SourcePair key="count" prefix="unit" label="Count unit" />}
107
+ </section>
108
+ <section className="space-y-3 rounded border p-3">
109
+ <h3 className="font-semibold">Reported item and bin label mapping</h3>
110
+ <ReuseField
111
+ label="Reported item label (blank = unknown)"
112
+ name="itemLabel"
113
+ required={false}
114
+ />
115
+ <ReuseField
116
+ label="Reported bin label (blank = unknown)"
117
+ name="binLabel"
118
+ required={false}
119
+ />
120
+ <SourcePair prefix="mapping" label="Mapping source" />
121
+ </section>
122
+ <section className="space-y-3 rounded border p-3">
123
+ <h3 className="font-semibold">Reported lot facts</h3>
124
+ <Choice
125
+ name="lotPolicy"
126
+ label="Declared lot requirement"
127
+ options={['UNKNOWN', 'REQUIRED', 'NOT_REQUIRED']}
128
+ />
129
+ <Choice
130
+ name="lotPresent"
131
+ label="Lot identity observation"
132
+ options={['UNKNOWN', 'REPORTED']}
133
+ onChange={(value) => setLotPresent(value === 'REPORTED')}
134
+ />
135
+ {lotPresent && (
136
+ <div key="reported-lot" className="space-y-3">
137
+ <SourcePair prefix="lot" label="Lot" />
138
+ <Choice
139
+ name="lotDisposition"
140
+ label="Reported lot disposition"
141
+ options={['UNKNOWN', 'RELEASED', 'HELD', 'EXPIRED']}
142
+ />
143
+ <Choice
144
+ name="expiryPolicy"
145
+ label="Reported lot expiry policy"
146
+ options={['UNKNOWN', 'TIME_BOUNDED', 'NO_REQUIRED_EXPIRY']}
147
+ />
148
+ <ReuseField
149
+ label="Reported expiry cutoff (ISO with timezone; blank = unknown)"
150
+ name="expiresAt"
151
+ required={false}
152
+ />
153
+ <SourcePair prefix="expiry" label="Expiry source" />
154
+ </div>
155
+ )}
156
+ </section>
157
+ <section className="space-y-3 rounded border p-3">
158
+ <h3 className="font-semibold">Physical source validity declaration</h3>
159
+ <Choice
160
+ name="validityPolicy"
161
+ label="Declared validity policy"
162
+ options={['UNKNOWN', 'TIME_BOUNDED', 'NO_REQUIRED_EXPIRY']}
163
+ />
164
+ <ReuseField
165
+ label="Known validity start (ISO with timezone; blank = unknown)"
166
+ name="validityFrom"
167
+ required={false}
168
+ />
169
+ <ReuseField
170
+ label="Known validity end (ISO with timezone; blank = unknown)"
171
+ name="validityUntil"
172
+ required={false}
173
+ />
174
+ <SourcePair prefix="validity" label="Validity source" />
175
+ </section>
176
+ <ContainerEvidencePicker
177
+ value={evidence}
178
+ onChange={setEvidence}
179
+ description="Choose readable Files versions that support these facts. Documents do not certify labels or make stock ready to pick."
180
+ />
181
+ <Button type="submit">Record reported facts</Button>
182
+ </fieldset>
183
+ {error && <p role="alert">{error}</p>}
184
+ </form>
185
+ );
186
+ }
@@ -0,0 +1,103 @@
1
+ import { useState } from 'react';
2
+ import { Button, Input } from '../ui';
3
+ import { ReuseField, reuseSelect } from '../ReuseControls';
4
+ import { stockObservationInput } from '../../utils/stockObservationForm';
5
+ import type { RecordMtwStockObservationInput } from '../../../generated/stock-observation-operations';
6
+
7
+ export function StockIssueForm({
8
+ inventoryItemId,
9
+ disabled,
10
+ onSubmit,
11
+ }: {
12
+ inventoryItemId: string;
13
+ disabled: boolean;
14
+ onSubmit: (input: Omit<RecordMtwStockObservationInput, 'idempotencyKey'>) => Promise<void>;
15
+ }) {
16
+ const [error, setError] = useState<string | null>(null);
17
+ return (
18
+ <form
19
+ className="space-y-4"
20
+ onSubmit={async (event) => {
21
+ event.preventDefault();
22
+ if (disabled) return;
23
+ setError(null);
24
+ try {
25
+ await onSubmit(stockObservationInput(inventoryItemId, new FormData(event.currentTarget)));
26
+ } catch (failure) {
27
+ setError(failure instanceof Error ? failure.message : 'Check the reported fields.');
28
+ }
29
+ }}
30
+ >
31
+ <fieldset disabled={disabled} className="space-y-4">
32
+ <div className="grid gap-3 md:grid-cols-2">
33
+ <label>
34
+ Issue
35
+ <select name="kind" className={reuseSelect} defaultValue="COUNT_DISCREPANCY">
36
+ <option value="COUNT_DISCREPANCY">Count discrepancy</option>
37
+ <option value="DAMAGE">Damage</option>
38
+ <option value="IDENTITY_UNCERTAIN">Uncertain item identity</option>
39
+ <option value="OTHER">Other issue</option>
40
+ </select>
41
+ </label>
42
+ <label>
43
+ Count scope
44
+ <select name="countScope" className={reuseSelect} defaultValue="UNKNOWN">
45
+ <option value="UNKNOWN">Not known</option>
46
+ <option value="WHOLE_LINE">Whole inventory line</option>
47
+ </select>
48
+ </label>
49
+ <ReuseField
50
+ name="observedCount"
51
+ label="Reported count (blank = not known)"
52
+ type="number"
53
+ required={false}
54
+ />
55
+ <label>
56
+ Reported observation time (your local time; optional)
57
+ <Input type="datetime-local" name="reportedObservedAt" />
58
+ </label>
59
+ <label>
60
+ Reported unit
61
+ <select name="countUnit" className={reuseSelect} defaultValue="UNKNOWN">
62
+ <option value="UNKNOWN">Not known</option>
63
+ <option value="COUNT_UNIT">Count unit</option>
64
+ </select>
65
+ </label>
66
+ <ReuseField
67
+ name="unitReference"
68
+ label="Count-unit reference (optional)"
69
+ required={false}
70
+ />
71
+ <ReuseField name="unitRevision" label="Count-unit revision (optional)" required={false} />
72
+ <ReuseField
73
+ name="sourceReference"
74
+ label="Reported source reference (optional)"
75
+ required={false}
76
+ />
77
+ <ReuseField
78
+ name="sourceRevision"
79
+ label="Reported source revision (optional)"
80
+ required={false}
81
+ />
82
+ </div>
83
+ <label className="block">
84
+ What did you observe?
85
+ <textarea name="reason" required maxLength={1000} rows={3} className={reuseSelect} />
86
+ </label>
87
+ <details>
88
+ <summary>Optional unverified file references</summary>
89
+ <p className="text-sm">
90
+ These references are recorded as supplied. Files are not opened or verified when
91
+ reporting an issue.
92
+ </p>
93
+ <div className="grid gap-3 md:grid-cols-2">
94
+ <ReuseField name="fileId" label="Exact file reference" required={false} />
95
+ <ReuseField name="versionId" label="Exact version reference" required={false} />
96
+ </div>
97
+ </details>
98
+ <Button type="submit">Record unresolved issue</Button>
99
+ </fieldset>
100
+ {error && <p role="alert">{error}</p>}
101
+ </form>
102
+ );
103
+ }