@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,490 @@
|
|
|
1
|
+
import { useState, type FormEvent } from 'react';
|
|
2
|
+
import { Boxes, RefreshCw } from 'lucide-react';
|
|
3
|
+
import { PageLayout } from '../components/PageLayout';
|
|
4
|
+
import { Button, Input, Label } from '../components/ui';
|
|
5
|
+
import { useMoveTheWheels } from '../providers/MoveTheWheelsProvider';
|
|
6
|
+
import {
|
|
7
|
+
CONTAINER_EVENT_TYPES,
|
|
8
|
+
EQUIPMENT_TYPES,
|
|
9
|
+
useContainerLifecycle,
|
|
10
|
+
type ContainerEventKind,
|
|
11
|
+
type ContainerEventType,
|
|
12
|
+
type EquipmentType,
|
|
13
|
+
} from '../hooks/useContainerLifecycle';
|
|
14
|
+
|
|
15
|
+
function readable(value: string): string {
|
|
16
|
+
return value.replaceAll('_', ' ');
|
|
17
|
+
}
|
|
18
|
+
function formatTime(value: string): string {
|
|
19
|
+
return new Date(value).toLocaleString();
|
|
20
|
+
}
|
|
21
|
+
const selectClass = 'w-full rounded-md border bg-bg-surface p-2 text-sm';
|
|
22
|
+
const sectionClass = 'rounded-xl border bg-bg-surface p-5 space-y-4';
|
|
23
|
+
|
|
24
|
+
/** Remount on identity/workspace changes so previous workspace records never flash. */
|
|
25
|
+
export default function ContainersPage() {
|
|
26
|
+
const { workspaceId, currentUser } = useMoveTheWheels();
|
|
27
|
+
return <ContainerWorkbench key={`${workspaceId ?? ''}:${currentUser?.id ?? ''}`} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ContainerWorkbench() {
|
|
31
|
+
const data = useContainerLifecycle();
|
|
32
|
+
const [number, setNumber] = useState('');
|
|
33
|
+
const [equipmentType, setEquipmentType] = useState<EquipmentType>('DRY_20');
|
|
34
|
+
const [ownerName, setOwnerName] = useState('');
|
|
35
|
+
const [source, setSource] = useState('');
|
|
36
|
+
const [booking, setBooking] = useState('');
|
|
37
|
+
const [openingTime, setOpeningTime] = useState('');
|
|
38
|
+
const [eventType, setEventType] = useState<ContainerEventType>('GATE_OUT');
|
|
39
|
+
const [kind, setKind] = useState<ContainerEventKind>('ACTUAL');
|
|
40
|
+
const [eventTime, setEventTime] = useState('');
|
|
41
|
+
const [eventSource, setEventSource] = useState('');
|
|
42
|
+
const [sourceReference, setSourceReference] = useState('');
|
|
43
|
+
const [evidence, setEvidence] = useState('');
|
|
44
|
+
const [location, setLocation] = useState('');
|
|
45
|
+
const [busy, setBusy] = useState(false);
|
|
46
|
+
const [actionError, setActionError] = useState<string | null>(null);
|
|
47
|
+
const [notice, setNotice] = useState<string | null>(null);
|
|
48
|
+
const selected = data.containers.find((row) => row.id === data.containerId);
|
|
49
|
+
const cycle = data.cycles.find((row) => row.id === data.cycleId);
|
|
50
|
+
|
|
51
|
+
const act = async (operation: () => Promise<void>, success: string) => {
|
|
52
|
+
setBusy(true);
|
|
53
|
+
setActionError(null);
|
|
54
|
+
setNotice(null);
|
|
55
|
+
try {
|
|
56
|
+
await operation();
|
|
57
|
+
setNotice(success);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
setActionError(error instanceof Error ? error.message : 'Operation failed.');
|
|
60
|
+
} finally {
|
|
61
|
+
setBusy(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const register = (event: FormEvent) => {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
void act(async () => {
|
|
67
|
+
await data.register({
|
|
68
|
+
containerNumber: number.trim(),
|
|
69
|
+
equipmentType,
|
|
70
|
+
ownerName: ownerName.trim() || undefined,
|
|
71
|
+
source: source.trim(),
|
|
72
|
+
});
|
|
73
|
+
setNumber('');
|
|
74
|
+
}, 'Container registered. Record its usage cycle next.');
|
|
75
|
+
};
|
|
76
|
+
const record = (event: FormEvent) => {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
if (!cycle) return;
|
|
79
|
+
void act(async () => {
|
|
80
|
+
const timestamp = new Date(eventTime);
|
|
81
|
+
if (!Number.isFinite(timestamp.getTime())) throw new Error('Enter a valid event time.');
|
|
82
|
+
await data.recordEvent({
|
|
83
|
+
cycleId: cycle.id,
|
|
84
|
+
eventType,
|
|
85
|
+
kind,
|
|
86
|
+
occurredAt: timestamp.toISOString(),
|
|
87
|
+
source: eventSource.trim(),
|
|
88
|
+
sourceReference: sourceReference.trim() || undefined,
|
|
89
|
+
evidenceNote: evidence.trim() || undefined,
|
|
90
|
+
location: location.trim() || undefined,
|
|
91
|
+
});
|
|
92
|
+
setEvidence('');
|
|
93
|
+
setEventTime('');
|
|
94
|
+
}, 'Event recorded with its source and receipt time.');
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<PageLayout
|
|
99
|
+
title="Containers"
|
|
100
|
+
subtitle="Physical equipment, usage cycles and sourced movement history"
|
|
101
|
+
icon={<Boxes size={24} />}
|
|
102
|
+
headerActions={
|
|
103
|
+
<Button variant="outline" onClick={data.refresh} disabled={busy}>
|
|
104
|
+
<RefreshCw size={16} className="mr-2" />
|
|
105
|
+
Refresh
|
|
106
|
+
</Button>
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
<p className="mb-5 text-sm text-text-secondary">
|
|
110
|
+
Shipment delivery and equipment return are separate obligations. Close a cycle only after an
|
|
111
|
+
actual empty return and recorded return acceptance.
|
|
112
|
+
</p>
|
|
113
|
+
{actionError && (
|
|
114
|
+
<p role="alert" className="mb-4 rounded-md border border-red-400 p-3">
|
|
115
|
+
{actionError}
|
|
116
|
+
</p>
|
|
117
|
+
)}
|
|
118
|
+
{notice && (
|
|
119
|
+
<p role="status" className="mb-4 rounded-md border p-3">
|
|
120
|
+
{notice}
|
|
121
|
+
</p>
|
|
122
|
+
)}
|
|
123
|
+
<div className="grid gap-5 xl:grid-cols-3">
|
|
124
|
+
<section className={sectionClass}>
|
|
125
|
+
<h2 className="text-lg font-semibold">Equipment registry</h2>
|
|
126
|
+
{data.loading && <p role="status">Loading containers…</p>}
|
|
127
|
+
{data.error && (
|
|
128
|
+
<p role="alert">
|
|
129
|
+
{data.error}{' '}
|
|
130
|
+
<Button variant="outline" onClick={data.refresh}>
|
|
131
|
+
Retry
|
|
132
|
+
</Button>
|
|
133
|
+
</p>
|
|
134
|
+
)}
|
|
135
|
+
{!data.loading && !data.error && data.containers.length === 0 && (
|
|
136
|
+
<p>No containers on this page. Register equipment to start tracking its lifecycle.</p>
|
|
137
|
+
)}
|
|
138
|
+
<ul className="space-y-2">
|
|
139
|
+
{data.containers.map((row) => (
|
|
140
|
+
<li key={row.id}>
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
aria-pressed={row.id === data.containerId}
|
|
144
|
+
disabled={busy}
|
|
145
|
+
onClick={() => {
|
|
146
|
+
data.selectContainer(row.id);
|
|
147
|
+
setActionError(null);
|
|
148
|
+
setNotice(null);
|
|
149
|
+
}}
|
|
150
|
+
className={`w-full rounded-md border p-3 text-left ${row.id === data.containerId ? 'border-blue-500' : ''}`}
|
|
151
|
+
>
|
|
152
|
+
<span className="font-semibold">{row.containerNumber}</span>
|
|
153
|
+
<br />
|
|
154
|
+
<span className="text-sm">
|
|
155
|
+
{readable(row.equipmentType)} · {row.ownerName || 'Owner not recorded'}
|
|
156
|
+
</span>
|
|
157
|
+
</button>
|
|
158
|
+
</li>
|
|
159
|
+
))}
|
|
160
|
+
</ul>
|
|
161
|
+
<Pagination
|
|
162
|
+
page={data.page}
|
|
163
|
+
more={data.hasMore}
|
|
164
|
+
disabled={data.loading || busy}
|
|
165
|
+
onChange={(page) => {
|
|
166
|
+
data.selectContainer('');
|
|
167
|
+
data.setPage(page);
|
|
168
|
+
}}
|
|
169
|
+
/>
|
|
170
|
+
<form onSubmit={register} className="space-y-3 border-t pt-4">
|
|
171
|
+
<h3 className="font-semibold">Register container</h3>
|
|
172
|
+
<Label htmlFor="container-number">ISO container number</Label>
|
|
173
|
+
<Input
|
|
174
|
+
id="container-number"
|
|
175
|
+
value={number}
|
|
176
|
+
onChange={(event) => setNumber(event.target.value)}
|
|
177
|
+
required
|
|
178
|
+
maxLength={20}
|
|
179
|
+
placeholder="Four letters and seven digits"
|
|
180
|
+
/>
|
|
181
|
+
<Label htmlFor="equipment-type">Physical equipment type</Label>
|
|
182
|
+
<select
|
|
183
|
+
id="equipment-type"
|
|
184
|
+
className={selectClass}
|
|
185
|
+
value={equipmentType}
|
|
186
|
+
onChange={(event) =>
|
|
187
|
+
setEquipmentType(
|
|
188
|
+
EQUIPMENT_TYPES.find((value) => value === event.target.value) ?? 'OTHER'
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
>
|
|
192
|
+
{EQUIPMENT_TYPES.map((value) => (
|
|
193
|
+
<option key={value} value={value}>
|
|
194
|
+
{readable(value)}
|
|
195
|
+
</option>
|
|
196
|
+
))}
|
|
197
|
+
</select>
|
|
198
|
+
<Label htmlFor="container-owner">Owner (optional)</Label>
|
|
199
|
+
<Input
|
|
200
|
+
id="container-owner"
|
|
201
|
+
value={ownerName}
|
|
202
|
+
onChange={(event) => setOwnerName(event.target.value)}
|
|
203
|
+
maxLength={200}
|
|
204
|
+
/>
|
|
205
|
+
<Label htmlFor="container-source">Information source</Label>
|
|
206
|
+
<Input
|
|
207
|
+
id="container-source"
|
|
208
|
+
value={source}
|
|
209
|
+
onChange={(event) => setSource(event.target.value)}
|
|
210
|
+
required
|
|
211
|
+
maxLength={120}
|
|
212
|
+
placeholder="Equipment release document or carrier portal"
|
|
213
|
+
/>
|
|
214
|
+
<Button type="submit" disabled={busy || !number.trim() || !source.trim()}>
|
|
215
|
+
Register container
|
|
216
|
+
</Button>
|
|
217
|
+
</form>
|
|
218
|
+
</section>
|
|
219
|
+
<section className={sectionClass}>
|
|
220
|
+
<h2 className="text-lg font-semibold">Usage cycles</h2>
|
|
221
|
+
{!data.containerId && <p>Select a container to view its cycles.</p>}
|
|
222
|
+
{selected && (
|
|
223
|
+
<p className="text-sm">
|
|
224
|
+
{selected.containerNumber} · Source: {selected.source}
|
|
225
|
+
</p>
|
|
226
|
+
)}
|
|
227
|
+
{data.cyclesLoading && <p role="status">Loading cycles…</p>}
|
|
228
|
+
{data.cycleError && <p role="alert">{data.cycleError}</p>}
|
|
229
|
+
{data.containerId && !data.cyclesLoading && !data.cycleError && !data.cycles.length && (
|
|
230
|
+
<p>No usage cycles on this page.</p>
|
|
231
|
+
)}
|
|
232
|
+
<ul className="space-y-2">
|
|
233
|
+
{data.cycles.map((row) => (
|
|
234
|
+
<li key={row.id}>
|
|
235
|
+
<button
|
|
236
|
+
type="button"
|
|
237
|
+
aria-pressed={row.id === data.cycleId}
|
|
238
|
+
disabled={busy}
|
|
239
|
+
className={`w-full rounded-md border p-3 text-left ${row.id === data.cycleId ? 'border-blue-500' : ''}`}
|
|
240
|
+
onClick={() => {
|
|
241
|
+
data.selectCycle(row.id);
|
|
242
|
+
setActionError(null);
|
|
243
|
+
setNotice(null);
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
<span className="font-semibold">
|
|
247
|
+
{row.bookingReference || 'Unlinked booking'} · {row.status}
|
|
248
|
+
</span>
|
|
249
|
+
<br />
|
|
250
|
+
<span className="text-sm">Opened {formatTime(row.openedAt)}</span>
|
|
251
|
+
{row.closedAt && (
|
|
252
|
+
<span className="block text-sm">Closed {formatTime(row.closedAt)}</span>
|
|
253
|
+
)}
|
|
254
|
+
</button>
|
|
255
|
+
</li>
|
|
256
|
+
))}
|
|
257
|
+
</ul>
|
|
258
|
+
{data.containerId && (
|
|
259
|
+
<Pagination
|
|
260
|
+
page={data.cyclePage}
|
|
261
|
+
more={data.hasMoreCycles}
|
|
262
|
+
disabled={data.cyclesLoading || busy}
|
|
263
|
+
onChange={(page) => {
|
|
264
|
+
data.selectCycle('');
|
|
265
|
+
data.setCyclePage(page);
|
|
266
|
+
}}
|
|
267
|
+
/>
|
|
268
|
+
)}
|
|
269
|
+
{data.containerId && (
|
|
270
|
+
<form
|
|
271
|
+
className="space-y-3 border-t pt-4"
|
|
272
|
+
onSubmit={(event) => {
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
void act(async () => {
|
|
275
|
+
const timestamp = new Date(openingTime);
|
|
276
|
+
if (!Number.isFinite(timestamp.getTime())) {
|
|
277
|
+
throw new Error('Enter a valid cycle opening time.');
|
|
278
|
+
}
|
|
279
|
+
await data.openCycle({
|
|
280
|
+
containerId: data.containerId,
|
|
281
|
+
bookingReference: booking.trim() || undefined,
|
|
282
|
+
openedAt: timestamp.toISOString(),
|
|
283
|
+
});
|
|
284
|
+
}, 'Usage cycle opened.');
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
<Label htmlFor="booking-reference">Booking reference (optional)</Label>
|
|
288
|
+
<Input
|
|
289
|
+
id="booking-reference"
|
|
290
|
+
value={booking}
|
|
291
|
+
onChange={(event) => setBooking(event.target.value)}
|
|
292
|
+
maxLength={120}
|
|
293
|
+
/>
|
|
294
|
+
<Label htmlFor="cycle-opening-time">Cycle opening time (your local timezone)</Label>
|
|
295
|
+
<Input
|
|
296
|
+
id="cycle-opening-time"
|
|
297
|
+
type="datetime-local"
|
|
298
|
+
step={1}
|
|
299
|
+
value={openingTime}
|
|
300
|
+
onChange={(event) => setOpeningTime(event.target.value)}
|
|
301
|
+
required
|
|
302
|
+
/>
|
|
303
|
+
<Button type="submit" disabled={busy || data.cyclesLoading}>
|
|
304
|
+
Open usage cycle
|
|
305
|
+
</Button>
|
|
306
|
+
<p className="text-sm text-text-secondary">
|
|
307
|
+
Only one cycle may be open for this container. Use its actual start time so earlier
|
|
308
|
+
movements can be recorded. Times are stored in UTC.
|
|
309
|
+
</p>
|
|
310
|
+
</form>
|
|
311
|
+
)}
|
|
312
|
+
</section>
|
|
313
|
+
<section className={sectionClass}>
|
|
314
|
+
<h2 className="text-lg font-semibold">Movement and return history</h2>
|
|
315
|
+
{!data.cycleId && <p>Select a usage cycle to view and record events.</p>}
|
|
316
|
+
{data.eventsLoading && <p role="status">Loading events…</p>}
|
|
317
|
+
{data.eventError && <p role="alert">{data.eventError}</p>}
|
|
318
|
+
{data.cycleId && !data.eventsLoading && !data.eventError && !data.events.length && (
|
|
319
|
+
<p>No events on this page. Record actual movements with their source.</p>
|
|
320
|
+
)}
|
|
321
|
+
<ol className="space-y-3">
|
|
322
|
+
{data.events.map((row) => (
|
|
323
|
+
<li key={row.id} className="rounded-md border p-3 text-sm">
|
|
324
|
+
<p className="font-semibold">
|
|
325
|
+
{readable(row.eventType)} · {row.kind}
|
|
326
|
+
</p>
|
|
327
|
+
<p>Occurred: {formatTime(row.occurredAt)}</p>
|
|
328
|
+
<p>Received: {formatTime(row.receivedAt)}</p>
|
|
329
|
+
<p>
|
|
330
|
+
Source: {row.source}
|
|
331
|
+
{row.sourceReference ? ` · ${row.sourceReference}` : ''}
|
|
332
|
+
</p>
|
|
333
|
+
{row.location && <p>Location: {row.location}</p>}
|
|
334
|
+
{row.evidenceNote && <p>Evidence: {row.evidenceNote}</p>}
|
|
335
|
+
</li>
|
|
336
|
+
))}
|
|
337
|
+
</ol>
|
|
338
|
+
{data.cycleId && (
|
|
339
|
+
<Pagination
|
|
340
|
+
page={data.eventPage}
|
|
341
|
+
more={data.hasMoreEvents}
|
|
342
|
+
disabled={data.eventsLoading || busy}
|
|
343
|
+
onChange={data.setEventPage}
|
|
344
|
+
/>
|
|
345
|
+
)}
|
|
346
|
+
{cycle?.status === 'OPEN' && (
|
|
347
|
+
<>
|
|
348
|
+
<form onSubmit={record} className="space-y-3 border-t pt-4">
|
|
349
|
+
<h3 className="font-semibold">Record event</h3>
|
|
350
|
+
<Label htmlFor="container-event">Event</Label>
|
|
351
|
+
<select
|
|
352
|
+
id="container-event"
|
|
353
|
+
className={selectClass}
|
|
354
|
+
value={eventType}
|
|
355
|
+
onChange={(event) =>
|
|
356
|
+
setEventType(
|
|
357
|
+
CONTAINER_EVENT_TYPES.find((value) => value === event.target.value) ??
|
|
358
|
+
'POSITION_UPDATE'
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
>
|
|
362
|
+
{CONTAINER_EVENT_TYPES.map((value) => (
|
|
363
|
+
<option key={value} value={value}>
|
|
364
|
+
{readable(value)}
|
|
365
|
+
</option>
|
|
366
|
+
))}
|
|
367
|
+
</select>
|
|
368
|
+
<Label htmlFor="event-kind">Event certainty</Label>
|
|
369
|
+
<select
|
|
370
|
+
id="event-kind"
|
|
371
|
+
className={selectClass}
|
|
372
|
+
value={kind}
|
|
373
|
+
onChange={(event) =>
|
|
374
|
+
setKind(
|
|
375
|
+
event.target.value === 'PLANNED'
|
|
376
|
+
? 'PLANNED'
|
|
377
|
+
: event.target.value === 'ESTIMATED'
|
|
378
|
+
? 'ESTIMATED'
|
|
379
|
+
: 'ACTUAL'
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
>
|
|
383
|
+
<option value="ACTUAL">Actual</option>
|
|
384
|
+
<option value="PLANNED">Planned</option>
|
|
385
|
+
<option value="ESTIMATED">Estimated</option>
|
|
386
|
+
</select>
|
|
387
|
+
<Label htmlFor="event-time">Event time (your local timezone)</Label>
|
|
388
|
+
<Input
|
|
389
|
+
id="event-time"
|
|
390
|
+
type="datetime-local"
|
|
391
|
+
step={1}
|
|
392
|
+
value={eventTime}
|
|
393
|
+
onChange={(event) => setEventTime(event.target.value)}
|
|
394
|
+
required
|
|
395
|
+
/>
|
|
396
|
+
<Label htmlFor="event-source">Event source</Label>
|
|
397
|
+
<Input
|
|
398
|
+
id="event-source"
|
|
399
|
+
value={eventSource}
|
|
400
|
+
onChange={(event) => setEventSource(event.target.value)}
|
|
401
|
+
required
|
|
402
|
+
maxLength={120}
|
|
403
|
+
/>
|
|
404
|
+
<Label htmlFor="source-reference">Source reference (optional)</Label>
|
|
405
|
+
<Input
|
|
406
|
+
id="source-reference"
|
|
407
|
+
value={sourceReference}
|
|
408
|
+
onChange={(event) => setSourceReference(event.target.value)}
|
|
409
|
+
maxLength={200}
|
|
410
|
+
/>
|
|
411
|
+
<Label htmlFor="event-location">Location (optional)</Label>
|
|
412
|
+
<Input
|
|
413
|
+
id="event-location"
|
|
414
|
+
value={location}
|
|
415
|
+
onChange={(event) => setLocation(event.target.value)}
|
|
416
|
+
maxLength={200}
|
|
417
|
+
/>
|
|
418
|
+
<Label htmlFor="event-evidence">
|
|
419
|
+
Evidence note
|
|
420
|
+
{eventType === 'RETURN_ACCEPTED' && kind === 'ACTUAL'
|
|
421
|
+
? ' (required for acceptance)'
|
|
422
|
+
: ' (optional)'}
|
|
423
|
+
</Label>
|
|
424
|
+
<Input
|
|
425
|
+
id="event-evidence"
|
|
426
|
+
value={evidence}
|
|
427
|
+
onChange={(event) => setEvidence(event.target.value)}
|
|
428
|
+
maxLength={2000}
|
|
429
|
+
required={eventType === 'RETURN_ACCEPTED' && kind === 'ACTUAL'}
|
|
430
|
+
/>
|
|
431
|
+
<Button type="submit" disabled={busy || !eventSource.trim()}>
|
|
432
|
+
Record event
|
|
433
|
+
</Button>
|
|
434
|
+
</form>
|
|
435
|
+
<div className="space-y-3 border-t pt-4">
|
|
436
|
+
<p className="text-sm text-text-secondary">
|
|
437
|
+
Closure checks the complete recorded history for actual empty return and
|
|
438
|
+
acceptance. A planned return or delivered shipment is insufficient.
|
|
439
|
+
</p>
|
|
440
|
+
<Button
|
|
441
|
+
variant="outline"
|
|
442
|
+
disabled={busy || data.cyclesLoading || data.eventsLoading}
|
|
443
|
+
onClick={() =>
|
|
444
|
+
void act(
|
|
445
|
+
() => data.closeCycle(cycle),
|
|
446
|
+
'Cycle closed after accepted empty return.'
|
|
447
|
+
)
|
|
448
|
+
}
|
|
449
|
+
>
|
|
450
|
+
Close cycle
|
|
451
|
+
</Button>
|
|
452
|
+
</div>
|
|
453
|
+
</>
|
|
454
|
+
)}
|
|
455
|
+
{cycle?.status === 'CLOSED' && (
|
|
456
|
+
<p>This cycle is closed. Its recorded history remains available.</p>
|
|
457
|
+
)}
|
|
458
|
+
</section>
|
|
459
|
+
</div>
|
|
460
|
+
</PageLayout>
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function Pagination({
|
|
465
|
+
page,
|
|
466
|
+
more,
|
|
467
|
+
disabled,
|
|
468
|
+
onChange,
|
|
469
|
+
}: {
|
|
470
|
+
page: number;
|
|
471
|
+
more: boolean;
|
|
472
|
+
disabled: boolean;
|
|
473
|
+
onChange: (page: number) => void;
|
|
474
|
+
}) {
|
|
475
|
+
return (
|
|
476
|
+
<div className="flex items-center justify-between gap-2">
|
|
477
|
+
<Button
|
|
478
|
+
variant="outline"
|
|
479
|
+
disabled={disabled || page === 0}
|
|
480
|
+
onClick={() => onChange(page - 1)}
|
|
481
|
+
>
|
|
482
|
+
Previous
|
|
483
|
+
</Button>
|
|
484
|
+
<span className="text-sm">Page {page + 1}</span>
|
|
485
|
+
<Button variant="outline" disabled={disabled || !more} onClick={() => onChange(page + 1)}>
|
|
486
|
+
Next
|
|
487
|
+
</Button>
|
|
488
|
+
</div>
|
|
489
|
+
);
|
|
490
|
+
}
|