@burdenoff/microfe-movethewheels 2026.930.5 → 2026.1010.2
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/useMultiModalShipments.js +1 -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/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 +20 -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/useMultiModalShipments.ts +2 -1
- 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/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,299 @@
|
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
import { ClipboardList } from 'lucide-react';
|
|
3
|
+
import { PageLayout } from '../components/PageLayout';
|
|
4
|
+
import { Button } from '../components/ui';
|
|
5
|
+
import { PinnedSelect, ReusePager, ReuseState, reuseCard } from '../components/ReuseControls';
|
|
6
|
+
import { StockAssessmentDraft } from '../components/stock-binding/StockAssessmentDraft';
|
|
7
|
+
import { StockAssessmentHistory } from '../components/stock-binding/StockAssessmentHistory';
|
|
8
|
+
import { useMoveTheWheels } from '../providers/MoveTheWheelsProvider';
|
|
9
|
+
import { useConditionApi, useConditionQuery } from '../hooks/useContainerCondition';
|
|
10
|
+
import { useEmptyReuseAction } from '../hooks/useEmptyReuseAction';
|
|
11
|
+
import {
|
|
12
|
+
stockContextLabel,
|
|
13
|
+
stockDraftPin,
|
|
14
|
+
stockContextMatches,
|
|
15
|
+
inputForStockDraft,
|
|
16
|
+
type StockDraftPin,
|
|
17
|
+
type StockFactDraft,
|
|
18
|
+
} from '../utils/stockBindingForm';
|
|
19
|
+
import {
|
|
20
|
+
StockBindingInventoryDocument,
|
|
21
|
+
StockBindingContextDocument,
|
|
22
|
+
StockBindingHistoryDocument,
|
|
23
|
+
StockBindingExactDocument,
|
|
24
|
+
RecordStockBindingDocument,
|
|
25
|
+
type StockBindingInventoryQuery,
|
|
26
|
+
type StockBindingContextQuery,
|
|
27
|
+
type StockBindingHistoryQuery,
|
|
28
|
+
type StockBindingExactQuery,
|
|
29
|
+
type RecordStockBindingMutation,
|
|
30
|
+
type StockAssessmentFragment,
|
|
31
|
+
} from '../../generated/stock-binding-operations';
|
|
32
|
+
export default function StockBindingPage() {
|
|
33
|
+
const { workspaceId, tenantId, currentUser, apiGatewayUrl } = useMoveTheWheels();
|
|
34
|
+
return (
|
|
35
|
+
<PageLayout
|
|
36
|
+
title="Inventory source assessments"
|
|
37
|
+
subtitle="Recorded units, item labels and lot facts."
|
|
38
|
+
icon={<ClipboardList aria-hidden="true" />}
|
|
39
|
+
>
|
|
40
|
+
<StockBindingWorkbench
|
|
41
|
+
key={`${workspaceId}:${tenantId}:${currentUser?.id}:${apiGatewayUrl}`}
|
|
42
|
+
/>
|
|
43
|
+
</PageLayout>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function StockBindingWorkbench() {
|
|
47
|
+
const [inventoryOffset, setInventoryOffset] = useState(0);
|
|
48
|
+
const [historyOffset, setHistoryOffset] = useState(0);
|
|
49
|
+
const [selection, setSelection] = useState<{ id: string; label: string } | null>(null);
|
|
50
|
+
const [pin, setPin] = useState<(StockDraftPin & { generation: string }) | null>(null);
|
|
51
|
+
const [mismatch, setMismatch] = useState(false);
|
|
52
|
+
const [selected, setSelected] = useState<StockAssessmentFragment | null>(null);
|
|
53
|
+
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
54
|
+
const [checking, setChecking] = useState(false);
|
|
55
|
+
const checkingNow = useRef(false);
|
|
56
|
+
const [error, setError] = useState<string | null>(null);
|
|
57
|
+
const request = useConditionApi();
|
|
58
|
+
const actions = useEmptyReuseAction();
|
|
59
|
+
const inventory = useConditionQuery<StockBindingInventoryQuery>(
|
|
60
|
+
StockBindingInventoryDocument,
|
|
61
|
+
{ pagination: { limit: 25, offset: inventoryOffset } },
|
|
62
|
+
actions.revision
|
|
63
|
+
);
|
|
64
|
+
const current = useConditionQuery<StockBindingContextQuery>(
|
|
65
|
+
StockBindingContextDocument,
|
|
66
|
+
selection ? { id: selection.id } : null,
|
|
67
|
+
actions.revision
|
|
68
|
+
);
|
|
69
|
+
const head = useConditionQuery<StockBindingHistoryQuery>(
|
|
70
|
+
StockBindingHistoryDocument,
|
|
71
|
+
selection ? { inventoryItemId: selection.id, pagination: { limit: 1, offset: 0 } } : null,
|
|
72
|
+
actions.revision
|
|
73
|
+
);
|
|
74
|
+
const history = useConditionQuery<StockBindingHistoryQuery>(
|
|
75
|
+
StockBindingHistoryDocument,
|
|
76
|
+
selection
|
|
77
|
+
? { inventoryItemId: selection.id, pagination: { limit: 25, offset: historyOffset } }
|
|
78
|
+
: null,
|
|
79
|
+
actions.revision
|
|
80
|
+
);
|
|
81
|
+
const exact = useConditionQuery<StockBindingExactQuery>(
|
|
82
|
+
StockBindingExactDocument,
|
|
83
|
+
selection && selectedId ? { inventoryItemId: selection.id, id: selectedId } : null,
|
|
84
|
+
actions.revision
|
|
85
|
+
);
|
|
86
|
+
const row = current.data?.inventoryItem;
|
|
87
|
+
const predecessor = head.data?.mtwStockBindingAssessmentPage.items[0] ?? null;
|
|
88
|
+
const contextReady =
|
|
89
|
+
!!row && !!head.data && (!head.data.mtwStockBindingAssessmentPage.total || !!predecessor);
|
|
90
|
+
const busy = actions.busy || checking;
|
|
91
|
+
const displayedMismatch =
|
|
92
|
+
!!pin && !!current.data && !!head.data && !stockContextMatches(pin, row, predecessor);
|
|
93
|
+
const options =
|
|
94
|
+
inventory.data?.inventoryItems.map((item) => ({
|
|
95
|
+
id: item.id,
|
|
96
|
+
label: stockContextLabel(item),
|
|
97
|
+
})) ?? [];
|
|
98
|
+
if (selection && !options.some((item) => item.id === selection.id))
|
|
99
|
+
options.unshift({ ...selection, label: `${selection.label} — selected outside this page` });
|
|
100
|
+
const inventoryPage = inventory.data
|
|
101
|
+
? {
|
|
102
|
+
total: inventory.data.inventoryItemsCount,
|
|
103
|
+
limit: 25,
|
|
104
|
+
offset: inventoryOffset,
|
|
105
|
+
hasMore:
|
|
106
|
+
inventoryOffset + inventory.data.inventoryItems.length <
|
|
107
|
+
inventory.data.inventoryItemsCount,
|
|
108
|
+
nextOffset: inventoryOffset + 25,
|
|
109
|
+
}
|
|
110
|
+
: undefined;
|
|
111
|
+
const record = async (draft: StockFactDraft) => {
|
|
112
|
+
if (checkingNow.current) return;
|
|
113
|
+
if (!pin || actions.uncertain)
|
|
114
|
+
throw new Error(
|
|
115
|
+
'Review a new draft context or resolve the original uncertain request first.'
|
|
116
|
+
);
|
|
117
|
+
const captured = pin;
|
|
118
|
+
checkingNow.current = true;
|
|
119
|
+
setChecking(true);
|
|
120
|
+
setError(null);
|
|
121
|
+
try {
|
|
122
|
+
const fresh = await request<StockBindingContextQuery>(StockBindingContextDocument, {
|
|
123
|
+
id: captured.inventoryItemId,
|
|
124
|
+
});
|
|
125
|
+
const latest = await request<StockBindingHistoryQuery>(StockBindingHistoryDocument, {
|
|
126
|
+
inventoryItemId: captured.inventoryItemId,
|
|
127
|
+
pagination: { limit: 1, offset: 0 },
|
|
128
|
+
});
|
|
129
|
+
const latestPage = latest.mtwStockBindingAssessmentPage;
|
|
130
|
+
if (latestPage.total > 0 && !latestPage.items[0])
|
|
131
|
+
throw new Error('Last recorded assessment is unavailable.');
|
|
132
|
+
const latestPredecessor = latestPage.items[0] ?? null;
|
|
133
|
+
if (!stockContextMatches(captured, fresh.inventoryItem, latestPredecessor)) setMismatch(true);
|
|
134
|
+
const input = inputForStockDraft(draft, captured, fresh.inventoryItem, latestPredecessor);
|
|
135
|
+
const result = await actions.run<RecordStockBindingMutation>(
|
|
136
|
+
RecordStockBindingDocument,
|
|
137
|
+
input,
|
|
138
|
+
'Reported facts recorded.'
|
|
139
|
+
);
|
|
140
|
+
if (result) {
|
|
141
|
+
setSelected(result.recordMtwStockBindingAssessment);
|
|
142
|
+
setSelectedId(null);
|
|
143
|
+
setHistoryOffset(0);
|
|
144
|
+
setPin(null);
|
|
145
|
+
}
|
|
146
|
+
} catch (failure) {
|
|
147
|
+
setError(
|
|
148
|
+
failure instanceof Error
|
|
149
|
+
? failure.message
|
|
150
|
+
: 'Unable to verify the captured inventory context.'
|
|
151
|
+
);
|
|
152
|
+
throw failure;
|
|
153
|
+
} finally {
|
|
154
|
+
checkingNow.current = false;
|
|
155
|
+
setChecking(false);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const start = () => {
|
|
159
|
+
if (!contextReady || !row) return;
|
|
160
|
+
try {
|
|
161
|
+
setPin({ ...stockDraftPin(row, predecessor), generation: crypto.randomUUID() });
|
|
162
|
+
setMismatch(false);
|
|
163
|
+
setError(null);
|
|
164
|
+
} catch (failure) {
|
|
165
|
+
setError(failure instanceof Error ? failure.message : 'Current context is unavailable.');
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return (
|
|
169
|
+
<div className="min-w-0 space-y-6 break-words">
|
|
170
|
+
<p className="rounded border p-4 text-sm">
|
|
171
|
+
Record the units, labels and lot facts reported for this stock line. Review any missing
|
|
172
|
+
facts before planning a pick. This page records source history; picking remains a separate
|
|
173
|
+
workflow.
|
|
174
|
+
</p>
|
|
175
|
+
<section className={reuseCard} aria-label="Choose current inventory context">
|
|
176
|
+
<h2 className="text-lg font-semibold">Inventory line and current owners</h2>
|
|
177
|
+
<PinnedSelect
|
|
178
|
+
label="Warehouse / cargo SKU / bin"
|
|
179
|
+
value={selection?.id ?? ''}
|
|
180
|
+
disabled={busy || actions.uncertain}
|
|
181
|
+
options={options}
|
|
182
|
+
onChange={(id) => {
|
|
183
|
+
const item = inventory.data?.inventoryItems.find((value) => value.id === id);
|
|
184
|
+
setSelection(item ? { id: item.id, label: stockContextLabel(item) } : null);
|
|
185
|
+
setPin(null);
|
|
186
|
+
setMismatch(false);
|
|
187
|
+
setSelected(null);
|
|
188
|
+
setSelectedId(null);
|
|
189
|
+
setHistoryOffset(0);
|
|
190
|
+
setError(null);
|
|
191
|
+
actions.discardAttempt();
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
<ReuseState {...inventory} />
|
|
195
|
+
<ReusePager
|
|
196
|
+
page={inventoryPage}
|
|
197
|
+
offset={inventoryOffset}
|
|
198
|
+
onChange={setInventoryOffset}
|
|
199
|
+
busy={busy || inventory.loading}
|
|
200
|
+
/>
|
|
201
|
+
<ReuseState {...current} />
|
|
202
|
+
<ReuseState {...head} />
|
|
203
|
+
{row && (
|
|
204
|
+
<div className="space-y-2">
|
|
205
|
+
<p>
|
|
206
|
+
{stockContextLabel(row)}. Warehouse status {row.warehouse?.status ?? 'UNKNOWN'}; bin
|
|
207
|
+
status{' '}
|
|
208
|
+
{row.locationId === null ? 'Unbinned' : (row.location?.status ?? 'Unavailable')}.
|
|
209
|
+
</p>
|
|
210
|
+
<p>
|
|
211
|
+
Current balance: on hand {row.onHand}, available {row.available}, allocated{' '}
|
|
212
|
+
{row.allocated}, damaged {row.damaged}.
|
|
213
|
+
</p>
|
|
214
|
+
|
|
215
|
+
<p>
|
|
216
|
+
Last recorded assessment{' '}
|
|
217
|
+
{predecessor
|
|
218
|
+
? `version ${predecessor.version}, effective ${predecessor.effectiveAt}`
|
|
219
|
+
: 'none'}
|
|
220
|
+
. Future effective dates stay in recorded order.
|
|
221
|
+
</p>
|
|
222
|
+
</div>
|
|
223
|
+
)}
|
|
224
|
+
{selection && !row && !current.loading && (
|
|
225
|
+
<p>
|
|
226
|
+
This stock line is unavailable for new facts. You can still read its recorded history.
|
|
227
|
+
</p>
|
|
228
|
+
)}
|
|
229
|
+
<Button
|
|
230
|
+
type="button"
|
|
231
|
+
variant="outline"
|
|
232
|
+
disabled={busy}
|
|
233
|
+
onClick={() => {
|
|
234
|
+
setMismatch(false);
|
|
235
|
+
setError(null);
|
|
236
|
+
actions.refresh();
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
Refresh current context and history
|
|
240
|
+
</Button>
|
|
241
|
+
</section>
|
|
242
|
+
{selection && (
|
|
243
|
+
<>
|
|
244
|
+
<StockAssessmentDraft
|
|
245
|
+
pin={pin}
|
|
246
|
+
mismatch={mismatch || displayedMismatch}
|
|
247
|
+
uncertain={actions.uncertain}
|
|
248
|
+
startDisabled={
|
|
249
|
+
busy ||
|
|
250
|
+
actions.uncertain ||
|
|
251
|
+
mismatch ||
|
|
252
|
+
current.loading ||
|
|
253
|
+
head.loading ||
|
|
254
|
+
!contextReady
|
|
255
|
+
}
|
|
256
|
+
formDisabled={
|
|
257
|
+
busy || actions.uncertain || current.loading || head.loading || !contextReady
|
|
258
|
+
}
|
|
259
|
+
onStart={start}
|
|
260
|
+
onSubmit={record}
|
|
261
|
+
/>
|
|
262
|
+
<StockAssessmentHistory
|
|
263
|
+
current={current.loading || current.error ? null : row}
|
|
264
|
+
query={history}
|
|
265
|
+
offset={historyOffset}
|
|
266
|
+
onPage={setHistoryOffset}
|
|
267
|
+
busy={busy}
|
|
268
|
+
selected={selectedId ? (exact.data?.mtwStockBindingAssessment ?? null) : selected}
|
|
269
|
+
onSelect={(item) => {
|
|
270
|
+
setSelected(null);
|
|
271
|
+
setSelectedId(item.id);
|
|
272
|
+
}}
|
|
273
|
+
/>
|
|
274
|
+
{selectedId && <ReuseState {...exact} />}
|
|
275
|
+
</>
|
|
276
|
+
)}
|
|
277
|
+
{error && <p role="alert">{error}</p>}
|
|
278
|
+
{actions.error && <p role="alert">{actions.error}</p>}
|
|
279
|
+
{actions.notice && <p role="status">{actions.notice}</p>}
|
|
280
|
+
{actions.uncertain && (
|
|
281
|
+
<div className="space-y-3 rounded border p-4">
|
|
282
|
+
<p>
|
|
283
|
+
Check refreshed history first. Retry sends the same submitted facts for the original
|
|
284
|
+
stock line. This retry is available until you leave or reload this page.
|
|
285
|
+
</p>
|
|
286
|
+
<Button type="button" variant="outline" disabled={busy} onClick={actions.refresh}>
|
|
287
|
+
Refresh assessment history
|
|
288
|
+
</Button>
|
|
289
|
+
<Button type="button" disabled={busy} onClick={actions.retryOriginal}>
|
|
290
|
+
Retry original request
|
|
291
|
+
</Button>
|
|
292
|
+
<Button type="button" variant="outline" disabled={busy} onClick={actions.discardAttempt}>
|
|
293
|
+
Discard retry after checking history
|
|
294
|
+
</Button>
|
|
295
|
+
</div>
|
|
296
|
+
)}
|
|
297
|
+
</div>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { ClipboardList } from 'lucide-react';
|
|
3
|
+
import { PageLayout } from '../components/PageLayout';
|
|
4
|
+
import { Button, Input } from '../components/ui';
|
|
5
|
+
import { PinnedSelect, ReusePager, ReuseState, reuseCard } from '../components/ReuseControls';
|
|
6
|
+
import { StockIssueForm } from '../components/stock-observation/StockIssueForm';
|
|
7
|
+
import { StockIssueReadPanel } from '../components/stock-observation/StockIssueReadPanel';
|
|
8
|
+
import { useMoveTheWheels } from '../providers/MoveTheWheelsProvider';
|
|
9
|
+
import { useConditionQuery } from '../hooks/useContainerCondition';
|
|
10
|
+
import { useEmptyReuseAction } from '../hooks/useEmptyReuseAction';
|
|
11
|
+
import {
|
|
12
|
+
ObservationInventoryDocument,
|
|
13
|
+
RecordStockIssueDocument,
|
|
14
|
+
type ObservationInventoryQuery,
|
|
15
|
+
type RecordStockIssueMutation,
|
|
16
|
+
type RecordMtwStockObservationInput,
|
|
17
|
+
} from '../../generated/stock-observation-operations';
|
|
18
|
+
|
|
19
|
+
export default function StockObservationsPage() {
|
|
20
|
+
const { workspaceId, tenantId, currentUser, apiGatewayUrl } = useMoveTheWheels();
|
|
21
|
+
return (
|
|
22
|
+
<PageLayout
|
|
23
|
+
title="Reported stock issues"
|
|
24
|
+
subtitle="Record an unresolved operational observation."
|
|
25
|
+
icon={<ClipboardList aria-hidden="true" />}
|
|
26
|
+
>
|
|
27
|
+
<p className="mb-4 text-sm">
|
|
28
|
+
Changing workspace or user clears this draft. Check recorded history before starting again.
|
|
29
|
+
</p>
|
|
30
|
+
<ObservationWorkbench
|
|
31
|
+
key={`${workspaceId}:${tenantId}:${currentUser?.id}:${apiGatewayUrl}`}
|
|
32
|
+
/>
|
|
33
|
+
</PageLayout>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function ObservationWorkbench() {
|
|
37
|
+
const actions = useEmptyReuseAction();
|
|
38
|
+
const [offset, setOffset] = useState(0);
|
|
39
|
+
const [selection, setSelection] = useState<{ id: string; label: string } | null>(null);
|
|
40
|
+
const [knownId, setKnownId] = useState('');
|
|
41
|
+
const [generation, setGeneration] = useState(0);
|
|
42
|
+
const inventory = useConditionQuery<ObservationInventoryQuery>(
|
|
43
|
+
ObservationInventoryDocument,
|
|
44
|
+
{ pagination: { limit: 25, offset } },
|
|
45
|
+
actions.revision
|
|
46
|
+
);
|
|
47
|
+
const locked = actions.busy || actions.uncertain;
|
|
48
|
+
const options =
|
|
49
|
+
inventory.data?.inventoryItems.map((item) => ({
|
|
50
|
+
id: item.id,
|
|
51
|
+
label: `${item.cargoItem?.name ?? 'Item name not recorded'} · ${item.cargoItem?.sku ?? 'SKU not recorded'} · ${item.warehouse?.name ?? 'Warehouse not recorded'} · ${item.location?.locationCode ?? 'No bin'} · line ${item.id}`,
|
|
52
|
+
})) ?? [];
|
|
53
|
+
if (selection && !options.some((item) => item.id === selection.id)) options.unshift(selection);
|
|
54
|
+
const select = (id: string) => {
|
|
55
|
+
if (locked) return;
|
|
56
|
+
const option = options.find((item) => item.id === id);
|
|
57
|
+
setSelection(id ? (option ?? { id, label: `Known inventory line ${id}` }) : null);
|
|
58
|
+
setGeneration((value) => value + 1);
|
|
59
|
+
};
|
|
60
|
+
const save = async (input: Omit<RecordMtwStockObservationInput, 'idempotencyKey'>) => {
|
|
61
|
+
if (!selection || input.inventoryItemId !== selection.id || locked) return;
|
|
62
|
+
const result = await actions.run<RecordStockIssueMutation>(
|
|
63
|
+
RecordStockIssueDocument,
|
|
64
|
+
{ ...input },
|
|
65
|
+
'Unresolved issue recorded.'
|
|
66
|
+
);
|
|
67
|
+
if (result) {
|
|
68
|
+
setGeneration((value) => value + 1);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const inventoryPage = inventory.data
|
|
72
|
+
? {
|
|
73
|
+
total: inventory.data.inventoryItemsCount,
|
|
74
|
+
limit: 25,
|
|
75
|
+
offset,
|
|
76
|
+
hasMore: offset + inventory.data.inventoryItems.length < inventory.data.inventoryItemsCount,
|
|
77
|
+
nextOffset: offset + 25,
|
|
78
|
+
}
|
|
79
|
+
: undefined;
|
|
80
|
+
return (
|
|
81
|
+
<div className="space-y-5">
|
|
82
|
+
<div className={reuseCard}>
|
|
83
|
+
<p>
|
|
84
|
+
Reports do not change stock quantities or authorize picking. Unknown fields can remain
|
|
85
|
+
blank, including while evidence services are unavailable.
|
|
86
|
+
</p>
|
|
87
|
+
<ReuseState loading={inventory.loading} error={inventory.error} />
|
|
88
|
+
<PinnedSelect
|
|
89
|
+
label="Inventory line"
|
|
90
|
+
value={selection?.id ?? ''}
|
|
91
|
+
options={options}
|
|
92
|
+
onChange={select}
|
|
93
|
+
disabled={locked}
|
|
94
|
+
/>
|
|
95
|
+
<ReusePager page={inventoryPage} offset={offset} onChange={setOffset} busy={locked} />
|
|
96
|
+
<details>
|
|
97
|
+
<summary>Use a known inventory line reference</summary>
|
|
98
|
+
<p className="text-sm">
|
|
99
|
+
For an off-page or previously retired line, use its exact reference. This is not an
|
|
100
|
+
archive browser.
|
|
101
|
+
</p>
|
|
102
|
+
<label>
|
|
103
|
+
Exact inventory line reference
|
|
104
|
+
<Input
|
|
105
|
+
value={knownId}
|
|
106
|
+
maxLength={255}
|
|
107
|
+
disabled={locked}
|
|
108
|
+
onChange={(event) => setKnownId(event.target.value)}
|
|
109
|
+
/>
|
|
110
|
+
</label>
|
|
111
|
+
<Button
|
|
112
|
+
type="button"
|
|
113
|
+
variant="outline"
|
|
114
|
+
disabled={locked || !knownId.trim()}
|
|
115
|
+
onClick={() => select(knownId.trim())}
|
|
116
|
+
>
|
|
117
|
+
Select known line
|
|
118
|
+
</Button>
|
|
119
|
+
</details>
|
|
120
|
+
{selection && (
|
|
121
|
+
<div className="text-sm space-y-1">
|
|
122
|
+
<p className="break-words">Selected: {selection.label}</p>
|
|
123
|
+
<p className="break-all">Exact inventory line reference: {selection.id}</p>
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
</div>
|
|
127
|
+
{selection && (
|
|
128
|
+
<section className={reuseCard}>
|
|
129
|
+
<h2 className="text-lg font-semibold">Report an issue</h2>
|
|
130
|
+
<StockIssueForm
|
|
131
|
+
key={`${selection.id}:${generation}`}
|
|
132
|
+
inventoryItemId={selection.id}
|
|
133
|
+
disabled={locked}
|
|
134
|
+
onSubmit={save}
|
|
135
|
+
/>
|
|
136
|
+
</section>
|
|
137
|
+
)}
|
|
138
|
+
<div className={reuseCard}>
|
|
139
|
+
{actions.error && <p role="alert">{actions.error}</p>}
|
|
140
|
+
{actions.notice && <p role="status">{actions.notice}</p>}
|
|
141
|
+
<Button type="button" variant="outline" disabled={actions.busy} onClick={actions.refresh}>
|
|
142
|
+
Refresh history
|
|
143
|
+
</Button>
|
|
144
|
+
{actions.uncertain && (
|
|
145
|
+
<div className="space-y-3">
|
|
146
|
+
<p>
|
|
147
|
+
The save result is uncertain. Check history, then retry the original request or
|
|
148
|
+
explicitly abandon it before starting a different report.
|
|
149
|
+
</p>
|
|
150
|
+
<Button
|
|
151
|
+
type="button"
|
|
152
|
+
disabled={actions.busy}
|
|
153
|
+
onClick={() => void actions.retryOriginal()}
|
|
154
|
+
>
|
|
155
|
+
Retry original request
|
|
156
|
+
</Button>
|
|
157
|
+
<Button
|
|
158
|
+
type="button"
|
|
159
|
+
variant="outline"
|
|
160
|
+
disabled={actions.busy}
|
|
161
|
+
onClick={() => {
|
|
162
|
+
actions.discardAttempt();
|
|
163
|
+
setGeneration((value) => value + 1);
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
Abandon original request
|
|
167
|
+
</Button>
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
</div>
|
|
171
|
+
{selection && (
|
|
172
|
+
<StockIssueReadPanel
|
|
173
|
+
key={`${selection.id}:${generation}`}
|
|
174
|
+
inventoryItemId={selection.id}
|
|
175
|
+
revision={actions.revision}
|
|
176
|
+
busy={actions.busy}
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
}
|