@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.
- package/dist/MoveTheWheelsRoot.js +177 -102
- package/dist/MoveTheWheelsRoutes.js +55 -11
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/components/ContainerEvidencePicker.js +143 -0
- package/dist/components/FreeTimeAgreementForm.js +496 -0
- package/dist/components/ReturnInstructionForm.js +108 -0
- package/dist/components/ReuseControls.js +91 -0
- package/dist/components/ReusePermissionForm.js +114 -0
- package/dist/components/ReuseProposalForm.js +455 -0
- package/dist/components/ReuseSourceFields.js +78 -0
- package/dist/components/consolidation/ConsolidationHistory.js +244 -0
- package/dist/components/consolidation/ConsolidationLotEditor.js +133 -0
- package/dist/components/consolidation/ConsolidationManifestWorkbench.js +143 -0
- package/dist/components/consolidation/ConsolidationPlanForm.js +172 -0
- package/dist/components/consolidation/ConsolidationPlanWorkbench.js +321 -0
- package/dist/components/consolidation/ConsolidationReportForm.js +94 -0
- package/dist/components/consolidation/ConsolidationReportsWorkbench.js +195 -0
- package/dist/components/consolidation/ConsolidationSummary.js +76 -0
- package/dist/components/consolidation/OriginalConsolidationHistory.js +112 -0
- package/dist/components/freight-cost/FreightDraftForm.js +213 -0
- package/dist/components/freight-cost/FreightFields.js +70 -0
- package/dist/components/freight-cost/FreightFxEditor.js +90 -0
- package/dist/components/freight-cost/FreightHistory.js +164 -0
- package/dist/components/freight-cost/FreightLineEditor.js +191 -0
- package/dist/components/freight-cost/FreightScopeEditor.js +72 -0
- package/dist/components/freight-cost/FreightTotals.js +66 -0
- package/dist/components/logistics-procedure/ProcedureDecisionForm.js +197 -0
- package/dist/components/logistics-procedure/ProcedureFields.js +31 -0
- package/dist/components/logistics-procedure/ProcedureHistory.js +177 -0
- package/dist/components/logistics-procedure/ProcedurePolicyForm.js +227 -0
- package/dist/components/logistics-procedure/ProcedurePolicyWorkbench.js +155 -0
- package/dist/components/logistics-procedure/ProcedureReviewWorkbench.js +221 -0
- package/dist/components/logistics-procedure/ProcedureRunWorkbench.js +190 -0
- package/dist/components/logistics-procedure/ProcedureSubjectPicker.js +130 -0
- package/dist/components/pending-pick/PendingPickDraft.js +84 -0
- package/dist/components/pending-pick/PendingPickHistory.js +113 -0
- package/dist/components/pending-pick/PickCapture.js +166 -0
- package/dist/components/pending-pick/PickLineSelection.js +111 -0
- package/dist/components/stock-binding/StockAssessmentDraft.js +48 -0
- package/dist/components/stock-binding/StockAssessmentHistory.js +61 -0
- package/dist/components/stock-binding/StockAssessmentSummary.js +199 -0
- package/dist/components/stock-binding/StockFactForm.js +232 -0
- package/dist/components/stock-observation/StockIssueForm.js +148 -0
- package/dist/components/stock-observation/StockIssueHistory.js +116 -0
- package/dist/components/stock-observation/StockIssueReadPanel.js +70 -0
- package/dist/components/trip-utilization/TripReportForm.js +118 -0
- package/dist/components/trip-utilization/TripReportHistory.js +54 -0
- package/dist/components/trip-utilization/TripReportSummary.js +216 -0
- package/dist/components/trip-utilization/TripSegmentFields.js +166 -0
- package/dist/generated/consolidation-operations.d.ts +1060 -0
- package/dist/generated/container-condition-operations.d.ts +868 -0
- package/dist/generated/container-operations.d.ts +356 -0
- package/dist/generated/empty-reuse-operations.d.ts +1578 -0
- package/dist/generated/free-time-operations.d.ts +938 -0
- package/dist/generated/freight-cost-operations.d.ts +716 -0
- package/dist/generated/logistics-procedure-operations.d.ts +938 -0
- package/dist/generated/pending-pick-operations.d.ts +1969 -0
- package/dist/generated/stock-binding-operations.d.ts +930 -0
- package/dist/generated/stock-observation-operations.d.ts +476 -0
- package/dist/generated/trip-utilization-operations.d.ts +651 -0
- package/dist/generated/wspace-operations.d.ts +143 -50
- package/dist/hooks/useConsolidationAction.js +119 -0
- package/dist/hooks/useContainerCondition.js +105 -0
- package/dist/hooks/useContainerLifecycle.js +192 -0
- package/dist/hooks/useEmptyReuseAction.js +45 -0
- package/dist/hooks/useFreightRecoveryAction.js +117 -0
- package/dist/hooks/useInventory.js +12 -1
- package/dist/hooks/useProcedureAction.js +119 -0
- package/dist/hooks/useProcedureSelection.js +53 -0
- package/dist/hooks/useReuseRecoveryAction.js +116 -0
- package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +10 -0
- package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +14 -0
- package/dist/movethewheels/components/ReturnInstructionForm.d.ts +8 -0
- package/dist/movethewheels/components/ReuseControls.d.ts +42 -0
- package/dist/movethewheels/components/ReusePermissionForm.d.ts +9 -0
- package/dist/movethewheels/components/ReuseProposalForm.d.ts +11 -0
- package/dist/movethewheels/components/ReuseSourceFields.d.ts +9 -0
- package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +13 -0
- package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +6 -0
- package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +8 -0
- package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +8 -0
- package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +9 -0
- package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +7 -0
- package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +6 -0
- package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +23 -0
- package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +6 -0
- package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +5 -0
- package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +6 -0
- package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +6 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +20 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +17 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +7 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +10 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +6 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +7 -0
- package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +16 -0
- package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +5 -0
- package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +6 -0
- package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +17 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +13 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +18 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +9 -0
- package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +6 -0
- package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +7 -0
- package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +7 -0
- package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +5 -0
- package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +6 -0
- package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +14 -0
- package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +5 -0
- package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +9 -0
- package/dist/movethewheels/hooks/useConsolidationAction.d.ts +19 -0
- package/dist/movethewheels/hooks/useContainerCondition.d.ts +21 -0
- package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +40 -0
- package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +14 -0
- package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +23 -0
- package/dist/movethewheels/hooks/useProcedureAction.d.ts +18 -0
- package/dist/movethewheels/hooks/useProcedureSelection.d.ts +51 -0
- package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +18 -0
- package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -0
- package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -0
- package/dist/movethewheels/pages/ContainersPage.d.ts +2 -0
- package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -0
- package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -0
- package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -0
- package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -0
- package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -0
- package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -0
- package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -0
- package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -0
- package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +12 -0
- package/dist/movethewheels/utils/consolidationInput.d.ts +15 -0
- package/dist/movethewheels/utils/consolidationLot.d.ts +3 -0
- package/dist/movethewheels/utils/consolidationPins.d.ts +20 -0
- package/dist/movethewheels/utils/consolidationRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/consolidationReportHead.d.ts +5 -0
- package/dist/movethewheels/utils/freeTimeDate.d.ts +1 -0
- package/dist/movethewheels/utils/freightAcknowledgement.d.ts +2 -0
- package/dist/movethewheels/utils/freightDraft.d.ts +36 -0
- package/dist/movethewheels/utils/freightRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/graphqlClient.d.ts +2 -1
- package/dist/movethewheels/utils/pendingPickDraft.d.ts +8 -0
- package/dist/movethewheels/utils/procedureInput.d.ts +18 -0
- package/dist/movethewheels/utils/procedureRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/reuseAttempt.d.ts +7 -0
- package/dist/movethewheels/utils/reuseForm.d.ts +6 -0
- package/dist/movethewheels/utils/reuseRecovery.d.ts +26 -0
- package/dist/movethewheels/utils/stockBindingForm.d.ts +23 -0
- package/dist/movethewheels/utils/stockBindingLabels.d.ts +10 -0
- package/dist/movethewheels/utils/stockObservationForm.d.ts +5 -0
- package/dist/movethewheels/utils/tripDraftContext.d.ts +25 -0
- package/dist/movethewheels/utils/tripUtilizationForm.d.ts +6 -0
- package/dist/node_modules/@react-leaflet/core/lib/component.js +5 -5
- package/dist/node_modules/fast-equals/dist/es/index.js +87 -74
- package/dist/node_modules/leaflet/dist/leaflet-src.js +8 -5
- package/dist/node_modules/lodash/_Stack.js +2 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/clipboard-list.js +35 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/repeat-2.js +22 -0
- package/dist/node_modules/react-leaflet/lib/MapContainer.js +3 -3
- package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
- package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
- package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
- package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
- package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
- package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +13 -13
- package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
- package/dist/node_modules/recharts/es6/cartesian/Line.js +10 -10
- package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
- package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
- package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
- package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
- package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
- package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
- package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
- package/dist/node_modules/recharts/es6/component/Label.js +14 -14
- package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
- package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
- package/dist/node_modules/recharts/es6/component/Text.js +2 -2
- package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
- package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
- package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
- package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
- package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
- package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
- package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
- package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
- package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
- package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
- package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
- package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
- package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +2 -2
- package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
- package/dist/node_modules/recharts/es6/util/types.js +1 -1
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.development.js +2 -2
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.production.min.js +2 -2
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/index.js +2 -2
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +97 -18
- package/dist/node_modules/zustand/esm/middleware.js +2 -2
- package/dist/pages/ConsolidationPage.js +76 -0
- package/dist/pages/ContainerConditionPage.js +972 -0
- package/dist/pages/ContainersPage.js +522 -0
- package/dist/pages/EmptyReusePage.js +777 -0
- package/dist/pages/FreeTimePage.js +657 -0
- package/dist/pages/FreightEstimatePage.js +284 -0
- package/dist/pages/InventoryPage.js +77 -73
- package/dist/pages/LogisticsProceduresPage.js +100 -0
- package/dist/pages/PendingPickPage.js +155 -0
- package/dist/pages/StockBindingPage.js +236 -0
- package/dist/pages/StockObservationsPage.js +168 -0
- package/dist/pages/TripUtilizationPage.js +227 -0
- package/dist/src/generated/consolidation-operations.js +505 -0
- package/dist/src/generated/container-condition-operations.js +208 -0
- package/dist/src/generated/container-operations.js +101 -0
- package/dist/src/generated/empty-reuse-operations.js +749 -0
- package/dist/src/generated/free-time-operations.js +235 -0
- package/dist/src/generated/freight-cost-operations.js +325 -0
- package/dist/src/generated/logistics-procedure-operations.js +362 -0
- package/dist/src/generated/pending-pick-operations.js +1128 -0
- package/dist/src/generated/stock-binding-operations.js +175 -0
- package/dist/src/generated/stock-observation-operations.js +93 -0
- package/dist/src/generated/trip-utilization-operations.js +140 -0
- package/dist/src/generated/wspace-operations.js +708 -0
- package/dist/utils/consolidationHistoryTarget.js +27 -0
- package/dist/utils/consolidationInput.js +21 -0
- package/dist/utils/consolidationLot.js +29 -0
- package/dist/utils/consolidationPins.js +13 -0
- package/dist/utils/consolidationRecovery.js +40 -0
- package/dist/utils/consolidationReportHead.js +18 -0
- package/dist/utils/freeTimeDate.js +26 -0
- package/dist/utils/freightAcknowledgement.js +8 -0
- package/dist/utils/freightDraft.js +125 -0
- package/dist/utils/freightRecovery.js +36 -0
- package/dist/utils/graphqlClient.js +28 -28
- package/dist/utils/pendingPickDraft.js +46 -0
- package/dist/utils/procedureInput.js +43 -0
- package/dist/utils/procedureRecovery.js +42 -0
- package/dist/utils/reuseAttempt.js +20 -0
- package/dist/utils/reuseForm.js +25 -0
- package/dist/utils/reuseRecovery.js +71 -0
- package/dist/utils/stockBindingForm.js +142 -0
- package/dist/utils/stockBindingLabels.js +23 -0
- package/dist/utils/stockObservationForm.js +55 -0
- package/dist/utils/tripDraftContext.js +19 -0
- package/dist/utils/tripUtilizationForm.js +60 -0
- package/package.json +19 -5
- package/src/generated/consolidation-operations.ts +1138 -0
- package/src/generated/container-condition-operations.ts +771 -0
- package/src/generated/container-operations.ts +376 -0
- package/src/generated/empty-reuse-operations.ts +1648 -0
- package/src/generated/free-time-operations.ts +814 -0
- package/src/generated/freight-cost-operations.ts +753 -0
- package/src/generated/logistics-procedure-operations.ts +1047 -0
- package/src/generated/pending-pick-operations.ts +1508 -0
- package/src/generated/stock-binding-operations.ts +631 -0
- package/src/generated/stock-observation-operations.ts +373 -0
- package/src/generated/trip-utilization-operations.ts +500 -0
- package/src/generated/wspace-operations.ts +116 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +79 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +22 -0
- package/src/movethewheels/components/ContainerEvidencePicker.tsx +146 -0
- package/src/movethewheels/components/FreeTimeAgreementForm.tsx +483 -0
- package/src/movethewheels/components/ReturnInstructionForm.tsx +102 -0
- package/src/movethewheels/components/ReuseControls.tsx +138 -0
- package/src/movethewheels/components/ReusePermissionForm.tsx +123 -0
- package/src/movethewheels/components/ReuseProposalForm.tsx +484 -0
- package/src/movethewheels/components/ReuseSourceFields.tsx +80 -0
- package/src/movethewheels/components/consolidation/ConsolidationHistory.tsx +159 -0
- package/src/movethewheels/components/consolidation/ConsolidationLotEditor.tsx +144 -0
- package/src/movethewheels/components/consolidation/ConsolidationManifestWorkbench.tsx +168 -0
- package/src/movethewheels/components/consolidation/ConsolidationPlanForm.tsx +185 -0
- package/src/movethewheels/components/consolidation/ConsolidationPlanWorkbench.tsx +395 -0
- package/src/movethewheels/components/consolidation/ConsolidationReportForm.tsx +124 -0
- package/src/movethewheels/components/consolidation/ConsolidationReportsWorkbench.tsx +233 -0
- package/src/movethewheels/components/consolidation/ConsolidationSummary.tsx +84 -0
- package/src/movethewheels/components/consolidation/OriginalConsolidationHistory.tsx +133 -0
- package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +224 -0
- package/src/movethewheels/components/freight-cost/FreightFields.tsx +91 -0
- package/src/movethewheels/components/freight-cost/FreightFxEditor.tsx +98 -0
- package/src/movethewheels/components/freight-cost/FreightHistory.tsx +91 -0
- package/src/movethewheels/components/freight-cost/FreightLineEditor.tsx +192 -0
- package/src/movethewheels/components/freight-cost/FreightScopeEditor.tsx +64 -0
- package/src/movethewheels/components/freight-cost/FreightTotals.tsx +68 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureDecisionForm.tsx +204 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureFields.tsx +43 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureHistory.tsx +102 -0
- package/src/movethewheels/components/logistics-procedure/ProcedurePolicyForm.tsx +226 -0
- package/src/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.tsx +174 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.tsx +278 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.tsx +292 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.tsx +111 -0
- package/src/movethewheels/components/pending-pick/PendingPickDraft.tsx +82 -0
- package/src/movethewheels/components/pending-pick/PendingPickHistory.tsx +93 -0
- package/src/movethewheels/components/pending-pick/PickCapture.tsx +70 -0
- package/src/movethewheels/components/pending-pick/PickLineSelection.tsx +130 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentDraft.tsx +52 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentHistory.tsx +56 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentSummary.tsx +108 -0
- package/src/movethewheels/components/stock-binding/StockFactForm.tsx +186 -0
- package/src/movethewheels/components/stock-observation/StockIssueForm.tsx +103 -0
- package/src/movethewheels/components/stock-observation/StockIssueHistory.tsx +96 -0
- package/src/movethewheels/components/stock-observation/StockIssueReadPanel.tsx +72 -0
- package/src/movethewheels/components/trip-utilization/TripReportForm.tsx +116 -0
- package/src/movethewheels/components/trip-utilization/TripReportHistory.tsx +51 -0
- package/src/movethewheels/components/trip-utilization/TripReportSummary.tsx +127 -0
- package/src/movethewheels/components/trip-utilization/TripSegmentFields.tsx +118 -0
- package/src/movethewheels/hooks/useConsolidationAction.ts +196 -0
- package/src/movethewheels/hooks/useContainerCondition.ts +129 -0
- package/src/movethewheels/hooks/useContainerLifecycle.ts +291 -0
- package/src/movethewheels/hooks/useEmptyReuseAction.ts +72 -0
- package/src/movethewheels/hooks/useFreightRecoveryAction.ts +201 -0
- package/src/movethewheels/hooks/useInventory.ts +2 -20
- package/src/movethewheels/hooks/useProcedureAction.ts +196 -0
- package/src/movethewheels/hooks/useProcedureSelection.ts +75 -0
- package/src/movethewheels/hooks/useReuseRecoveryAction.ts +192 -0
- package/src/movethewheels/pages/ConsolidationPage.tsx +70 -0
- package/src/movethewheels/pages/ContainerConditionPage.tsx +959 -0
- package/src/movethewheels/pages/ContainersPage.tsx +490 -0
- package/src/movethewheels/pages/EmptyReusePage.tsx +823 -0
- package/src/movethewheels/pages/FreeTimePage.tsx +720 -0
- package/src/movethewheels/pages/FreightEstimatePage.tsx +353 -0
- package/src/movethewheels/pages/InventoryPage.tsx +16 -2
- package/src/movethewheels/pages/LogisticsProceduresPage.tsx +86 -0
- package/src/movethewheels/pages/PendingPickPage.tsx +226 -0
- package/src/movethewheels/pages/StockBindingPage.tsx +299 -0
- package/src/movethewheels/pages/StockObservationsPage.tsx +181 -0
- package/src/movethewheels/pages/TripUtilizationPage.tsx +315 -0
- package/src/movethewheels/utils/consolidationHistoryTarget.ts +39 -0
- package/src/movethewheels/utils/consolidationInput.ts +70 -0
- package/src/movethewheels/utils/consolidationLot.ts +24 -0
- package/src/movethewheels/utils/consolidationPins.ts +52 -0
- package/src/movethewheels/utils/consolidationRecovery.ts +88 -0
- package/src/movethewheels/utils/consolidationReportHead.ts +29 -0
- package/src/movethewheels/utils/freeTimeDate.ts +31 -0
- package/src/movethewheels/utils/freightAcknowledgement.ts +31 -0
- package/src/movethewheels/utils/freightDraft.ts +170 -0
- package/src/movethewheels/utils/freightRecovery.ts +79 -0
- package/src/movethewheels/utils/graphqlClient.ts +14 -5
- package/src/movethewheels/utils/pendingPickDraft.ts +61 -0
- package/src/movethewheels/utils/procedureInput.ts +98 -0
- package/src/movethewheels/utils/procedureRecovery.ts +92 -0
- package/src/movethewheels/utils/reuseAttempt.ts +29 -0
- package/src/movethewheels/utils/reuseForm.ts +30 -0
- package/src/movethewheels/utils/reuseRecovery.ts +151 -0
- package/src/movethewheels/utils/stockBindingForm.ts +209 -0
- package/src/movethewheels/utils/stockBindingLabels.ts +41 -0
- package/src/movethewheels/utils/stockObservationForm.ts +73 -0
- package/src/movethewheels/utils/tripDraftContext.ts +61 -0
- package/src/movethewheels/utils/tripUtilizationForm.ts +105 -0
- package/src/operations/condition/container-condition.graphql +41 -0
- package/src/operations/consolidation/consolidation.graphql +490 -0
- package/src/operations/container/container-lifecycle.graphql +80 -0
- package/src/operations/empty-reuse/empty-reuse.graphql +737 -0
- package/src/operations/free-time/free-time.graphql +47 -0
- package/src/operations/freight-cost/freight.graphql +6 -0
- package/src/operations/logistics-procedure/procedure.graphql +15 -0
- package/src/operations/pending-pick/pending-pick.graphql +1122 -0
- package/src/operations/stock-binding/stock-binding.graphql +160 -0
- package/src/operations/stock-observation/stock-observation.graphql +20 -0
- package/src/operations/trip-utilization/trip-utilization.graphql +126 -0
- package/src/operations/wspace/container-evidence.graphql +6 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ConsolidationShipmentsDocument,
|
|
4
|
+
ConsolidationShipmentDocument,
|
|
5
|
+
ConsolidationContainersDocument,
|
|
6
|
+
ConsolidationCyclesDocument,
|
|
7
|
+
ConsolidationPlansDocument,
|
|
8
|
+
ConsolidationPlanDocument,
|
|
9
|
+
SaveConsolidationPlanDocument,
|
|
10
|
+
type ConsolidationShipmentsQuery,
|
|
11
|
+
type ConsolidationShipmentQuery,
|
|
12
|
+
type ConsolidationContainersQuery,
|
|
13
|
+
type ConsolidationCyclesQuery,
|
|
14
|
+
type ConsolidationPlansQuery,
|
|
15
|
+
type ConsolidationPlanQuery,
|
|
16
|
+
type SaveMtwConsolidationPlanInput,
|
|
17
|
+
} from '../../../generated/consolidation-operations';
|
|
18
|
+
import { useConditionApi, useConditionQuery } from '../../hooks/useContainerCondition';
|
|
19
|
+
import type { useConsolidationAction } from '../../hooks/useConsolidationAction';
|
|
20
|
+
import { ProcedureField as Field } from '../logistics-procedure/ProcedureFields';
|
|
21
|
+
import { ConsolidationPlanForm, type ConsolidationPlanPin } from './ConsolidationPlanForm';
|
|
22
|
+
import { ConsolidationPlanHistory } from './ConsolidationHistory';
|
|
23
|
+
import { ConsolidationReportsWorkbench } from './ConsolidationReportsWorkbench';
|
|
24
|
+
import {
|
|
25
|
+
offPageConsolidationContainer,
|
|
26
|
+
type ConsolidationContainerOption,
|
|
27
|
+
matchesConsolidationContext,
|
|
28
|
+
assertConsolidationPredecessor,
|
|
29
|
+
type ConsolidationContextPin,
|
|
30
|
+
} from '../../utils/consolidationPins';
|
|
31
|
+
import { ReuseState, ReusePager, reuseCard, reuseSelect } from '../ReuseControls';
|
|
32
|
+
import { Button } from '../ui';
|
|
33
|
+
export function ConsolidationPlanWorkbench({
|
|
34
|
+
actions,
|
|
35
|
+
}: {
|
|
36
|
+
actions: ReturnType<typeof useConsolidationAction>;
|
|
37
|
+
}) {
|
|
38
|
+
const active = useRef(true);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
active.current = true;
|
|
41
|
+
return () => {
|
|
42
|
+
active.current = false;
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
const request = useConditionApi(),
|
|
46
|
+
[shipmentId, setShipment] = useState(''),
|
|
47
|
+
[containerId, setContainer] = useState(''),
|
|
48
|
+
[cycleId, setCycle] = useState(''),
|
|
49
|
+
[reference, setReference] = useState(''),
|
|
50
|
+
[selected, setSelected] = useState(''),
|
|
51
|
+
[shipmentOffset, setShipmentOffset] = useState(0),
|
|
52
|
+
[containerOffset, setContainerOffset] = useState(0),
|
|
53
|
+
[cycleOffset, setCycleOffset] = useState(0),
|
|
54
|
+
[historyOffset, setHistoryOffset] = useState(0),
|
|
55
|
+
[checking, setChecking] = useState(false),
|
|
56
|
+
[error, setError] = useState<string | null>(null);
|
|
57
|
+
const [selectedContainer, setSelectedContainer] = useState<ConsolidationContainerOption | null>(
|
|
58
|
+
null
|
|
59
|
+
);
|
|
60
|
+
const [draft, setDraft] = useState<{
|
|
61
|
+
pin: ConsolidationPlanPin;
|
|
62
|
+
context: ConsolidationContextPin;
|
|
63
|
+
previous: { id: string; version: number } | null;
|
|
64
|
+
generation: string;
|
|
65
|
+
} | null>(null);
|
|
66
|
+
const shipments = useConditionQuery<ConsolidationShipmentsQuery>(
|
|
67
|
+
ConsolidationShipmentsDocument,
|
|
68
|
+
{ pagination: { limit: 25, offset: shipmentOffset } },
|
|
69
|
+
actions.revision
|
|
70
|
+
);
|
|
71
|
+
const shipment = useConditionQuery<ConsolidationShipmentQuery>(
|
|
72
|
+
ConsolidationShipmentDocument,
|
|
73
|
+
shipmentId ? { id: shipmentId } : null,
|
|
74
|
+
actions.revision
|
|
75
|
+
);
|
|
76
|
+
const containers = useConditionQuery<ConsolidationContainersQuery>(
|
|
77
|
+
ConsolidationContainersDocument,
|
|
78
|
+
{ pagination: { limit: 25, offset: containerOffset } },
|
|
79
|
+
actions.revision
|
|
80
|
+
);
|
|
81
|
+
const cycles = useConditionQuery<ConsolidationCyclesQuery>(
|
|
82
|
+
ConsolidationCyclesDocument,
|
|
83
|
+
containerId ? { containerId, pagination: { limit: 25, offset: cycleOffset } } : null,
|
|
84
|
+
actions.revision
|
|
85
|
+
);
|
|
86
|
+
const history = useConditionQuery<ConsolidationPlansQuery>(
|
|
87
|
+
ConsolidationPlansDocument,
|
|
88
|
+
shipmentId ? { shipmentId, pagination: { limit: 5, offset: historyOffset } } : null,
|
|
89
|
+
actions.revision
|
|
90
|
+
);
|
|
91
|
+
const latest = useConditionQuery<ConsolidationPlansQuery>(
|
|
92
|
+
ConsolidationPlansDocument,
|
|
93
|
+
shipmentId && reference.trim()
|
|
94
|
+
? { shipmentId, planReference: reference.trim(), pagination: { limit: 1, offset: 0 } }
|
|
95
|
+
: null,
|
|
96
|
+
actions.revision
|
|
97
|
+
);
|
|
98
|
+
const exact = useConditionQuery<ConsolidationPlanQuery>(
|
|
99
|
+
ConsolidationPlanDocument,
|
|
100
|
+
shipmentId && selected ? { shipmentId, id: selected } : null,
|
|
101
|
+
actions.revision
|
|
102
|
+
);
|
|
103
|
+
const cycle = cycles.data?.mtwContainerCyclePage.items.find((row) => row.id === cycleId) ?? null,
|
|
104
|
+
previous = latest.data?.mtwConsolidationPlanPage.items[0] ?? null,
|
|
105
|
+
paused = checking || actions.busy || actions.uncertain;
|
|
106
|
+
const offPageContainer = offPageConsolidationContainer(
|
|
107
|
+
containerId,
|
|
108
|
+
selectedContainer,
|
|
109
|
+
containers.data?.mtwContainerPage.items ?? []
|
|
110
|
+
);
|
|
111
|
+
const changed =
|
|
112
|
+
!!draft &&
|
|
113
|
+
!!shipment.data &&
|
|
114
|
+
!!cycles.data &&
|
|
115
|
+
!matchesConsolidationContext(draft.context, shipment.data.shipment, cycle);
|
|
116
|
+
const clear = () => {
|
|
117
|
+
setDraft(null);
|
|
118
|
+
setSelected('');
|
|
119
|
+
setHistoryOffset(0);
|
|
120
|
+
setError(null);
|
|
121
|
+
};
|
|
122
|
+
const save = async (input: Omit<SaveMtwConsolidationPlanInput, 'idempotencyKey'>) => {
|
|
123
|
+
if (!draft || paused) throw new Error('Review current sources before recording.');
|
|
124
|
+
setChecking(true);
|
|
125
|
+
try {
|
|
126
|
+
const freshShipment = await request<ConsolidationShipmentQuery>(
|
|
127
|
+
ConsolidationShipmentDocument,
|
|
128
|
+
{ id: draft.context.shipmentId }
|
|
129
|
+
);
|
|
130
|
+
const freshCycles = await request<ConsolidationCyclesQuery>(ConsolidationCyclesDocument, {
|
|
131
|
+
containerId: draft.context.containerId,
|
|
132
|
+
pagination: { limit: 25, offset: cycleOffset },
|
|
133
|
+
});
|
|
134
|
+
const freshCycle =
|
|
135
|
+
freshCycles.mtwContainerCyclePage.items.find((row) => row.id === draft.context.cycleId) ??
|
|
136
|
+
null;
|
|
137
|
+
const freshHistory = await request<ConsolidationPlansQuery>(ConsolidationPlansDocument, {
|
|
138
|
+
shipmentId: draft.pin.shipmentId,
|
|
139
|
+
planReference: draft.pin.planReference,
|
|
140
|
+
pagination: { limit: 1, offset: 0 },
|
|
141
|
+
});
|
|
142
|
+
if (!active.current) throw new Error('Context changed. Nothing was sent.');
|
|
143
|
+
if (!matchesConsolidationContext(draft.context, freshShipment.shipment, freshCycle))
|
|
144
|
+
throw new Error('Shipment or cycle changed. Refresh and explicitly review a new form.');
|
|
145
|
+
assertConsolidationPredecessor(
|
|
146
|
+
draft.previous,
|
|
147
|
+
freshHistory.mtwConsolidationPlanPage.items[0] ?? null
|
|
148
|
+
);
|
|
149
|
+
const result = await actions.run(
|
|
150
|
+
SaveConsolidationPlanDocument,
|
|
151
|
+
{ ...input },
|
|
152
|
+
'Plan version recorded.'
|
|
153
|
+
);
|
|
154
|
+
if (result) {
|
|
155
|
+
setDraft(null);
|
|
156
|
+
setSelected(
|
|
157
|
+
String(
|
|
158
|
+
result.saveMtwConsolidationPlan &&
|
|
159
|
+
typeof result.saveMtwConsolidationPlan === 'object' &&
|
|
160
|
+
'id' in result.saveMtwConsolidationPlan
|
|
161
|
+
? result.saveMtwConsolidationPlan.id
|
|
162
|
+
: ''
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
} finally {
|
|
167
|
+
setChecking(false);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
return (
|
|
171
|
+
<div className="space-y-5">
|
|
172
|
+
<section className={reuseCard}>
|
|
173
|
+
<h2 className="text-lg font-semibold">Choose a shipment and container cycle</h2>
|
|
174
|
+
<fieldset disabled={paused} className="space-y-3">
|
|
175
|
+
<label className="block">
|
|
176
|
+
Shipment
|
|
177
|
+
<select
|
|
178
|
+
className={reuseSelect}
|
|
179
|
+
value={shipmentId}
|
|
180
|
+
onChange={(e) => {
|
|
181
|
+
setShipment(e.target.value);
|
|
182
|
+
setCycle('');
|
|
183
|
+
clear();
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
<option value="">Choose a shipment</option>
|
|
187
|
+
{shipment.data?.shipment &&
|
|
188
|
+
!shipments.data?.shipments.some((row) => row.id === shipmentId) && (
|
|
189
|
+
<option value={shipmentId}>
|
|
190
|
+
{shipment.data.shipment.shipmentNumber} · selected shipment
|
|
191
|
+
</option>
|
|
192
|
+
)}
|
|
193
|
+
{shipments.data?.shipments.map((row) => (
|
|
194
|
+
<option key={row.id} value={row.id}>
|
|
195
|
+
{row.shipmentNumber} · {row.status}
|
|
196
|
+
</option>
|
|
197
|
+
))}
|
|
198
|
+
</select>
|
|
199
|
+
</label>
|
|
200
|
+
<ReuseState loading={shipments.loading} error={shipments.error} />
|
|
201
|
+
<div className="flex flex-wrap gap-2">
|
|
202
|
+
<Button
|
|
203
|
+
variant="outline"
|
|
204
|
+
disabled={shipmentOffset === 0}
|
|
205
|
+
onClick={() => setShipmentOffset(Math.max(0, shipmentOffset - 25))}
|
|
206
|
+
>
|
|
207
|
+
Previous shipments
|
|
208
|
+
</Button>
|
|
209
|
+
<Button
|
|
210
|
+
variant="outline"
|
|
211
|
+
disabled={!shipments.data || shipmentOffset + 25 >= shipments.data.shipmentsCount}
|
|
212
|
+
onClick={() => setShipmentOffset(shipmentOffset + 25)}
|
|
213
|
+
>
|
|
214
|
+
More shipments
|
|
215
|
+
</Button>
|
|
216
|
+
</div>
|
|
217
|
+
<label className="block">
|
|
218
|
+
Container
|
|
219
|
+
<select
|
|
220
|
+
className={reuseSelect}
|
|
221
|
+
value={containerId}
|
|
222
|
+
onChange={(e) => {
|
|
223
|
+
setContainer(e.target.value);
|
|
224
|
+
setSelectedContainer(
|
|
225
|
+
containers.data?.mtwContainerPage.items.find(
|
|
226
|
+
(row) => row.id === e.target.value
|
|
227
|
+
) ?? null
|
|
228
|
+
);
|
|
229
|
+
setCycle('');
|
|
230
|
+
setCycleOffset(0);
|
|
231
|
+
setDraft(null);
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
<option value="">Choose a container</option>
|
|
235
|
+
{offPageContainer && (
|
|
236
|
+
<option value={offPageContainer.id}>
|
|
237
|
+
{offPageContainer.containerNumber} · {offPageContainer.equipmentType} · selected
|
|
238
|
+
container
|
|
239
|
+
</option>
|
|
240
|
+
)}
|
|
241
|
+
{containers.data?.mtwContainerPage.items.map((row) => (
|
|
242
|
+
<option key={row.id} value={row.id}>
|
|
243
|
+
{row.containerNumber} · {row.equipmentType}
|
|
244
|
+
</option>
|
|
245
|
+
))}
|
|
246
|
+
</select>
|
|
247
|
+
</label>
|
|
248
|
+
<ReuseState loading={containers.loading} error={containers.error} />
|
|
249
|
+
<ReusePager
|
|
250
|
+
offset={containerOffset}
|
|
251
|
+
page={containers.data?.mtwContainerPage}
|
|
252
|
+
busy={paused}
|
|
253
|
+
onChange={setContainerOffset}
|
|
254
|
+
/>
|
|
255
|
+
<label className="block">
|
|
256
|
+
Open cycle for this shipment
|
|
257
|
+
<select
|
|
258
|
+
className={reuseSelect}
|
|
259
|
+
value={cycleId}
|
|
260
|
+
onChange={(e) => {
|
|
261
|
+
setCycle(e.target.value);
|
|
262
|
+
setDraft(null);
|
|
263
|
+
}}
|
|
264
|
+
>
|
|
265
|
+
<option value="">Choose an open cycle</option>
|
|
266
|
+
{cycles.data?.mtwContainerCyclePage.items
|
|
267
|
+
.filter((row) => row.shipmentId === shipmentId && row.status === 'OPEN')
|
|
268
|
+
.map((row) => (
|
|
269
|
+
<option key={row.id} value={row.id}>
|
|
270
|
+
{row.bookingReference ?? 'No booking reference'} · opened{' '}
|
|
271
|
+
{new Date(row.openedAt).toLocaleString()}
|
|
272
|
+
</option>
|
|
273
|
+
))}
|
|
274
|
+
</select>
|
|
275
|
+
</label>
|
|
276
|
+
<ReuseState loading={cycles.loading} error={cycles.error} />
|
|
277
|
+
<ReusePager
|
|
278
|
+
offset={cycleOffset}
|
|
279
|
+
page={cycles.data?.mtwContainerCyclePage}
|
|
280
|
+
busy={paused}
|
|
281
|
+
onChange={(offset) => {
|
|
282
|
+
setCycleOffset(offset);
|
|
283
|
+
setCycle('');
|
|
284
|
+
setDraft(null);
|
|
285
|
+
}}
|
|
286
|
+
/>
|
|
287
|
+
<Field
|
|
288
|
+
label="Plan reference"
|
|
289
|
+
value={reference}
|
|
290
|
+
onChange={(value) => {
|
|
291
|
+
setReference(value);
|
|
292
|
+
setDraft(null);
|
|
293
|
+
}}
|
|
294
|
+
maxLength={120}
|
|
295
|
+
/>
|
|
296
|
+
<ReuseState
|
|
297
|
+
loading={shipment.loading || latest.loading}
|
|
298
|
+
error={shipment.error ?? latest.error}
|
|
299
|
+
/>
|
|
300
|
+
<Button
|
|
301
|
+
disabled={!shipment.data?.shipment || !cycle || !latest.data || paused}
|
|
302
|
+
onClick={() => {
|
|
303
|
+
const row = shipment.data?.shipment;
|
|
304
|
+
if (!row || !cycle) return;
|
|
305
|
+
const context = {
|
|
306
|
+
shipmentId: row.id,
|
|
307
|
+
shipmentUpdatedAt: row.updatedAt,
|
|
308
|
+
cycleId: cycle.id,
|
|
309
|
+
cycleVersion: cycle.version,
|
|
310
|
+
containerId: cycle.containerId,
|
|
311
|
+
};
|
|
312
|
+
setDraft({
|
|
313
|
+
context,
|
|
314
|
+
previous,
|
|
315
|
+
generation: crypto.randomUUID(),
|
|
316
|
+
pin: {
|
|
317
|
+
shipmentId: row.id,
|
|
318
|
+
cycleId: cycle.id,
|
|
319
|
+
planReference: reference.trim(),
|
|
320
|
+
expectedShipmentUpdatedAt: row.updatedAt,
|
|
321
|
+
expectedCycleVersion: cycle.version,
|
|
322
|
+
expectedPreviousVersionId: previous?.id ?? null,
|
|
323
|
+
expectedVersion: previous?.version ?? 0,
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
setError(null);
|
|
327
|
+
}}
|
|
328
|
+
>
|
|
329
|
+
Review sources and start a new plan
|
|
330
|
+
</Button>
|
|
331
|
+
</fieldset>
|
|
332
|
+
{draft && (
|
|
333
|
+
<>
|
|
334
|
+
<p>Unsent fields are reset when you explicitly start another plan.</p>
|
|
335
|
+
{changed && (
|
|
336
|
+
<p role="alert">Source context changed. Review it again before recording.</p>
|
|
337
|
+
)}
|
|
338
|
+
<ConsolidationPlanForm
|
|
339
|
+
key={draft.generation}
|
|
340
|
+
pin={draft.pin}
|
|
341
|
+
busy={
|
|
342
|
+
paused ||
|
|
343
|
+
changed ||
|
|
344
|
+
shipment.loading ||
|
|
345
|
+
cycles.loading ||
|
|
346
|
+
latest.loading ||
|
|
347
|
+
!!shipment.error ||
|
|
348
|
+
!!cycles.error ||
|
|
349
|
+
!!latest.error
|
|
350
|
+
}
|
|
351
|
+
onSave={async (input) => {
|
|
352
|
+
try {
|
|
353
|
+
await save(input);
|
|
354
|
+
} catch (f) {
|
|
355
|
+
setError(f instanceof Error ? f.message : 'Unable to save.');
|
|
356
|
+
throw f;
|
|
357
|
+
}
|
|
358
|
+
}}
|
|
359
|
+
/>
|
|
360
|
+
</>
|
|
361
|
+
)}
|
|
362
|
+
{error && <p role="alert">{error}</p>}
|
|
363
|
+
</section>
|
|
364
|
+
<section className={reuseCard}>
|
|
365
|
+
<h2 className="text-lg font-semibold">Plan history</h2>
|
|
366
|
+
<ReuseState loading={history.loading} error={history.error} />
|
|
367
|
+
{history.data?.mtwConsolidationPlanPage.items.map((row) => (
|
|
368
|
+
<Button
|
|
369
|
+
key={row.id}
|
|
370
|
+
variant={selected === row.id ? 'default' : 'outline'}
|
|
371
|
+
disabled={paused}
|
|
372
|
+
onClick={() => setSelected(row.id)}
|
|
373
|
+
>
|
|
374
|
+
{row.planReference} · version {row.version} · {row.facts.hubName}
|
|
375
|
+
</Button>
|
|
376
|
+
))}
|
|
377
|
+
<ReusePager
|
|
378
|
+
offset={historyOffset}
|
|
379
|
+
page={history.data?.mtwConsolidationPlanPage}
|
|
380
|
+
busy={paused}
|
|
381
|
+
onChange={setHistoryOffset}
|
|
382
|
+
/>
|
|
383
|
+
<ReuseState loading={exact.loading} error={exact.error} />
|
|
384
|
+
{exact.data && <ConsolidationPlanHistory plan={exact.data.mtwConsolidationPlan} />}
|
|
385
|
+
</section>
|
|
386
|
+
{exact.data && (
|
|
387
|
+
<ConsolidationReportsWorkbench
|
|
388
|
+
key={exact.data.mtwConsolidationPlan.id}
|
|
389
|
+
plan={exact.data.mtwConsolidationPlan}
|
|
390
|
+
actions={actions}
|
|
391
|
+
/>
|
|
392
|
+
)}
|
|
393
|
+
</div>
|
|
394
|
+
);
|
|
395
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
ConsolidationPlanQuery,
|
|
4
|
+
RecordMtwConsolidationObservationInput,
|
|
5
|
+
} from '../../../generated/consolidation-operations';
|
|
6
|
+
import { ContainerEvidencePicker, type SelectedEvidence } from '../ContainerEvidencePicker';
|
|
7
|
+
import { ProcedureField as Field } from '../logistics-procedure/ProcedureFields';
|
|
8
|
+
import {
|
|
9
|
+
consolidationInstant,
|
|
10
|
+
consolidationQuantity,
|
|
11
|
+
nullableText,
|
|
12
|
+
} from '../../utils/consolidationInput';
|
|
13
|
+
import { Button } from '../ui';
|
|
14
|
+
export type ConsolidationReportPin = Omit<
|
|
15
|
+
RecordMtwConsolidationObservationInput,
|
|
16
|
+
'reportedQuantity' | 'reportedObservedAt' | 'reason' | 'source' | 'evidence' | 'idempotencyKey'
|
|
17
|
+
>;
|
|
18
|
+
export function ConsolidationReportForm({
|
|
19
|
+
pin,
|
|
20
|
+
lot,
|
|
21
|
+
busy,
|
|
22
|
+
onSave,
|
|
23
|
+
}: {
|
|
24
|
+
pin: ConsolidationReportPin;
|
|
25
|
+
lot: ConsolidationPlanQuery['mtwConsolidationPlan']['facts']['lots'][number];
|
|
26
|
+
busy: boolean;
|
|
27
|
+
onSave: (input: Omit<RecordMtwConsolidationObservationInput, 'idempotencyKey'>) => Promise<void>;
|
|
28
|
+
}) {
|
|
29
|
+
const [quantity, setQuantity] = useState(''),
|
|
30
|
+
[observed, setObserved] = useState(''),
|
|
31
|
+
[reason, setReason] = useState(''),
|
|
32
|
+
[reference, setReference] = useState(''),
|
|
33
|
+
[revision, setRevision] = useState(''),
|
|
34
|
+
[evidence, setEvidence] = useState<SelectedEvidence[]>([]),
|
|
35
|
+
[error, setError] = useState<string | null>(null);
|
|
36
|
+
const issue = pin.kind === 'ISSUE';
|
|
37
|
+
return (
|
|
38
|
+
<form
|
|
39
|
+
className="space-y-3"
|
|
40
|
+
onSubmit={(event) => {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
if (busy) return;
|
|
43
|
+
setError(null);
|
|
44
|
+
void (async () => {
|
|
45
|
+
if (!issue && (evidence.length < 1 || evidence.length > 10))
|
|
46
|
+
throw new Error('Choose one to ten evidence versions for this cumulative report.');
|
|
47
|
+
await onSave({
|
|
48
|
+
...pin,
|
|
49
|
+
reportedQuantity: issue ? null : consolidationQuantity(quantity),
|
|
50
|
+
reportedObservedAt: observed ? consolidationInstant(observed) : null,
|
|
51
|
+
reason: reason.trim(),
|
|
52
|
+
source: { reference: nullableText(reference), revision: nullableText(revision) },
|
|
53
|
+
evidence: evidence.map(({ fileId, versionId }) => ({ fileId, versionId })),
|
|
54
|
+
});
|
|
55
|
+
})().catch((f) => setError(f instanceof Error ? f.message : 'Unable to record report.'));
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<fieldset disabled={busy} className="space-y-3">
|
|
59
|
+
<p>
|
|
60
|
+
{lot.supplierReference} · {lot.lotReference} · {lot.unitReference ?? 'Unknown unit'} (
|
|
61
|
+
{lot.unitRevision ?? 'Unknown revision'})
|
|
62
|
+
</p>
|
|
63
|
+
{issue ? (
|
|
64
|
+
<p>
|
|
65
|
+
This is an unresolved reported issue. It contributes no quantity and does not resolve
|
|
66
|
+
earlier issues.
|
|
67
|
+
</p>
|
|
68
|
+
) : (
|
|
69
|
+
<>
|
|
70
|
+
<p>
|
|
71
|
+
Enter the new cumulative total, not an additional increment. It replaces the previous
|
|
72
|
+
total for this lot and report kind. Blank means unknown.
|
|
73
|
+
</p>
|
|
74
|
+
<Field
|
|
75
|
+
required={false}
|
|
76
|
+
label="Reported cumulative quantity"
|
|
77
|
+
value={quantity}
|
|
78
|
+
onChange={setQuantity}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
82
|
+
<Field
|
|
83
|
+
label="Reason / reported discrepancy"
|
|
84
|
+
value={reason}
|
|
85
|
+
maxLength={2000}
|
|
86
|
+
onChange={setReason}
|
|
87
|
+
/>
|
|
88
|
+
<Field
|
|
89
|
+
label="Observed at (local time, optional)"
|
|
90
|
+
type="datetime-local"
|
|
91
|
+
required={false}
|
|
92
|
+
value={observed}
|
|
93
|
+
onChange={setObserved}
|
|
94
|
+
/>
|
|
95
|
+
<Field
|
|
96
|
+
label="Report source reference"
|
|
97
|
+
required={false}
|
|
98
|
+
value={reference}
|
|
99
|
+
onChange={setReference}
|
|
100
|
+
/>
|
|
101
|
+
<Field
|
|
102
|
+
label="Report source revision"
|
|
103
|
+
required={false}
|
|
104
|
+
value={revision}
|
|
105
|
+
onChange={setRevision}
|
|
106
|
+
/>
|
|
107
|
+
{issue ? (
|
|
108
|
+
<p>
|
|
109
|
+
Urgent issues can be recorded without Files access. This form submits no file
|
|
110
|
+
declarations for issues.
|
|
111
|
+
</p>
|
|
112
|
+
) : (
|
|
113
|
+
<ContainerEvidencePicker
|
|
114
|
+
value={evidence}
|
|
115
|
+
onChange={setEvidence}
|
|
116
|
+
description="Exact source evidence is checked when recording. A report remains an unverified operator declaration."
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
{error && <p role="alert">{error}</p>}
|
|
120
|
+
<Button type="submit">Record {issue ? 'unresolved issue' : 'replacement total'}</Button>
|
|
121
|
+
</fieldset>
|
|
122
|
+
</form>
|
|
123
|
+
);
|
|
124
|
+
}
|