@de./types 1.0.0
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/api.d.ts +113 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +92 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +109 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +80 -0
- package/dist/auth.js.map +1 -0
- package/dist/aux/agent-rvs.d.ts +1205 -0
- package/dist/aux/agent-rvs.d.ts.map +1 -0
- package/dist/aux/agent-rvs.js +444 -0
- package/dist/aux/agent-rvs.js.map +1 -0
- package/dist/aux/agents.d.ts +1573 -0
- package/dist/aux/agents.d.ts.map +1 -0
- package/dist/aux/agents.js +487 -0
- package/dist/aux/agents.js.map +1 -0
- package/dist/aux/customer-rvs.d.ts +711 -0
- package/dist/aux/customer-rvs.d.ts.map +1 -0
- package/dist/aux/customer-rvs.js +321 -0
- package/dist/aux/customer-rvs.js.map +1 -0
- package/dist/aux/customers.d.ts +379 -0
- package/dist/aux/customers.d.ts.map +1 -0
- package/dist/aux/customers.js +67 -0
- package/dist/aux/customers.js.map +1 -0
- package/dist/aux/index.d.ts +5 -0
- package/dist/aux/index.d.ts.map +1 -0
- package/dist/aux/index.js +21 -0
- package/dist/aux/index.js.map +1 -0
- package/dist/billing.d.ts +367 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +308 -0
- package/dist/billing.js.map +1 -0
- package/dist/bucket.d.ts +97 -0
- package/dist/bucket.d.ts.map +1 -0
- package/dist/bucket.js +52 -0
- package/dist/bucket.js.map +1 -0
- package/dist/context.d.ts +148 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +148 -0
- package/dist/context.js.map +1 -0
- package/dist/csp/analytics.d.ts +270 -0
- package/dist/csp/analytics.d.ts.map +1 -0
- package/dist/csp/analytics.js +185 -0
- package/dist/csp/analytics.js.map +1 -0
- package/dist/csp/base.d.ts +11 -0
- package/dist/csp/base.d.ts.map +1 -0
- package/dist/csp/base.js +17 -0
- package/dist/csp/base.js.map +1 -0
- package/dist/csp/index.d.ts +107 -0
- package/dist/csp/index.d.ts.map +1 -0
- package/dist/csp/index.js +48 -0
- package/dist/csp/index.js.map +1 -0
- package/dist/csp/inventory.d.ts +361 -0
- package/dist/csp/inventory.d.ts.map +1 -0
- package/dist/csp/inventory.js +267 -0
- package/dist/csp/inventory.js.map +1 -0
- package/dist/csp/order.d.ts +1457 -0
- package/dist/csp/order.d.ts.map +1 -0
- package/dist/csp/order.js +367 -0
- package/dist/csp/order.js.map +1 -0
- package/dist/csp/webhook.d.ts +381 -0
- package/dist/csp/webhook.d.ts.map +1 -0
- package/dist/csp/webhook.js +207 -0
- package/dist/csp/webhook.js.map +1 -0
- package/dist/de.profile.d.ts +411 -0
- package/dist/de.profile.d.ts.map +1 -0
- package/dist/de.profile.js +98 -0
- package/dist/de.profile.js.map +1 -0
- package/dist/dev/developer.d.ts +211 -0
- package/dist/dev/developer.d.ts.map +1 -0
- package/dist/dev/developer.js +55 -0
- package/dist/dev/developer.js.map +1 -0
- package/dist/dev/index.d.ts +133 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +79 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/entity.d.ts +159 -0
- package/dist/entity.d.ts.map +1 -0
- package/dist/entity.js +127 -0
- package/dist/entity.js.map +1 -0
- package/dist/events.d.ts +1844 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +303 -0
- package/dist/events.js.map +1 -0
- package/dist/faq.d.ts +60 -0
- package/dist/faq.d.ts.map +1 -0
- package/dist/faq.js +31 -0
- package/dist/faq.js.map +1 -0
- package/dist/geo.d.ts +123 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +87 -0
- package/dist/geo.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +1347 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +356 -0
- package/dist/inventory.js.map +1 -0
- package/dist/invoice.d.ts +46 -0
- package/dist/invoice.d.ts.map +1 -0
- package/dist/invoice.js +33 -0
- package/dist/invoice.js.map +1 -0
- package/dist/iotsp/device.d.ts +581 -0
- package/dist/iotsp/device.d.ts.map +1 -0
- package/dist/iotsp/device.js +277 -0
- package/dist/iotsp/device.js.map +1 -0
- package/dist/iotsp/index.d.ts +111 -0
- package/dist/iotsp/index.d.ts.map +1 -0
- package/dist/iotsp/index.js +76 -0
- package/dist/iotsp/index.js.map +1 -0
- package/dist/iotsp/rule.d.ts +340 -0
- package/dist/iotsp/rule.d.ts.map +1 -0
- package/dist/iotsp/rule.js +172 -0
- package/dist/iotsp/rule.js.map +1 -0
- package/dist/iotsp/topic.d.ts +249 -0
- package/dist/iotsp/topic.d.ts.map +1 -0
- package/dist/iotsp/topic.js +139 -0
- package/dist/iotsp/topic.js.map +1 -0
- package/dist/lsp/carrier/analytics.d.ts +1191 -0
- package/dist/lsp/carrier/analytics.d.ts.map +1 -0
- package/dist/lsp/carrier/analytics.js +354 -0
- package/dist/lsp/carrier/analytics.js.map +1 -0
- package/dist/lsp/carrier/capabilities.d.ts +3603 -0
- package/dist/lsp/carrier/capabilities.d.ts.map +1 -0
- package/dist/lsp/carrier/capabilities.js +880 -0
- package/dist/lsp/carrier/capabilities.js.map +1 -0
- package/dist/lsp/carrier/capacities.d.ts +4436 -0
- package/dist/lsp/carrier/capacities.d.ts.map +1 -0
- package/dist/lsp/carrier/capacities.js +615 -0
- package/dist/lsp/carrier/capacities.js.map +1 -0
- package/dist/lsp/carrier/index.d.ts +734 -0
- package/dist/lsp/carrier/index.d.ts.map +1 -0
- package/dist/lsp/carrier/index.js +150 -0
- package/dist/lsp/carrier/index.js.map +1 -0
- package/dist/lsp/carrier/performance.d.ts +567 -0
- package/dist/lsp/carrier/performance.d.ts.map +1 -0
- package/dist/lsp/carrier/performance.js +127 -0
- package/dist/lsp/carrier/performance.js.map +1 -0
- package/dist/lsp/carrier/utilities.d.ts +6671 -0
- package/dist/lsp/carrier/utilities.d.ts.map +1 -0
- package/dist/lsp/carrier/utilities.js +597 -0
- package/dist/lsp/carrier/utilities.js.map +1 -0
- package/dist/lsp/consolidation.d.ts +793 -0
- package/dist/lsp/consolidation.d.ts.map +1 -0
- package/dist/lsp/consolidation.js +343 -0
- package/dist/lsp/consolidation.js.map +1 -0
- package/dist/lsp/coverage.d.ts +7449 -0
- package/dist/lsp/coverage.d.ts.map +1 -0
- package/dist/lsp/coverage.js +706 -0
- package/dist/lsp/coverage.js.map +1 -0
- package/dist/lsp/fleet/index.d.ts +1128 -0
- package/dist/lsp/fleet/index.d.ts.map +1 -0
- package/dist/lsp/fleet/index.js +269 -0
- package/dist/lsp/fleet/index.js.map +1 -0
- package/dist/lsp/fleet/maintenance.d.ts +2022 -0
- package/dist/lsp/fleet/maintenance.d.ts.map +1 -0
- package/dist/lsp/fleet/maintenance.js +386 -0
- package/dist/lsp/fleet/maintenance.js.map +1 -0
- package/dist/lsp/fleet/parking.d.ts +2043 -0
- package/dist/lsp/fleet/parking.d.ts.map +1 -0
- package/dist/lsp/fleet/parking.js +458 -0
- package/dist/lsp/fleet/parking.js.map +1 -0
- package/dist/lsp/fleet/vehicle.d.ts +783 -0
- package/dist/lsp/fleet/vehicle.d.ts.map +1 -0
- package/dist/lsp/fleet/vehicle.js +314 -0
- package/dist/lsp/fleet/vehicle.js.map +1 -0
- package/dist/lsp/graph.d.ts +212 -0
- package/dist/lsp/graph.d.ts.map +1 -0
- package/dist/lsp/graph.js +92 -0
- package/dist/lsp/graph.js.map +1 -0
- package/dist/lsp/hub/analytics.d.ts +4294 -0
- package/dist/lsp/hub/analytics.d.ts.map +1 -0
- package/dist/lsp/hub/analytics.js +219 -0
- package/dist/lsp/hub/analytics.js.map +1 -0
- package/dist/lsp/hub/capabilities.d.ts +1467 -0
- package/dist/lsp/hub/capabilities.d.ts.map +1 -0
- package/dist/lsp/hub/capabilities.js +464 -0
- package/dist/lsp/hub/capabilities.js.map +1 -0
- package/dist/lsp/hub/capacities.d.ts +4278 -0
- package/dist/lsp/hub/capacities.d.ts.map +1 -0
- package/dist/lsp/hub/capacities.js +495 -0
- package/dist/lsp/hub/capacities.js.map +1 -0
- package/dist/lsp/hub/index.d.ts +2784 -0
- package/dist/lsp/hub/index.d.ts.map +1 -0
- package/dist/lsp/hub/index.js +268 -0
- package/dist/lsp/hub/index.js.map +1 -0
- package/dist/lsp/hub/performance.d.ts +391 -0
- package/dist/lsp/hub/performance.d.ts.map +1 -0
- package/dist/lsp/hub/performance.js +78 -0
- package/dist/lsp/hub/performance.js.map +1 -0
- package/dist/lsp/hub/utilities.d.ts +2996 -0
- package/dist/lsp/hub/utilities.d.ts.map +1 -0
- package/dist/lsp/hub/utilities.js +521 -0
- package/dist/lsp/hub/utilities.js.map +1 -0
- package/dist/lsp/index.d.ts +157 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +121 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/operations.d.ts +563 -0
- package/dist/lsp/operations.d.ts.map +1 -0
- package/dist/lsp/operations.js +265 -0
- package/dist/lsp/operations.js.map +1 -0
- package/dist/lsp/order/delivery.d.ts +1119 -0
- package/dist/lsp/order/delivery.d.ts.map +1 -0
- package/dist/lsp/order/delivery.js +169 -0
- package/dist/lsp/order/delivery.js.map +1 -0
- package/dist/lsp/order/flow/processes.d.ts +8 -0
- package/dist/lsp/order/flow/processes.d.ts.map +1 -0
- package/dist/lsp/order/flow/processes.js +67 -0
- package/dist/lsp/order/flow/processes.js.map +1 -0
- package/dist/lsp/order/flow/stages.d.ts +8 -0
- package/dist/lsp/order/flow/stages.d.ts.map +1 -0
- package/dist/lsp/order/flow/stages.js +111 -0
- package/dist/lsp/order/flow/stages.js.map +1 -0
- package/dist/lsp/order/inbound.d.ts +1165 -0
- package/dist/lsp/order/inbound.d.ts.map +1 -0
- package/dist/lsp/order/inbound.js +185 -0
- package/dist/lsp/order/inbound.js.map +1 -0
- package/dist/lsp/order/internal.d.ts +1404 -0
- package/dist/lsp/order/internal.d.ts.map +1 -0
- package/dist/lsp/order/internal.js +255 -0
- package/dist/lsp/order/internal.js.map +1 -0
- package/dist/lsp/order/management.d.ts +541 -0
- package/dist/lsp/order/management.d.ts.map +1 -0
- package/dist/lsp/order/management.js +326 -0
- package/dist/lsp/order/management.js.map +1 -0
- package/dist/lsp/order/outbound.d.ts +909 -0
- package/dist/lsp/order/outbound.d.ts.map +1 -0
- package/dist/lsp/order/outbound.js +105 -0
- package/dist/lsp/order/outbound.js.map +1 -0
- package/dist/lsp/order/passthrough.d.ts +1816 -0
- package/dist/lsp/order/passthrough.d.ts.map +1 -0
- package/dist/lsp/order/passthrough.js +360 -0
- package/dist/lsp/order/passthrough.js.map +1 -0
- package/dist/lsp/order/ride.d.ts +1056 -0
- package/dist/lsp/order/ride.d.ts.map +1 -0
- package/dist/lsp/order/ride.js +166 -0
- package/dist/lsp/order/ride.js.map +1 -0
- package/dist/lsp/order/shipping.d.ts +1524 -0
- package/dist/lsp/order/shipping.d.ts.map +1 -0
- package/dist/lsp/order/shipping.js +223 -0
- package/dist/lsp/order/shipping.js.map +1 -0
- package/dist/lsp/performance.d.ts +2 -0
- package/dist/lsp/performance.d.ts.map +1 -0
- package/dist/lsp/performance.js +3 -0
- package/dist/lsp/performance.js.map +1 -0
- package/dist/lsp/pod/index.d.ts +805 -0
- package/dist/lsp/pod/index.d.ts.map +1 -0
- package/dist/lsp/pod/index.js +250 -0
- package/dist/lsp/pod/index.js.map +1 -0
- package/dist/lsp/pricing.d.ts +1811 -0
- package/dist/lsp/pricing.d.ts.map +1 -0
- package/dist/lsp/pricing.js +972 -0
- package/dist/lsp/pricing.js.map +1 -0
- package/dist/lsp/processing.d.ts +893 -0
- package/dist/lsp/processing.d.ts.map +1 -0
- package/dist/lsp/processing.js +202 -0
- package/dist/lsp/processing.js.map +1 -0
- package/dist/lsp/product.d.ts +76 -0
- package/dist/lsp/product.d.ts.map +1 -0
- package/dist/lsp/product.js +3 -0
- package/dist/lsp/product.js.map +1 -0
- package/dist/lsp/psl.d.ts +785 -0
- package/dist/lsp/psl.d.ts.map +1 -0
- package/dist/lsp/psl.js +333 -0
- package/dist/lsp/psl.js.map +1 -0
- package/dist/lsp/terminal/analytics.d.ts +278 -0
- package/dist/lsp/terminal/analytics.d.ts.map +1 -0
- package/dist/lsp/terminal/analytics.js +310 -0
- package/dist/lsp/terminal/analytics.js.map +1 -0
- package/dist/lsp/terminal/capabilities.d.ts +797 -0
- package/dist/lsp/terminal/capabilities.d.ts.map +1 -0
- package/dist/lsp/terminal/capabilities.js +506 -0
- package/dist/lsp/terminal/capabilities.js.map +1 -0
- package/dist/lsp/terminal/capacities.d.ts +3152 -0
- package/dist/lsp/terminal/capacities.d.ts.map +1 -0
- package/dist/lsp/terminal/capacities.js +504 -0
- package/dist/lsp/terminal/capacities.js.map +1 -0
- package/dist/lsp/terminal/index.d.ts +1056 -0
- package/dist/lsp/terminal/index.d.ts.map +1 -0
- package/dist/lsp/terminal/index.js +394 -0
- package/dist/lsp/terminal/index.js.map +1 -0
- package/dist/lsp/terminal/performance.d.ts +955 -0
- package/dist/lsp/terminal/performance.d.ts.map +1 -0
- package/dist/lsp/terminal/performance.js +159 -0
- package/dist/lsp/terminal/performance.js.map +1 -0
- package/dist/lsp/terminal/utilities.d.ts +2374 -0
- package/dist/lsp/terminal/utilities.d.ts.map +1 -0
- package/dist/lsp/terminal/utilities.js +161 -0
- package/dist/lsp/terminal/utilities.js.map +1 -0
- package/dist/lsp/warehouse/analytics.d.ts +3088 -0
- package/dist/lsp/warehouse/analytics.d.ts.map +1 -0
- package/dist/lsp/warehouse/analytics.js +229 -0
- package/dist/lsp/warehouse/analytics.js.map +1 -0
- package/dist/lsp/warehouse/capabilities.d.ts +1384 -0
- package/dist/lsp/warehouse/capabilities.d.ts.map +1 -0
- package/dist/lsp/warehouse/capabilities.js +567 -0
- package/dist/lsp/warehouse/capabilities.js.map +1 -0
- package/dist/lsp/warehouse/capacities.d.ts +2921 -0
- package/dist/lsp/warehouse/capacities.d.ts.map +1 -0
- package/dist/lsp/warehouse/capacities.js +450 -0
- package/dist/lsp/warehouse/capacities.js.map +1 -0
- package/dist/lsp/warehouse/index.d.ts +2566 -0
- package/dist/lsp/warehouse/index.d.ts.map +1 -0
- package/dist/lsp/warehouse/index.js +264 -0
- package/dist/lsp/warehouse/index.js.map +1 -0
- package/dist/lsp/warehouse/performance.d.ts +287 -0
- package/dist/lsp/warehouse/performance.d.ts.map +1 -0
- package/dist/lsp/warehouse/performance.js +72 -0
- package/dist/lsp/warehouse/performance.js.map +1 -0
- package/dist/lsp/warehouse/utilities.d.ts +5174 -0
- package/dist/lsp/warehouse/utilities.d.ts.map +1 -0
- package/dist/lsp/warehouse/utilities.js +588 -0
- package/dist/lsp/warehouse/utilities.js.map +1 -0
- package/dist/lsp/zones.d.ts +305 -0
- package/dist/lsp/zones.d.ts.map +1 -0
- package/dist/lsp/zones.js +118 -0
- package/dist/lsp/zones.js.map +1 -0
- package/dist/measure.d.ts +139 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +190 -0
- package/dist/measure.js.map +1 -0
- package/dist/operator.d.ts +103 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +38 -0
- package/dist/operator.js.map +1 -0
- package/dist/order.d.ts +2739 -0
- package/dist/order.d.ts.map +1 -0
- package/dist/order.js +1078 -0
- package/dist/order.js.map +1 -0
- package/dist/realm/index.d.ts +4 -0
- package/dist/realm/index.d.ts.map +1 -0
- package/dist/realm/index.js +20 -0
- package/dist/realm/index.js.map +1 -0
- package/dist/realm/pipelines.d.ts +32567 -0
- package/dist/realm/pipelines.d.ts.map +1 -0
- package/dist/realm/pipelines.js +1273 -0
- package/dist/realm/pipelines.js.map +1 -0
- package/dist/realm/queries.d.ts +1327 -0
- package/dist/realm/queries.d.ts.map +1 -0
- package/dist/realm/queries.js +456 -0
- package/dist/realm/queries.js.map +1 -0
- package/dist/realm/utilities.d.ts +1794 -0
- package/dist/realm/utilities.d.ts.map +1 -0
- package/dist/realm/utilities.js +594 -0
- package/dist/realm/utilities.js.map +1 -0
- package/dist/routing.d.ts +428 -0
- package/dist/routing.d.ts.map +1 -0
- package/dist/routing.js +60 -0
- package/dist/routing.js.map +1 -0
- package/dist/service.d.ts +264 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +60 -0
- package/dist/service.js.map +1 -0
- package/dist/shared/access.d.ts +102 -0
- package/dist/shared/access.d.ts.map +1 -0
- package/dist/shared/access.js +30 -0
- package/dist/shared/access.js.map +1 -0
- package/dist/shared/account.d.ts +44 -0
- package/dist/shared/account.d.ts.map +1 -0
- package/dist/shared/account.js +15 -0
- package/dist/shared/account.js.map +1 -0
- package/dist/shared/auth.d.ts +45 -0
- package/dist/shared/auth.d.ts.map +1 -0
- package/dist/shared/auth.js +19 -0
- package/dist/shared/auth.js.map +1 -0
- package/dist/shared/bucket.d.ts +294 -0
- package/dist/shared/bucket.d.ts.map +1 -0
- package/dist/shared/bucket.js +79 -0
- package/dist/shared/bucket.js.map +1 -0
- package/dist/shared/faq.d.ts +280 -0
- package/dist/shared/faq.d.ts.map +1 -0
- package/dist/shared/faq.js +73 -0
- package/dist/shared/faq.js.map +1 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +26 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/invitation.d.ts +1525 -0
- package/dist/shared/invitation.d.ts.map +1 -0
- package/dist/shared/invitation.js +60 -0
- package/dist/shared/invitation.js.map +1 -0
- package/dist/shared/operator.d.ts +956 -0
- package/dist/shared/operator.d.ts.map +1 -0
- package/dist/shared/operator.js +48 -0
- package/dist/shared/operator.js.map +1 -0
- package/dist/shared/tracking.d.ts +31 -0
- package/dist/shared/tracking.d.ts.map +1 -0
- package/dist/shared/tracking.js +23 -0
- package/dist/shared/tracking.js.map +1 -0
- package/dist/shared/user.d.ts +77 -0
- package/dist/shared/user.d.ts.map +1 -0
- package/dist/shared/user.js +22 -0
- package/dist/shared/user.js.map +1 -0
- package/dist/sync.d.ts +539 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +329 -0
- package/dist/sync.js.map +1 -0
- package/dist/time.d.ts +139 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +93 -0
- package/dist/time.js.map +1 -0
- package/dist/user.d.ts +394 -0
- package/dist/user.d.ts.map +1 -0
- package/dist/user.js +205 -0
- package/dist/user.js.map +1 -0
- package/dist/workspace/admin.d.ts +91 -0
- package/dist/workspace/admin.d.ts.map +1 -0
- package/dist/workspace/admin.js +33 -0
- package/dist/workspace/admin.js.map +1 -0
- package/dist/workspace/billing.d.ts +2 -0
- package/dist/workspace/billing.d.ts.map +1 -0
- package/dist/workspace/billing.js +18 -0
- package/dist/workspace/billing.js.map +1 -0
- package/dist/workspace/connector.d.ts +595 -0
- package/dist/workspace/connector.d.ts.map +1 -0
- package/dist/workspace/connector.js +229 -0
- package/dist/workspace/connector.js.map +1 -0
- package/dist/workspace/index.d.ts +36 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +21 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +70 -0
- package/src/api.ts +147 -0
- package/src/auth.ts +103 -0
- package/src/aux/agent-rvs.ts +596 -0
- package/src/aux/agents.ts +542 -0
- package/src/aux/customer-rvs.ts +421 -0
- package/src/aux/customers.ts +80 -0
- package/src/aux/index.ts +4 -0
- package/src/billing.ts +330 -0
- package/src/bucket.ts +58 -0
- package/src/context.ts +167 -0
- package/src/csp/analytics.ts +238 -0
- package/src/csp/base.ts +18 -0
- package/src/csp/index.ts +41 -0
- package/src/csp/inventory.ts +325 -0
- package/src/csp/order.ts +485 -0
- package/src/csp/webhook.ts +269 -0
- package/src/de.profile.ts +123 -0
- package/src/dev/developer.ts +90 -0
- package/src/dev/index.ts +81 -0
- package/src/entity.ts +154 -0
- package/src/events.ts +349 -0
- package/src/faq.ts +39 -0
- package/src/geo.ts +111 -0
- package/src/index.ts +48 -0
- package/src/inventory.ts +405 -0
- package/src/invoice.ts +37 -0
- package/src/iotsp/device.ts +334 -0
- package/src/iotsp/index.ts +91 -0
- package/src/iotsp/rule.ts +227 -0
- package/src/iotsp/topic.ts +191 -0
- package/src/lsp/carrier/analytics.ts +393 -0
- package/src/lsp/carrier/capabilities.ts +1009 -0
- package/src/lsp/carrier/capacities.ts +723 -0
- package/src/lsp/carrier/index.ts +175 -0
- package/src/lsp/carrier/performance.ts +145 -0
- package/src/lsp/carrier/utilities.ts +654 -0
- package/src/lsp/consolidation.ts +420 -0
- package/src/lsp/coverage.ts +869 -0
- package/src/lsp/fleet/index.ts +327 -0
- package/src/lsp/fleet/maintenance.ts +478 -0
- package/src/lsp/fleet/parking.ts +582 -0
- package/src/lsp/fleet/vehicle.ts +381 -0
- package/src/lsp/graph.ts +113 -0
- package/src/lsp/hub/analytics.ts +236 -0
- package/src/lsp/hub/capabilities.ts +549 -0
- package/src/lsp/hub/capacities.ts +590 -0
- package/src/lsp/hub/index.ts +298 -0
- package/src/lsp/hub/performance.ts +89 -0
- package/src/lsp/hub/utilities.ts +560 -0
- package/src/lsp/index.ts +125 -0
- package/src/lsp/operations.ts +304 -0
- package/src/lsp/order/delivery.ts +212 -0
- package/src/lsp/order/flow/processes.ts +70 -0
- package/src/lsp/order/flow/stages.ts +119 -0
- package/src/lsp/order/inbound.ts +231 -0
- package/src/lsp/order/internal.ts +305 -0
- package/src/lsp/order/management.ts +367 -0
- package/src/lsp/order/outbound.ts +128 -0
- package/src/lsp/order/passthrough.ts +434 -0
- package/src/lsp/order/ride.ts +190 -0
- package/src/lsp/order/shipping.ts +263 -0
- package/src/lsp/performance.ts +2 -0
- package/src/lsp/pod/index.ts +323 -0
- package/src/lsp/pricing.ts +1097 -0
- package/src/lsp/processing.ts +243 -0
- package/src/lsp/product.ts +104 -0
- package/src/lsp/psl.ts +399 -0
- package/src/lsp/terminal/analytics.ts +334 -0
- package/src/lsp/terminal/capabilities.ts +541 -0
- package/src/lsp/terminal/capacities.ts +556 -0
- package/src/lsp/terminal/index.ts +442 -0
- package/src/lsp/terminal/performance.ts +168 -0
- package/src/lsp/terminal/utilities.ts +173 -0
- package/src/lsp/warehouse/analytics.ts +248 -0
- package/src/lsp/warehouse/capabilities.ts +673 -0
- package/src/lsp/warehouse/capacities.ts +538 -0
- package/src/lsp/warehouse/index.ts +298 -0
- package/src/lsp/warehouse/performance.ts +83 -0
- package/src/lsp/warehouse/utilities.ts +634 -0
- package/src/lsp/zones.ts +148 -0
- package/src/measure.ts +240 -0
- package/src/operator.ts +39 -0
- package/src/order.ts +1207 -0
- package/src/realm/index.ts +3 -0
- package/src/realm/pipelines.ts +1607 -0
- package/src/realm/queries.ts +608 -0
- package/src/realm/utilities.ts +730 -0
- package/src/routing.ts +69 -0
- package/src/service.ts +66 -0
- package/src/shared/access.ts +58 -0
- package/src/shared/account.ts +25 -0
- package/src/shared/auth.ts +30 -0
- package/src/shared/bucket.ts +153 -0
- package/src/shared/faq.ts +139 -0
- package/src/shared/index.ts +9 -0
- package/src/shared/invitation.ts +124 -0
- package/src/shared/operator.ts +159 -0
- package/src/shared/tracking.ts +30 -0
- package/src/shared/user.ts +42 -0
- package/src/sync.ts +364 -0
- package/src/time.ts +113 -0
- package/src/user.ts +243 -0
- package/src/workspace/admin.ts +38 -0
- package/src/workspace/billing.ts +1 -0
- package/src/workspace/connector.ts +270 -0
- package/src/workspace/index.ts +22 -0
package/dist/order.js
ADDED
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderStatsSchema = exports.OrderSearchSchema = exports.LSPBaseOrderSchema = exports.RideBaseOrderSchema = exports.RideOrderTypeSchema = exports.BaseOrderSchema = exports.OrderClientSchema = exports.OrderInlineClientSchema = exports.OrderProfileClientSchema = exports.OrderClientRelationshipSchema = exports.OrderNoteSchema = exports.OrderRoutingConfigSchema = exports.OrderRoutingStrategySchema = exports.OrderRoutingModeSchema = exports.OrderTrackingSchema = exports.BaseOrderFlowPrioritySchema = exports.BaseOrderStatusSchema = exports.BASE_ORDER_STATUSES = exports.OrderDeconsolidationSchema = exports.OrderConsolidationSchema = exports.ConsolidationTypeSchema = exports.OrderExceptionSchema = exports.OrderAssigneeSchema = exports.LSP_PROCESS_STAGE_MAPS = exports.ProcessStageTransitionMapSchema = exports.LSP_COMPENSATION_STRATEGIES = exports.CompensationStrategySchema = exports.LSP_LIFECYCLE_POLICIES = exports.OrderLifecyclePolicySchema = exports.OrderHierarchySchema = exports.GenericOrderProcessorSchema = exports.CompositionMetadataSchema = exports.ChildOrderRelationshipSchema = exports.ParentStateAtCreationSchema = exports.RelationshipTypeSchema = exports.CompositionReasonSchema = exports.CompensationActionSchema = exports.OrderIntentSchema = exports.OrderOperationSchema = exports.OrderPaymentSchema = exports.OrderPaymentModeSchema = exports.OrderPaymentStatusSchema = exports.OrderPackageSchema = exports.OrderPackageItemSchema = exports.OrderPackageCategorySchema = exports.OrderPackageTypeSchema = exports.OrderItemSchema = exports.OrderItemStatusSchema = exports.OrderRequirementSchema = exports.OrderPrioritySchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const measure_1 = require("./measure");
|
|
6
|
+
const time_1 = require("./time");
|
|
7
|
+
const context_1 = require("./context");
|
|
8
|
+
const lsp_1 = require("./lsp");
|
|
9
|
+
const user_1 = require("./user");
|
|
10
|
+
const de_profile_1 = require("./de.profile");
|
|
11
|
+
const geo_1 = require("./geo");
|
|
12
|
+
const realm_1 = require("./realm");
|
|
13
|
+
// Order Priority Schema
|
|
14
|
+
exports.OrderPrioritySchema = typebox_1.Type.Union([
|
|
15
|
+
typebox_1.Type.Literal('STANDARD'),
|
|
16
|
+
typebox_1.Type.Literal('EXPRESS'),
|
|
17
|
+
typebox_1.Type.Literal('OVERNIGHT'),
|
|
18
|
+
typebox_1.Type.Literal('SAME_DAY'),
|
|
19
|
+
typebox_1.Type.Literal('FREIGHT'),
|
|
20
|
+
typebox_1.Type.Literal('WHITE_GLOVE'),
|
|
21
|
+
typebox_1.Type.Literal('VIS') // VIS: Very Important Shipment
|
|
22
|
+
]);
|
|
23
|
+
// Order Requirement Schema
|
|
24
|
+
exports.OrderRequirementSchema = typebox_1.Type.Union([
|
|
25
|
+
typebox_1.Type.Literal('SIGNATURE_REQUIRED'),
|
|
26
|
+
typebox_1.Type.Literal('AGE_VERIFICATION'),
|
|
27
|
+
typebox_1.Type.Literal('APPOINTMENT_DELIVERY'),
|
|
28
|
+
typebox_1.Type.Literal('INSIDE_DELIVERY'),
|
|
29
|
+
typebox_1.Type.Literal('TEMPERATURE_CONTROLLED'),
|
|
30
|
+
typebox_1.Type.Literal('HAZMAT_CERTIFIED'),
|
|
31
|
+
typebox_1.Type.Literal('FRAGILE_HANDLING')
|
|
32
|
+
]);
|
|
33
|
+
// Order Item Schemas
|
|
34
|
+
exports.OrderItemStatusSchema = typebox_1.Type.Union([
|
|
35
|
+
typebox_1.Type.Literal('PENDING'),
|
|
36
|
+
typebox_1.Type.Literal('ALLOCATED'),
|
|
37
|
+
typebox_1.Type.Literal('PICKED'),
|
|
38
|
+
typebox_1.Type.Literal('PACKED'),
|
|
39
|
+
typebox_1.Type.Literal('SHIPPED'),
|
|
40
|
+
typebox_1.Type.Literal('BACKORDERED'),
|
|
41
|
+
typebox_1.Type.Literal('DELIVERED'),
|
|
42
|
+
typebox_1.Type.Literal('CANCELLED')
|
|
43
|
+
]);
|
|
44
|
+
exports.OrderItemSchema = typebox_1.Type.Object({
|
|
45
|
+
id: typebox_1.Type.String(),
|
|
46
|
+
orderRef: typebox_1.Type.String(),
|
|
47
|
+
productId: typebox_1.Type.String(),
|
|
48
|
+
sku: typebox_1.Type.String(),
|
|
49
|
+
name: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
50
|
+
quantity: typebox_1.Type.Number({ minimum: 1 }),
|
|
51
|
+
quantityFulfilled: typebox_1.Type.Number({ minimum: 0 }),
|
|
52
|
+
unitPrice: measure_1.MoneySchema,
|
|
53
|
+
taxes: measure_1.MoneySchema,
|
|
54
|
+
discounts: typebox_1.Type.Optional(measure_1.MoneySchema),
|
|
55
|
+
slotId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
56
|
+
lotNumber: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
57
|
+
serialNumbers: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
58
|
+
specialHandling: typebox_1.Type.Optional(typebox_1.Type.Array(measure_1.SpecialHandlingSchema)),
|
|
59
|
+
notes: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500 })),
|
|
60
|
+
status: exports.OrderItemStatusSchema
|
|
61
|
+
});
|
|
62
|
+
// Order Package Schemas
|
|
63
|
+
exports.OrderPackageTypeSchema = typebox_1.Type.Union([
|
|
64
|
+
typebox_1.Type.Literal('BOX'),
|
|
65
|
+
typebox_1.Type.Literal('TUBE'),
|
|
66
|
+
typebox_1.Type.Literal('ENVELOPE'),
|
|
67
|
+
typebox_1.Type.Literal('PALLET'),
|
|
68
|
+
typebox_1.Type.Literal('CUSTOM')
|
|
69
|
+
]);
|
|
70
|
+
exports.OrderPackageCategorySchema = typebox_1.Type.Union([
|
|
71
|
+
typebox_1.Type.Literal('FD'), // Food & Drinks / Food Delivery
|
|
72
|
+
typebox_1.Type.Literal('GR'), // Groceries
|
|
73
|
+
typebox_1.Type.Literal('FT'), // Furniture
|
|
74
|
+
typebox_1.Type.Literal('EC'), // Electronics
|
|
75
|
+
typebox_1.Type.Literal('CT'), // Clothing & Textiles
|
|
76
|
+
typebox_1.Type.Literal('MC'), // Medical Care / Medical & Cosmetics
|
|
77
|
+
typebox_1.Type.Literal('JR'), // Jewelry
|
|
78
|
+
typebox_1.Type.Literal('BP'), // Books & Publications
|
|
79
|
+
typebox_1.Type.Literal('WD'), // White Goods (appliances) / Wooden items
|
|
80
|
+
typebox_1.Type.Literal('EM'), // Emergency / Express Mail
|
|
81
|
+
typebox_1.Type.Literal('CM'), // Chemicals / Cosmetics
|
|
82
|
+
typebox_1.Type.Literal('SG'), // Sporting Goods
|
|
83
|
+
typebox_1.Type.Literal('IM'), // Industrial Materials / Import
|
|
84
|
+
typebox_1.Type.Literal('TY'), // Toys
|
|
85
|
+
typebox_1.Type.Literal('DM'), // Documents / Direct Mail
|
|
86
|
+
typebox_1.Type.Literal('AM'), // Automotive / Art & Media
|
|
87
|
+
typebox_1.Type.Literal('VC'), // Vehicle Components / Video Content
|
|
88
|
+
typebox_1.Type.Literal('HC'), // Health Care / Home Care
|
|
89
|
+
typebox_1.Type.Literal('UT'), // Utilities / Tools
|
|
90
|
+
typebox_1.Type.Literal('MN') // Machinery / Maintenance
|
|
91
|
+
]);
|
|
92
|
+
exports.OrderPackageItemSchema = typebox_1.Type.Object({
|
|
93
|
+
itemId: typebox_1.Type.String(),
|
|
94
|
+
productId: typebox_1.Type.String(),
|
|
95
|
+
quantity: typebox_1.Type.Number({ minimum: 1 }),
|
|
96
|
+
source: typebox_1.Type.String(),
|
|
97
|
+
serialNumbers: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
98
|
+
lotNumber: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]))
|
|
99
|
+
});
|
|
100
|
+
exports.OrderPackageSchema = typebox_1.Type.Object({
|
|
101
|
+
id: typebox_1.Type.String(),
|
|
102
|
+
// Serve as package Number
|
|
103
|
+
packageNumber: typebox_1.Type.Number({ minimum: 1 }),
|
|
104
|
+
// Package Tracking Code - Hierarchical tracking
|
|
105
|
+
tracking: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
106
|
+
masterTrackingNumber: typebox_1.Type.String(),
|
|
107
|
+
trackingNumber: typebox_1.Type.String(),
|
|
108
|
+
carrierTrackingNumber: typebox_1.Type.Optional(typebox_1.Type.String())
|
|
109
|
+
})),
|
|
110
|
+
type: exports.OrderPackageTypeSchema,
|
|
111
|
+
category: exports.OrderPackageCategorySchema,
|
|
112
|
+
/**
|
|
113
|
+
* Attach Waypoint No to the package for better
|
|
114
|
+
* referencing after routing optimization
|
|
115
|
+
*/
|
|
116
|
+
waypointNo: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
117
|
+
shipmentId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
118
|
+
// Classification care level of the package: From 1 to 5
|
|
119
|
+
careLevel: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 1, maximum: 5 })),
|
|
120
|
+
weight: typebox_1.Type.Optional(measure_1.WeightSchema),
|
|
121
|
+
volume: typebox_1.Type.Optional(measure_1.VolumeSchema),
|
|
122
|
+
dimensions: typebox_1.Type.Optional(measure_1.DimensionsSchema),
|
|
123
|
+
temperature: typebox_1.Type.Optional(measure_1.TemperatureSchema),
|
|
124
|
+
notes: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500 })),
|
|
125
|
+
items: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderPackageItemSchema)),
|
|
126
|
+
specialHandling: typebox_1.Type.Optional(typebox_1.Type.Array(measure_1.SpecialHandlingSchema)),
|
|
127
|
+
added: typebox_1.Type.Optional(time_1.ActionRecordSchema),
|
|
128
|
+
updated: typebox_1.Type.Optional(time_1.ActionRecordSchema)
|
|
129
|
+
});
|
|
130
|
+
// Order Payment Schemas
|
|
131
|
+
exports.OrderPaymentStatusSchema = typebox_1.Type.Union([
|
|
132
|
+
typebox_1.Type.Literal('PENDING'),
|
|
133
|
+
typebox_1.Type.Literal('AUTHORIZED'),
|
|
134
|
+
typebox_1.Type.Literal('CAPTURED'),
|
|
135
|
+
typebox_1.Type.Literal('FAILED'),
|
|
136
|
+
typebox_1.Type.Literal('REFUNDED')
|
|
137
|
+
]);
|
|
138
|
+
exports.OrderPaymentModeSchema = typebox_1.Type.Union([
|
|
139
|
+
typebox_1.Type.Literal('PREPAY'),
|
|
140
|
+
typebox_1.Type.Literal('POSTPAY'),
|
|
141
|
+
typebox_1.Type.Literal('CASH')
|
|
142
|
+
]);
|
|
143
|
+
exports.OrderPaymentSchema = typebox_1.Type.Object({
|
|
144
|
+
// Mode of payment: Define by LSP
|
|
145
|
+
mode: exports.OrderPaymentModeSchema,
|
|
146
|
+
// Operation request payment state
|
|
147
|
+
status: exports.OrderPaymentStatusSchema,
|
|
148
|
+
method: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
149
|
+
option: typebox_1.Type.Optional(typebox_1.Type.String())
|
|
150
|
+
});
|
|
151
|
+
// Order Operation Schema
|
|
152
|
+
exports.OrderOperationSchema = typebox_1.Type.Object({
|
|
153
|
+
fees: typebox_1.Type.Object({
|
|
154
|
+
cost: measure_1.MoneySchema,
|
|
155
|
+
taxes: typebox_1.Type.Optional(measure_1.MoneySchema),
|
|
156
|
+
discount: typebox_1.Type.Optional(measure_1.MoneySchema),
|
|
157
|
+
total: measure_1.MoneySchema
|
|
158
|
+
}),
|
|
159
|
+
payment: exports.OrderPaymentSchema,
|
|
160
|
+
rating: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 1, maximum: 5 }))
|
|
161
|
+
});
|
|
162
|
+
// Order Intent Schema
|
|
163
|
+
exports.OrderIntentSchema = typebox_1.Type.Object({
|
|
164
|
+
connectorId: typebox_1.Type.String(), // Access/Auth connector from which the intent token was issued
|
|
165
|
+
customerId: typebox_1.Type.String(), // Unique ID/reference of the client
|
|
166
|
+
origin: typebox_1.Type.String({ format: 'uri' }) // Domain origin from where order is intent from
|
|
167
|
+
});
|
|
168
|
+
// Compensation Action Schema - Defines what to do on failure (declared early for use in hierarchy)
|
|
169
|
+
exports.CompensationActionSchema = typebox_1.Type.Union([
|
|
170
|
+
typebox_1.Type.Literal('ROLLBACK_ALL'),
|
|
171
|
+
typebox_1.Type.Literal('ROLLBACK_SIBLINGS'),
|
|
172
|
+
typebox_1.Type.Literal('MARK_FAILED'),
|
|
173
|
+
typebox_1.Type.Literal('COMPENSATE'),
|
|
174
|
+
typebox_1.Type.Literal('MANUAL_INTERVENTION'),
|
|
175
|
+
typebox_1.Type.Literal('IGNORE')
|
|
176
|
+
]);
|
|
177
|
+
// ========================================================================
|
|
178
|
+
// ORDER COMPOSITION METADATA (Flaw #10 Fix)
|
|
179
|
+
// ========================================================================
|
|
180
|
+
// Creation Reason - WHY was this child order created?
|
|
181
|
+
exports.CompositionReasonSchema = typebox_1.Type.Union([
|
|
182
|
+
typebox_1.Type.Literal('LIFECYCLE_REQUIREMENT'), // Required by order type lifecycle
|
|
183
|
+
typebox_1.Type.Literal('PIPELINE_STAGE'), // Created by pipeline template
|
|
184
|
+
typebox_1.Type.Literal('AUTOMATIC_RULE'), // Triggered by business rule
|
|
185
|
+
typebox_1.Type.Literal('CONDITIONAL_TRIGGER'), // Condition met (e.g., value > $1000)
|
|
186
|
+
typebox_1.Type.Literal('EXCEPTION_HANDLING'), // Exception/failure recovery
|
|
187
|
+
typebox_1.Type.Literal('MANUAL_REQUEST'), // Operator/manager created
|
|
188
|
+
typebox_1.Type.Literal('COMPENSATION'), // Created as compensating action
|
|
189
|
+
typebox_1.Type.Literal('SPLIT_ORDER') // Split from larger order
|
|
190
|
+
]);
|
|
191
|
+
// Relationship Type - Semantic meaning of parent-child relationship
|
|
192
|
+
exports.RelationshipTypeSchema = typebox_1.Type.Union([
|
|
193
|
+
typebox_1.Type.Literal('MANDATORY'), // Must complete before parent can complete
|
|
194
|
+
typebox_1.Type.Literal('OPTIONAL'), // Parent can complete without this child
|
|
195
|
+
typebox_1.Type.Literal('CONDITIONAL') // Depends on runtime conditions
|
|
196
|
+
]);
|
|
197
|
+
// Parent State at Child Creation - Context of parent when child was spawned
|
|
198
|
+
exports.ParentStateAtCreationSchema = typebox_1.Type.Object({
|
|
199
|
+
process: typebox_1.Type.String(),
|
|
200
|
+
stage: typebox_1.Type.String(),
|
|
201
|
+
status: typebox_1.Type.String()
|
|
202
|
+
});
|
|
203
|
+
// Child Order Relationship Metadata
|
|
204
|
+
exports.ChildOrderRelationshipSchema = typebox_1.Type.Object({
|
|
205
|
+
type: exports.RelationshipTypeSchema,
|
|
206
|
+
canBlockParent: typebox_1.Type.Boolean(), // Can this child block parent completion?
|
|
207
|
+
sequence: typebox_1.Type.Optional(typebox_1.Type.Number()), // Order in execution sequence
|
|
208
|
+
dependencies: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())) // Sibling order references this depends on
|
|
209
|
+
});
|
|
210
|
+
// Additional composition metadata
|
|
211
|
+
exports.CompositionMetadataSchema = typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
212
|
+
trigger: typebox_1.Type.Optional(typebox_1.Type.String()), // What triggered creation
|
|
213
|
+
notes: typebox_1.Type.Optional(typebox_1.Type.String()), // Human notes
|
|
214
|
+
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())) // Categorization tags
|
|
215
|
+
}));
|
|
216
|
+
exports.GenericOrderProcessorSchema = typebox_1.Type.Object({
|
|
217
|
+
context: context_1.ContextSchema,
|
|
218
|
+
service: context_1.GenericServiceContextSchema
|
|
219
|
+
});
|
|
220
|
+
// Order Hierarchy Schema (Parent-Child Relationships)
|
|
221
|
+
exports.OrderHierarchySchema = typebox_1.Type.Object({
|
|
222
|
+
// Is this the root/parent order (CSP's original order)?
|
|
223
|
+
isRoot: typebox_1.Type.Boolean(),
|
|
224
|
+
// Reference to root order (always set for non-root orders)
|
|
225
|
+
rootOrderId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
226
|
+
rootOrderReference: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
227
|
+
rootOrderType: typebox_1.Type.Optional(lsp_1.LSPOrderTypeSchema),
|
|
228
|
+
// Immediate parent order (for multi-level hierarchies)
|
|
229
|
+
parentOrderId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
230
|
+
parentOrderReference: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
231
|
+
parentOrderType: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
232
|
+
// Child orders spawned from this order
|
|
233
|
+
childOrders: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
234
|
+
orderId: typebox_1.Type.String(),
|
|
235
|
+
orderReference: typebox_1.Type.String(),
|
|
236
|
+
orderType: typebox_1.Type.String(),
|
|
237
|
+
processor: exports.GenericOrderProcessorSchema,
|
|
238
|
+
status: typebox_1.Type.String(),
|
|
239
|
+
created: time_1.ActionRecordSchema, // Who/what/when
|
|
240
|
+
// Composition metadata
|
|
241
|
+
creationReason: exports.CompositionReasonSchema,
|
|
242
|
+
parentStateAtCreation: exports.ParentStateAtCreationSchema,
|
|
243
|
+
relationship: exports.ChildOrderRelationshipSchema,
|
|
244
|
+
metadata: exports.CompositionMetadataSchema,
|
|
245
|
+
// Compensation tracking
|
|
246
|
+
compensation: typebox_1.Type.Object({
|
|
247
|
+
compensated: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
248
|
+
recorded: typebox_1.Type.Optional(time_1.ActionRecordSchema),
|
|
249
|
+
action: typebox_1.Type.Optional(exports.CompensationActionSchema),
|
|
250
|
+
reason: typebox_1.Type.Optional(typebox_1.Type.String())
|
|
251
|
+
})
|
|
252
|
+
}))),
|
|
253
|
+
// Denormalized descendant tracking (Flaw #9 Fix)
|
|
254
|
+
allDescendantReferences: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
255
|
+
descendantCount: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 0, default: 0 })),
|
|
256
|
+
descendantsByType: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Array(typebox_1.Type.String()))),
|
|
257
|
+
// Order depth in hierarchy (root = 0, first child = 1, etc.)
|
|
258
|
+
depth: typebox_1.Type.Number({ minimum: 0, default: 0 }),
|
|
259
|
+
// Compensation state
|
|
260
|
+
compensationState: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
261
|
+
isCompensating: typebox_1.Type.Boolean(),
|
|
262
|
+
compensationStarted: typebox_1.Type.Optional(time_1.ActionRecordSchema),
|
|
263
|
+
compensationCompleted: typebox_1.Type.Optional(time_1.ActionRecordSchema),
|
|
264
|
+
compensationStrategy: typebox_1.Type.Optional(exports.CompensationActionSchema),
|
|
265
|
+
compensatedChildren: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
266
|
+
failedCompensations: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
267
|
+
childReference: typebox_1.Type.String(),
|
|
268
|
+
error: typebox_1.Type.String(),
|
|
269
|
+
timestamp: typebox_1.Type.Number()
|
|
270
|
+
})))
|
|
271
|
+
}))
|
|
272
|
+
});
|
|
273
|
+
// ========================================================================
|
|
274
|
+
// ORDER LIFECYCLE POLICIES
|
|
275
|
+
// ========================================================================
|
|
276
|
+
// Order Lifecycle Policy Schema - Defines parent-child completion rules
|
|
277
|
+
exports.OrderLifecyclePolicySchema = typebox_1.Type.Object({
|
|
278
|
+
// Parent completion rules
|
|
279
|
+
parentCompletion: typebox_1.Type.Object({
|
|
280
|
+
requireAllChildrenComplete: typebox_1.Type.Boolean(),
|
|
281
|
+
requiredChildStatuses: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
282
|
+
allowCompletionIfChildrenAre: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String()))
|
|
283
|
+
}),
|
|
284
|
+
// Parent cancellation rules
|
|
285
|
+
parentCancellation: typebox_1.Type.Object({
|
|
286
|
+
allowWithActiveChildren: typebox_1.Type.Boolean(),
|
|
287
|
+
childAction: typebox_1.Type.Union([
|
|
288
|
+
typebox_1.Type.Literal('CASCADE_CANCEL'),
|
|
289
|
+
typebox_1.Type.Literal('ORPHAN'),
|
|
290
|
+
typebox_1.Type.Literal('COMPLETE_FIRST'),
|
|
291
|
+
typebox_1.Type.Literal('SUSPEND')
|
|
292
|
+
])
|
|
293
|
+
}),
|
|
294
|
+
// Child completion rules
|
|
295
|
+
childCompletion: typebox_1.Type.Object({
|
|
296
|
+
requireActiveParent: typebox_1.Type.Boolean(),
|
|
297
|
+
notifyParent: typebox_1.Type.Boolean(),
|
|
298
|
+
autoCompleteParent: typebox_1.Type.Boolean()
|
|
299
|
+
})
|
|
300
|
+
});
|
|
301
|
+
// LSP Order Lifecycle Policies - Business rules for order relationships
|
|
302
|
+
exports.LSP_LIFECYCLE_POLICIES = {
|
|
303
|
+
'OutboundOrder': {
|
|
304
|
+
parentCompletion: {
|
|
305
|
+
requireAllChildrenComplete: true,
|
|
306
|
+
requiredChildStatuses: ['COMPLETED', 'SHIPPED'],
|
|
307
|
+
allowCompletionIfChildrenAre: ['COMPLETED', 'SHIPPED', 'DELIVERED']
|
|
308
|
+
},
|
|
309
|
+
parentCancellation: {
|
|
310
|
+
allowWithActiveChildren: false,
|
|
311
|
+
childAction: 'CASCADE_CANCEL'
|
|
312
|
+
},
|
|
313
|
+
childCompletion: {
|
|
314
|
+
requireActiveParent: true,
|
|
315
|
+
notifyParent: true,
|
|
316
|
+
autoCompleteParent: true
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
'InboundOrder': {
|
|
320
|
+
parentCompletion: {
|
|
321
|
+
requireAllChildrenComplete: true,
|
|
322
|
+
requiredChildStatuses: ['COMPLETED'],
|
|
323
|
+
allowCompletionIfChildrenAre: ['COMPLETED']
|
|
324
|
+
},
|
|
325
|
+
parentCancellation: {
|
|
326
|
+
allowWithActiveChildren: false,
|
|
327
|
+
childAction: 'CASCADE_CANCEL'
|
|
328
|
+
},
|
|
329
|
+
childCompletion: {
|
|
330
|
+
requireActiveParent: true,
|
|
331
|
+
notifyParent: true,
|
|
332
|
+
autoCompleteParent: true
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
'InternalOrder': {
|
|
336
|
+
parentCompletion: {
|
|
337
|
+
requireAllChildrenComplete: true,
|
|
338
|
+
requiredChildStatuses: ['COMPLETED'],
|
|
339
|
+
allowCompletionIfChildrenAre: ['COMPLETED']
|
|
340
|
+
},
|
|
341
|
+
parentCancellation: {
|
|
342
|
+
allowWithActiveChildren: true,
|
|
343
|
+
childAction: 'CASCADE_CANCEL'
|
|
344
|
+
},
|
|
345
|
+
childCompletion: {
|
|
346
|
+
requireActiveParent: true,
|
|
347
|
+
notifyParent: true,
|
|
348
|
+
autoCompleteParent: true
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
'ShippingOrder': {
|
|
352
|
+
parentCompletion: {
|
|
353
|
+
requireAllChildrenComplete: true,
|
|
354
|
+
requiredChildStatuses: ['COMPLETED', 'DELIVERED'],
|
|
355
|
+
allowCompletionIfChildrenAre: ['DELIVERED', 'COMPLETED']
|
|
356
|
+
},
|
|
357
|
+
parentCancellation: {
|
|
358
|
+
allowWithActiveChildren: false,
|
|
359
|
+
childAction: 'COMPLETE_FIRST'
|
|
360
|
+
},
|
|
361
|
+
childCompletion: {
|
|
362
|
+
requireActiveParent: true,
|
|
363
|
+
notifyParent: true,
|
|
364
|
+
autoCompleteParent: false
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
'PassthroughOrder': {
|
|
368
|
+
parentCompletion: {
|
|
369
|
+
requireAllChildrenComplete: true,
|
|
370
|
+
requiredChildStatuses: ['COMPLETED', 'DISPATCHED'],
|
|
371
|
+
allowCompletionIfChildrenAre: ['COMPLETED', 'DISPATCHED']
|
|
372
|
+
},
|
|
373
|
+
parentCancellation: {
|
|
374
|
+
allowWithActiveChildren: true,
|
|
375
|
+
childAction: 'CASCADE_CANCEL'
|
|
376
|
+
},
|
|
377
|
+
childCompletion: {
|
|
378
|
+
requireActiveParent: true,
|
|
379
|
+
notifyParent: true,
|
|
380
|
+
autoCompleteParent: true
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
// ========================================================================
|
|
385
|
+
// COMPENSATION & ROLLBACK STRATEGIES
|
|
386
|
+
// ========================================================================
|
|
387
|
+
// Compensation Strategy Schema
|
|
388
|
+
exports.CompensationStrategySchema = typebox_1.Type.Object({
|
|
389
|
+
// What to do when a child order fails fatally
|
|
390
|
+
onChildFailure: typebox_1.Type.Object({
|
|
391
|
+
action: exports.CompensationActionSchema,
|
|
392
|
+
// Should we rollback parent?
|
|
393
|
+
rollbackParent: typebox_1.Type.Boolean(),
|
|
394
|
+
// Should we rollback siblings?
|
|
395
|
+
rollbackSiblings: typebox_1.Type.Boolean(),
|
|
396
|
+
// Should we rollback completed children?
|
|
397
|
+
rollbackCompletedChildren: typebox_1.Type.Boolean(),
|
|
398
|
+
// Custom compensation logic
|
|
399
|
+
compensatingActions: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
400
|
+
orderType: typebox_1.Type.String(),
|
|
401
|
+
action: typebox_1.Type.String(),
|
|
402
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Any()))
|
|
403
|
+
})))
|
|
404
|
+
}),
|
|
405
|
+
// What to do when parent fails
|
|
406
|
+
onParentFailure: typebox_1.Type.Object({
|
|
407
|
+
action: exports.CompensationActionSchema,
|
|
408
|
+
// Should we cancel active children?
|
|
409
|
+
cancelActiveChildren: typebox_1.Type.Boolean(),
|
|
410
|
+
// Should we rollback completed children?
|
|
411
|
+
rollbackCompletedChildren: typebox_1.Type.Boolean(),
|
|
412
|
+
// Custom compensation logic
|
|
413
|
+
compensatingActions: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
414
|
+
orderType: typebox_1.Type.String(),
|
|
415
|
+
action: typebox_1.Type.String(),
|
|
416
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Any()))
|
|
417
|
+
})))
|
|
418
|
+
}),
|
|
419
|
+
// Cleanup after successful completion
|
|
420
|
+
onSuccess: typebox_1.Type.Object({
|
|
421
|
+
// Clean up intermediate child orders?
|
|
422
|
+
cleanupIntermediateOrders: typebox_1.Type.Boolean(),
|
|
423
|
+
// Archive completed children?
|
|
424
|
+
archiveChildren: typebox_1.Type.Boolean()
|
|
425
|
+
})
|
|
426
|
+
});
|
|
427
|
+
// LSP Compensation Strategies - Rollback policies per order type
|
|
428
|
+
exports.LSP_COMPENSATION_STRATEGIES = {
|
|
429
|
+
'OutboundOrder': {
|
|
430
|
+
onChildFailure: {
|
|
431
|
+
action: 'COMPENSATE',
|
|
432
|
+
rollbackParent: false, // Keep parent, let it retry
|
|
433
|
+
rollbackSiblings: true, // Cancel other picking/packing tasks
|
|
434
|
+
rollbackCompletedChildren: false, // Don't undo completed picks
|
|
435
|
+
compensatingActions: [
|
|
436
|
+
{
|
|
437
|
+
orderType: 'InternalOrder',
|
|
438
|
+
action: 'REVERSE_ALLOCATION', // Return allocated inventory
|
|
439
|
+
params: { reason: 'SIBLING_FAILURE' }
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
onParentFailure: {
|
|
444
|
+
action: 'ROLLBACK_ALL',
|
|
445
|
+
cancelActiveChildren: true, // Cancel all in-progress children
|
|
446
|
+
rollbackCompletedChildren: true // Reverse completed operations
|
|
447
|
+
},
|
|
448
|
+
onSuccess: {
|
|
449
|
+
cleanupIntermediateOrders: false, // Keep for audit
|
|
450
|
+
archiveChildren: true // Move to archive collection
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
'InboundOrder': {
|
|
454
|
+
onChildFailure: {
|
|
455
|
+
action: 'MARK_FAILED',
|
|
456
|
+
rollbackParent: false,
|
|
457
|
+
rollbackSiblings: false, // Let other putaway tasks continue
|
|
458
|
+
rollbackCompletedChildren: false
|
|
459
|
+
},
|
|
460
|
+
onParentFailure: {
|
|
461
|
+
action: 'ROLLBACK_ALL',
|
|
462
|
+
cancelActiveChildren: true,
|
|
463
|
+
rollbackCompletedChildren: true // Remove from inventory
|
|
464
|
+
},
|
|
465
|
+
onSuccess: {
|
|
466
|
+
cleanupIntermediateOrders: false,
|
|
467
|
+
archiveChildren: true
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
'InternalOrder': {
|
|
471
|
+
onChildFailure: {
|
|
472
|
+
action: 'ROLLBACK_SIBLINGS',
|
|
473
|
+
rollbackParent: false,
|
|
474
|
+
rollbackSiblings: true, // Cancel related warehouse tasks
|
|
475
|
+
rollbackCompletedChildren: false
|
|
476
|
+
},
|
|
477
|
+
onParentFailure: {
|
|
478
|
+
action: 'ROLLBACK_ALL',
|
|
479
|
+
cancelActiveChildren: true,
|
|
480
|
+
rollbackCompletedChildren: true // Reverse inventory moves
|
|
481
|
+
},
|
|
482
|
+
onSuccess: {
|
|
483
|
+
cleanupIntermediateOrders: true, // Clean up temporary tasks
|
|
484
|
+
archiveChildren: false
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
'ShippingOrder': {
|
|
488
|
+
onChildFailure: {
|
|
489
|
+
action: 'MANUAL_INTERVENTION', // Hub failures need manual handling
|
|
490
|
+
rollbackParent: false,
|
|
491
|
+
rollbackSiblings: false,
|
|
492
|
+
rollbackCompletedChildren: false
|
|
493
|
+
},
|
|
494
|
+
onParentFailure: {
|
|
495
|
+
action: 'COMPENSATE',
|
|
496
|
+
cancelActiveChildren: true,
|
|
497
|
+
rollbackCompletedChildren: false, // Can't undo physical shipment
|
|
498
|
+
compensatingActions: [
|
|
499
|
+
{
|
|
500
|
+
orderType: 'ShippingOrder',
|
|
501
|
+
action: 'CREATE_RETURN_SHIPMENT',
|
|
502
|
+
params: { reason: 'PARENT_FAILURE' }
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
onSuccess: {
|
|
507
|
+
cleanupIntermediateOrders: false,
|
|
508
|
+
archiveChildren: true
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
'PassthroughOrder': {
|
|
512
|
+
onChildFailure: {
|
|
513
|
+
action: 'ROLLBACK_SIBLINGS',
|
|
514
|
+
rollbackParent: false,
|
|
515
|
+
rollbackSiblings: true,
|
|
516
|
+
rollbackCompletedChildren: false
|
|
517
|
+
},
|
|
518
|
+
onParentFailure: {
|
|
519
|
+
action: 'ROLLBACK_ALL',
|
|
520
|
+
cancelActiveChildren: true,
|
|
521
|
+
rollbackCompletedChildren: true
|
|
522
|
+
},
|
|
523
|
+
onSuccess: {
|
|
524
|
+
cleanupIntermediateOrders: true,
|
|
525
|
+
archiveChildren: true
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
// ========================================================================
|
|
530
|
+
// PROCESS-STAGE TRANSITION MAPS
|
|
531
|
+
// ========================================================================
|
|
532
|
+
// Process-Stage Transition Map - Defines valid stages per process
|
|
533
|
+
exports.ProcessStageTransitionMapSchema = typebox_1.Type.Object({
|
|
534
|
+
process: typebox_1.Type.String(),
|
|
535
|
+
allowedStages: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
536
|
+
stageFlow: typebox_1.Type.Array(typebox_1.Type.Object({
|
|
537
|
+
from: typebox_1.Type.String(),
|
|
538
|
+
to: typebox_1.Type.Array(typebox_1.Type.String())
|
|
539
|
+
}))
|
|
540
|
+
});
|
|
541
|
+
// LSP Process-Stage Maps - Valid stage transitions per process
|
|
542
|
+
exports.LSP_PROCESS_STAGE_MAPS = {
|
|
543
|
+
// OUTBOUND ORDER PROCESS-STAGE MAPS
|
|
544
|
+
'OutboundOrder': {
|
|
545
|
+
'FULFILLMENT': {
|
|
546
|
+
process: 'FULFILLMENT',
|
|
547
|
+
allowedStages: ['PROCESSING', 'QUALITY_CHECK', 'ALLOCATING', 'PICKING', 'PACKING', 'STAGING', 'LOADING'],
|
|
548
|
+
stageFlow: [
|
|
549
|
+
{ from: 'PROCESSING', to: ['QUALITY_CHECK', 'ALLOCATING'] },
|
|
550
|
+
{ from: 'QUALITY_CHECK', to: ['ALLOCATING', 'PROCESSING'] },
|
|
551
|
+
{ from: 'ALLOCATING', to: ['PICKING'] },
|
|
552
|
+
{ from: 'PICKING', to: ['PACKING', 'QUALITY_CHECK'] },
|
|
553
|
+
{ from: 'PACKING', to: ['STAGING', 'QUALITY_CHECK'] },
|
|
554
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
555
|
+
{ from: 'LOADING', to: [] } // Terminal stage
|
|
556
|
+
]
|
|
557
|
+
},
|
|
558
|
+
'TRANSFER': {
|
|
559
|
+
process: 'TRANSFER',
|
|
560
|
+
allowedStages: ['PROCESSING', 'ALLOCATING', 'PICKING', 'STAGING', 'LOADING'],
|
|
561
|
+
stageFlow: [
|
|
562
|
+
{ from: 'PROCESSING', to: ['ALLOCATING'] },
|
|
563
|
+
{ from: 'ALLOCATING', to: ['PICKING'] },
|
|
564
|
+
{ from: 'PICKING', to: ['STAGING'] },
|
|
565
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
566
|
+
{ from: 'LOADING', to: [] }
|
|
567
|
+
]
|
|
568
|
+
},
|
|
569
|
+
'EXCEPTION': {
|
|
570
|
+
process: 'EXCEPTION',
|
|
571
|
+
allowedStages: ['PROCESSING', 'QUALITY_CHECK'],
|
|
572
|
+
stageFlow: [
|
|
573
|
+
{ from: 'PROCESSING', to: ['QUALITY_CHECK'] },
|
|
574
|
+
{ from: 'QUALITY_CHECK', to: [] }
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
// INBOUND ORDER PROCESS-STAGE MAPS
|
|
579
|
+
'InboundOrder': {
|
|
580
|
+
'RECEIVING': {
|
|
581
|
+
process: 'RECEIVING',
|
|
582
|
+
allowedStages: ['UNLOADING', 'INSPECTING', 'RECEIVING', 'PROCESSING'],
|
|
583
|
+
stageFlow: [
|
|
584
|
+
{ from: 'UNLOADING', to: ['INSPECTING'] },
|
|
585
|
+
{ from: 'INSPECTING', to: ['RECEIVING', 'PROCESSING'] },
|
|
586
|
+
{ from: 'RECEIVING', to: ['PROCESSING'] },
|
|
587
|
+
{ from: 'PROCESSING', to: [] }
|
|
588
|
+
]
|
|
589
|
+
},
|
|
590
|
+
'PUTAWAY': {
|
|
591
|
+
process: 'PUTAWAY',
|
|
592
|
+
allowedStages: ['PROCESSING', 'ALLOCATING', 'STORING'],
|
|
593
|
+
stageFlow: [
|
|
594
|
+
{ from: 'PROCESSING', to: ['ALLOCATING'] },
|
|
595
|
+
{ from: 'ALLOCATING', to: ['STORING'] },
|
|
596
|
+
{ from: 'STORING', to: [] }
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
'INVENTORY_ADJUSTMENT': {
|
|
600
|
+
process: 'INVENTORY_ADJUSTMENT',
|
|
601
|
+
allowedStages: ['PROCESSING', 'INSPECTING', 'RECEIVING'],
|
|
602
|
+
stageFlow: [
|
|
603
|
+
{ from: 'PROCESSING', to: ['INSPECTING'] },
|
|
604
|
+
{ from: 'INSPECTING', to: ['RECEIVING'] },
|
|
605
|
+
{ from: 'RECEIVING', to: [] }
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
'RETURN_PROCESSING': {
|
|
609
|
+
process: 'RETURN_PROCESSING',
|
|
610
|
+
allowedStages: ['UNLOADING', 'INSPECTING', 'PROCESSING', 'ALLOCATING', 'STORING'],
|
|
611
|
+
stageFlow: [
|
|
612
|
+
{ from: 'UNLOADING', to: ['INSPECTING'] },
|
|
613
|
+
{ from: 'INSPECTING', to: ['PROCESSING'] },
|
|
614
|
+
{ from: 'PROCESSING', to: ['ALLOCATING', 'STORING'] },
|
|
615
|
+
{ from: 'ALLOCATING', to: ['STORING'] },
|
|
616
|
+
{ from: 'STORING', to: [] }
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
'EXCEPTION': {
|
|
620
|
+
process: 'EXCEPTION',
|
|
621
|
+
allowedStages: ['PROCESSING', 'INSPECTING'],
|
|
622
|
+
stageFlow: [
|
|
623
|
+
{ from: 'PROCESSING', to: ['INSPECTING'] },
|
|
624
|
+
{ from: 'INSPECTING', to: [] }
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
// INTERNAL ORDER PROCESS-STAGE MAPS
|
|
629
|
+
'InternalOrder': {
|
|
630
|
+
'CYCLE_COUNT': {
|
|
631
|
+
process: 'CYCLE_COUNT',
|
|
632
|
+
allowedStages: ['PROCESSING', 'COUNTING', 'ADJUSTING'],
|
|
633
|
+
stageFlow: [
|
|
634
|
+
{ from: 'PROCESSING', to: ['COUNTING'] },
|
|
635
|
+
{ from: 'COUNTING', to: ['ADJUSTING'] },
|
|
636
|
+
{ from: 'ADJUSTING', to: [] }
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
'REPLENISHMENT': {
|
|
640
|
+
process: 'REPLENISHMENT',
|
|
641
|
+
allowedStages: ['PROCESSING', 'MOVING'],
|
|
642
|
+
stageFlow: [
|
|
643
|
+
{ from: 'PROCESSING', to: ['MOVING'] },
|
|
644
|
+
{ from: 'MOVING', to: [] }
|
|
645
|
+
]
|
|
646
|
+
},
|
|
647
|
+
'RELOCATION': {
|
|
648
|
+
process: 'RELOCATION',
|
|
649
|
+
allowedStages: ['PROCESSING', 'MOVING'],
|
|
650
|
+
stageFlow: [
|
|
651
|
+
{ from: 'PROCESSING', to: ['MOVING'] },
|
|
652
|
+
{ from: 'MOVING', to: [] }
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
'CONSOLIDATION': {
|
|
656
|
+
process: 'CONSOLIDATION',
|
|
657
|
+
allowedStages: ['PROCESSING', 'CONSOLIDATING'],
|
|
658
|
+
stageFlow: [
|
|
659
|
+
{ from: 'PROCESSING', to: ['CONSOLIDATING'] },
|
|
660
|
+
{ from: 'CONSOLIDATING', to: [] }
|
|
661
|
+
]
|
|
662
|
+
},
|
|
663
|
+
'KITTING': {
|
|
664
|
+
process: 'KITTING',
|
|
665
|
+
allowedStages: ['PROCESSING', 'KITTING'],
|
|
666
|
+
stageFlow: [
|
|
667
|
+
{ from: 'PROCESSING', to: ['KITTING'] },
|
|
668
|
+
{ from: 'KITTING', to: [] }
|
|
669
|
+
]
|
|
670
|
+
},
|
|
671
|
+
'ASSEMBLY': {
|
|
672
|
+
process: 'ASSEMBLY',
|
|
673
|
+
allowedStages: ['PROCESSING', 'ASSEMBLING'],
|
|
674
|
+
stageFlow: [
|
|
675
|
+
{ from: 'PROCESSING', to: ['ASSEMBLING'] },
|
|
676
|
+
{ from: 'ASSEMBLING', to: [] }
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
'EXCEPTION': {
|
|
680
|
+
process: 'EXCEPTION',
|
|
681
|
+
allowedStages: ['PROCESSING', 'EXCEPTION_REVIEW'],
|
|
682
|
+
stageFlow: [
|
|
683
|
+
{ from: 'PROCESSING', to: ['EXCEPTION_REVIEW'] },
|
|
684
|
+
{ from: 'EXCEPTION_REVIEW', to: [] }
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
// SHIPPING ORDER PROCESS-STAGE MAPS
|
|
689
|
+
'ShippingOrder': {
|
|
690
|
+
'COLLECTION': {
|
|
691
|
+
process: 'COLLECTION',
|
|
692
|
+
allowedStages: ['DISPATCHING', 'COLLECTING', 'CONFIRMING'],
|
|
693
|
+
stageFlow: [
|
|
694
|
+
{ from: 'DISPATCHING', to: ['COLLECTING'] },
|
|
695
|
+
{ from: 'COLLECTING', to: ['CONFIRMING'] },
|
|
696
|
+
{ from: 'CONFIRMING', to: [] }
|
|
697
|
+
]
|
|
698
|
+
},
|
|
699
|
+
'LINEHAUL': {
|
|
700
|
+
process: 'LINEHAUL',
|
|
701
|
+
allowedStages: ['DISPATCHING', 'TRANSPORTING', 'TRANSFERRING'],
|
|
702
|
+
stageFlow: [
|
|
703
|
+
{ from: 'DISPATCHING', to: ['TRANSPORTING'] },
|
|
704
|
+
{ from: 'TRANSPORTING', to: ['TRANSFERRING'] },
|
|
705
|
+
{ from: 'TRANSFERRING', to: [] }
|
|
706
|
+
]
|
|
707
|
+
},
|
|
708
|
+
'DELIVERY': {
|
|
709
|
+
process: 'DELIVERY',
|
|
710
|
+
allowedStages: ['DISPATCHING', 'TRANSPORTING', 'DELIVERING', 'CONFIRMING'],
|
|
711
|
+
stageFlow: [
|
|
712
|
+
{ from: 'DISPATCHING', to: ['TRANSPORTING'] },
|
|
713
|
+
{ from: 'TRANSPORTING', to: ['DELIVERING'] },
|
|
714
|
+
{ from: 'DELIVERING', to: ['CONFIRMING'] },
|
|
715
|
+
{ from: 'CONFIRMING', to: [] }
|
|
716
|
+
]
|
|
717
|
+
},
|
|
718
|
+
'TRANSFER': {
|
|
719
|
+
process: 'TRANSFER',
|
|
720
|
+
allowedStages: ['DISPATCHING', 'TRANSPORTING', 'TRANSFERRING'],
|
|
721
|
+
stageFlow: [
|
|
722
|
+
{ from: 'DISPATCHING', to: ['TRANSPORTING'] },
|
|
723
|
+
{ from: 'TRANSPORTING', to: ['TRANSFERRING'] },
|
|
724
|
+
{ from: 'TRANSFERRING', to: [] }
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
'CONSOLIDATION': {
|
|
728
|
+
process: 'CONSOLIDATION',
|
|
729
|
+
allowedStages: ['SORTING', 'CONSOLIDATING'],
|
|
730
|
+
stageFlow: [
|
|
731
|
+
{ from: 'SORTING', to: ['CONSOLIDATING'] },
|
|
732
|
+
{ from: 'CONSOLIDATING', to: [] }
|
|
733
|
+
]
|
|
734
|
+
},
|
|
735
|
+
'CROSS_DOCK': {
|
|
736
|
+
process: 'CROSS_DOCK',
|
|
737
|
+
allowedStages: ['SORTING', 'TRANSFERRING'],
|
|
738
|
+
stageFlow: [
|
|
739
|
+
{ from: 'SORTING', to: ['TRANSFERRING'] },
|
|
740
|
+
{ from: 'TRANSFERRING', to: [] }
|
|
741
|
+
]
|
|
742
|
+
},
|
|
743
|
+
'CUSTOMS': {
|
|
744
|
+
process: 'CUSTOMS',
|
|
745
|
+
allowedStages: ['CLEARING'],
|
|
746
|
+
stageFlow: [
|
|
747
|
+
{ from: 'CLEARING', to: [] }
|
|
748
|
+
]
|
|
749
|
+
},
|
|
750
|
+
'RETURN': {
|
|
751
|
+
process: 'RETURN',
|
|
752
|
+
allowedStages: ['COLLECTING', 'TRANSPORTING', 'RETURNING'],
|
|
753
|
+
stageFlow: [
|
|
754
|
+
{ from: 'COLLECTING', to: ['TRANSPORTING'] },
|
|
755
|
+
{ from: 'TRANSPORTING', to: ['RETURNING'] },
|
|
756
|
+
{ from: 'RETURNING', to: [] }
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
// PASSTHROUGH ORDER PROCESS-STAGE MAPS
|
|
761
|
+
'PassthroughOrder': {
|
|
762
|
+
'CROSS_DOCK': {
|
|
763
|
+
process: 'CROSS_DOCK',
|
|
764
|
+
allowedStages: ['ARRIVAL', 'RECEIVING', 'SORTING', 'STAGING', 'LOADING', 'DEPARTURE'],
|
|
765
|
+
stageFlow: [
|
|
766
|
+
{ from: 'ARRIVAL', to: ['RECEIVING'] },
|
|
767
|
+
{ from: 'RECEIVING', to: ['SORTING'] },
|
|
768
|
+
{ from: 'SORTING', to: ['STAGING'] },
|
|
769
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
770
|
+
{ from: 'LOADING', to: ['DEPARTURE'] },
|
|
771
|
+
{ from: 'DEPARTURE', to: [] }
|
|
772
|
+
]
|
|
773
|
+
},
|
|
774
|
+
'CONSOLIDATION': {
|
|
775
|
+
process: 'CONSOLIDATION',
|
|
776
|
+
allowedStages: ['ARRIVAL', 'RECEIVING', 'INSPECTION', 'SORTING', 'CONSOLIDATING', 'STAGING', 'LOADING', 'DEPARTURE'],
|
|
777
|
+
stageFlow: [
|
|
778
|
+
{ from: 'ARRIVAL', to: ['RECEIVING'] },
|
|
779
|
+
{ from: 'RECEIVING', to: ['INSPECTION'] },
|
|
780
|
+
{ from: 'INSPECTION', to: ['SORTING'] },
|
|
781
|
+
{ from: 'SORTING', to: ['CONSOLIDATING'] },
|
|
782
|
+
{ from: 'CONSOLIDATING', to: ['STAGING'] },
|
|
783
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
784
|
+
{ from: 'LOADING', to: ['DEPARTURE'] },
|
|
785
|
+
{ from: 'DEPARTURE', to: [] }
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
'DECONSOLIDATION': {
|
|
789
|
+
process: 'DECONSOLIDATION',
|
|
790
|
+
allowedStages: ['ARRIVAL', 'RECEIVING', 'DECONSOLIDATING', 'SORTING', 'STAGING', 'LOADING', 'DEPARTURE'],
|
|
791
|
+
stageFlow: [
|
|
792
|
+
{ from: 'ARRIVAL', to: ['RECEIVING'] },
|
|
793
|
+
{ from: 'RECEIVING', to: ['DECONSOLIDATING'] },
|
|
794
|
+
{ from: 'DECONSOLIDATING', to: ['SORTING'] },
|
|
795
|
+
{ from: 'SORTING', to: ['STAGING'] },
|
|
796
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
797
|
+
{ from: 'LOADING', to: ['DEPARTURE'] },
|
|
798
|
+
{ from: 'DEPARTURE', to: [] }
|
|
799
|
+
]
|
|
800
|
+
},
|
|
801
|
+
'TRANSFER': {
|
|
802
|
+
process: 'TRANSFER',
|
|
803
|
+
allowedStages: ['ARRIVAL', 'RECEIVING', 'PROCESSING', 'STAGING', 'LOADING', 'DEPARTURE'],
|
|
804
|
+
stageFlow: [
|
|
805
|
+
{ from: 'ARRIVAL', to: ['RECEIVING'] },
|
|
806
|
+
{ from: 'RECEIVING', to: ['PROCESSING'] },
|
|
807
|
+
{ from: 'PROCESSING', to: ['STAGING'] },
|
|
808
|
+
{ from: 'STAGING', to: ['LOADING'] },
|
|
809
|
+
{ from: 'LOADING', to: ['DEPARTURE'] },
|
|
810
|
+
{ from: 'DEPARTURE', to: [] }
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
'EXCEPTION': {
|
|
814
|
+
process: 'EXCEPTION',
|
|
815
|
+
allowedStages: ['PROCESSING', 'EXCEPTION_REVIEW', 'QUALITY_CHECK'],
|
|
816
|
+
stageFlow: [
|
|
817
|
+
{ from: 'PROCESSING', to: ['EXCEPTION_REVIEW'] },
|
|
818
|
+
{ from: 'EXCEPTION_REVIEW', to: ['QUALITY_CHECK'] },
|
|
819
|
+
{ from: 'QUALITY_CHECK', to: [] }
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
// Order Assignee Schema
|
|
825
|
+
exports.OrderAssigneeSchema = typebox_1.Type.Object({
|
|
826
|
+
type: user_1.UserTypeSchema,
|
|
827
|
+
id: typebox_1.Type.String(),
|
|
828
|
+
name: typebox_1.Type.String(),
|
|
829
|
+
process: typebox_1.Type.String(),
|
|
830
|
+
assigned: time_1.ActionRecordSchema
|
|
831
|
+
});
|
|
832
|
+
// Exception handling
|
|
833
|
+
exports.OrderExceptionSchema = typebox_1.Type.Object({
|
|
834
|
+
code: typebox_1.Type.String(),
|
|
835
|
+
type: typebox_1.Type.Union([
|
|
836
|
+
typebox_1.Type.Literal('DAMAGE'),
|
|
837
|
+
typebox_1.Type.Literal('MISSING_PACKAGE'),
|
|
838
|
+
typebox_1.Type.Literal('WRONG_DESTINATION'),
|
|
839
|
+
typebox_1.Type.Literal('SCANNING_ERROR'),
|
|
840
|
+
typebox_1.Type.Literal('ROUTING_ERROR'),
|
|
841
|
+
typebox_1.Type.Literal('DELAY'),
|
|
842
|
+
typebox_1.Type.Literal('CUSTOMS_HOLD'),
|
|
843
|
+
typebox_1.Type.Literal('SECURITY_HOLD')
|
|
844
|
+
]),
|
|
845
|
+
severity: typebox_1.Type.Union([
|
|
846
|
+
typebox_1.Type.Literal('LOW'),
|
|
847
|
+
typebox_1.Type.Literal('MEDIUM'),
|
|
848
|
+
typebox_1.Type.Literal('HIGH'),
|
|
849
|
+
typebox_1.Type.Literal('CRITICAL')
|
|
850
|
+
]),
|
|
851
|
+
description: typebox_1.Type.String({ maxLength: 1000 }),
|
|
852
|
+
reported: time_1.ActionRecordSchema,
|
|
853
|
+
resolved: time_1.ActionRecordSchema,
|
|
854
|
+
resolution: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 1000 }))
|
|
855
|
+
});
|
|
856
|
+
// Order Consolidation & Deconsolidation information
|
|
857
|
+
exports.ConsolidationTypeSchema = typebox_1.Type.Union([
|
|
858
|
+
typebox_1.Type.Literal('ROUTE_BASED'),
|
|
859
|
+
typebox_1.Type.Literal('DESTINATION_BASED'),
|
|
860
|
+
typebox_1.Type.Literal('SERVICE_BASED'),
|
|
861
|
+
typebox_1.Type.Literal('TIME_BASED')
|
|
862
|
+
]);
|
|
863
|
+
exports.OrderConsolidationSchema = typebox_1.Type.Object({
|
|
864
|
+
batchId: typebox_1.Type.String(),
|
|
865
|
+
type: exports.ConsolidationTypeSchema,
|
|
866
|
+
with: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
867
|
+
info: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
868
|
+
containerId: typebox_1.Type.String(),
|
|
869
|
+
containerType: typebox_1.Type.String(),
|
|
870
|
+
loadSequence: typebox_1.Type.Number(),
|
|
871
|
+
totalPackages: typebox_1.Type.Number()
|
|
872
|
+
}))
|
|
873
|
+
});
|
|
874
|
+
exports.OrderDeconsolidationSchema = typebox_1.Type.Object({
|
|
875
|
+
batchId: typebox_1.Type.String(),
|
|
876
|
+
type: exports.ConsolidationTypeSchema,
|
|
877
|
+
with: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
878
|
+
info: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
879
|
+
containerId: typebox_1.Type.String(),
|
|
880
|
+
containerType: typebox_1.Type.String(),
|
|
881
|
+
loadSequence: typebox_1.Type.Number(),
|
|
882
|
+
totalPackages: typebox_1.Type.Number()
|
|
883
|
+
}))
|
|
884
|
+
});
|
|
885
|
+
// Base Order Status Values (string constants for reuse)
|
|
886
|
+
exports.BASE_ORDER_STATUSES = [
|
|
887
|
+
'ACK',
|
|
888
|
+
'NACK',
|
|
889
|
+
'PENDING',
|
|
890
|
+
'ON_HOLD',
|
|
891
|
+
'ASSIGNED',
|
|
892
|
+
'APPROVED',
|
|
893
|
+
'SCHEDULED',
|
|
894
|
+
'SUSPENDED',
|
|
895
|
+
'CANCELLED',
|
|
896
|
+
'IN_PROGRESS',
|
|
897
|
+
'EXCEPTION',
|
|
898
|
+
'COMPLETED',
|
|
899
|
+
'FAILED'
|
|
900
|
+
];
|
|
901
|
+
// Base Order Status Schema
|
|
902
|
+
exports.BaseOrderStatusSchema = typebox_1.Type.Union([
|
|
903
|
+
typebox_1.Type.Literal('ACK'),
|
|
904
|
+
typebox_1.Type.Literal('NACK'),
|
|
905
|
+
typebox_1.Type.Literal('PENDING'),
|
|
906
|
+
typebox_1.Type.Literal('ON_HOLD'),
|
|
907
|
+
typebox_1.Type.Literal('ASSIGNED'),
|
|
908
|
+
typebox_1.Type.Literal('APPROVED'),
|
|
909
|
+
typebox_1.Type.Literal('SCHEDULED'),
|
|
910
|
+
typebox_1.Type.Literal('SUSPENDED'),
|
|
911
|
+
typebox_1.Type.Literal('CANCELLED'),
|
|
912
|
+
typebox_1.Type.Literal('IN_PROGRESS'),
|
|
913
|
+
typebox_1.Type.Literal('EXCEPTION'),
|
|
914
|
+
typebox_1.Type.Literal('COMPLETED'),
|
|
915
|
+
typebox_1.Type.Literal('FAILED')
|
|
916
|
+
]);
|
|
917
|
+
exports.BaseOrderFlowPrioritySchema = typebox_1.Type.Union([
|
|
918
|
+
typebox_1.Type.Literal('LOW'),
|
|
919
|
+
typebox_1.Type.Literal('NORMAL'),
|
|
920
|
+
typebox_1.Type.Literal('HIGH'),
|
|
921
|
+
typebox_1.Type.Literal('URGENT'),
|
|
922
|
+
typebox_1.Type.Literal('CRITICAL')
|
|
923
|
+
]);
|
|
924
|
+
// Order Tracking Schema - Hierarchical tracking strategy
|
|
925
|
+
exports.OrderTrackingSchema = typebox_1.Type.Object({
|
|
926
|
+
// Customer-facing master tracking number (shared across hierarchy)
|
|
927
|
+
masterTrackingNumber: typebox_1.Type.String(),
|
|
928
|
+
// Unique tracking number for this specific order
|
|
929
|
+
trackingNumber: typebox_1.Type.String(),
|
|
930
|
+
// External carrier tracking number (for shipping orders)
|
|
931
|
+
carrierTrackingNumber: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
932
|
+
// Alternative tracking references (for integration with external systems)
|
|
933
|
+
alternativeTrackingNumbers: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
934
|
+
provider: typebox_1.Type.String(),
|
|
935
|
+
trackingNumber: typebox_1.Type.String()
|
|
936
|
+
})))
|
|
937
|
+
});
|
|
938
|
+
// Order Routing schemas
|
|
939
|
+
exports.OrderRoutingModeSchema = typebox_1.Type.Union([
|
|
940
|
+
typebox_1.Type.Literal('PIPELINE'),
|
|
941
|
+
typebox_1.Type.Literal('MANUAL')
|
|
942
|
+
]);
|
|
943
|
+
exports.OrderRoutingStrategySchema = typebox_1.Type.Union([
|
|
944
|
+
typebox_1.Type.Literal('CHEAPEST'),
|
|
945
|
+
typebox_1.Type.Literal('FASTEST'),
|
|
946
|
+
typebox_1.Type.Literal('NEAREST'),
|
|
947
|
+
typebox_1.Type.Literal('BALANCED')
|
|
948
|
+
]);
|
|
949
|
+
exports.OrderRoutingConfigSchema = typebox_1.Type.Object({
|
|
950
|
+
mode: exports.OrderRoutingModeSchema,
|
|
951
|
+
handler: typebox_1.Type.Union([context_1.GenericServiceContextSchema, context_1.PipelineContextSchema]),
|
|
952
|
+
strategy: typebox_1.Type.Optional(exports.OrderRoutingStrategySchema)
|
|
953
|
+
});
|
|
954
|
+
exports.OrderNoteSchema = typebox_1.Type.Object({
|
|
955
|
+
content: typebox_1.Type.String({ maxLength: 1000 }),
|
|
956
|
+
created: time_1.ActionRecordSchema
|
|
957
|
+
});
|
|
958
|
+
// Order client schemas
|
|
959
|
+
exports.OrderClientRelationshipSchema = typebox_1.Type.Union([
|
|
960
|
+
typebox_1.Type.Literal('C2B'),
|
|
961
|
+
typebox_1.Type.Literal('B2B'),
|
|
962
|
+
typebox_1.Type.Literal('B2C')
|
|
963
|
+
]);
|
|
964
|
+
exports.OrderProfileClientSchema = typebox_1.Type.Object({
|
|
965
|
+
relationship: exports.OrderClientRelationshipSchema,
|
|
966
|
+
mode: typebox_1.Type.Literal('PROFILE'),
|
|
967
|
+
dprofile: de_profile_1.DProfileReferenceSchema
|
|
968
|
+
});
|
|
969
|
+
exports.OrderInlineClientSchema = typebox_1.Type.Object({
|
|
970
|
+
relationship: exports.OrderClientRelationshipSchema,
|
|
971
|
+
mode: typebox_1.Type.Literal('INLINE'),
|
|
972
|
+
id: typebox_1.Type.String(),
|
|
973
|
+
// Contact and address information
|
|
974
|
+
contacts: typebox_1.Type.Optional(geo_1.ContactsSchema),
|
|
975
|
+
address: typebox_1.Type.Optional(geo_1.AddressSchema)
|
|
976
|
+
});
|
|
977
|
+
exports.OrderClientSchema = typebox_1.Type.Union([
|
|
978
|
+
exports.OrderInlineClientSchema,
|
|
979
|
+
exports.OrderProfileClientSchema
|
|
980
|
+
], { discriminator: { propertyName: 'mode' } });
|
|
981
|
+
// Base Order Schema
|
|
982
|
+
exports.BaseOrderSchema = typebox_1.Type.Object({
|
|
983
|
+
cid: typebox_1.Type.String({ description: 'Connector that created this order' }),
|
|
984
|
+
reference: typebox_1.Type.String(),
|
|
985
|
+
tracking: exports.OrderTrackingSchema, // Hierarchical tracking information
|
|
986
|
+
intentToken: typebox_1.Type.String(),
|
|
987
|
+
// Context creator of this order
|
|
988
|
+
context: context_1.ContextSchema,
|
|
989
|
+
// Order Hierarchy (Parent-Child Relationships)
|
|
990
|
+
hierarchy: exports.OrderHierarchySchema,
|
|
991
|
+
// Routing
|
|
992
|
+
routing: exports.OrderRoutingConfigSchema,
|
|
993
|
+
/**
|
|
994
|
+
* Pipeline Execution State
|
|
995
|
+
*
|
|
996
|
+
* Only present on root orders. Tracks progress through pipeline stages.
|
|
997
|
+
* Pipeline template version is locked at order creation time to prevent
|
|
998
|
+
* mid-flight changes from affecting in-progress orders.
|
|
999
|
+
*/
|
|
1000
|
+
pipelineExecution: typebox_1.Type.Optional(realm_1.PipelineExecutionSchema),
|
|
1001
|
+
// Operation details (fees, payment, rating)
|
|
1002
|
+
operation: exports.OrderOperationSchema,
|
|
1003
|
+
// Assigned agents/workers
|
|
1004
|
+
assignees: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderAssigneeSchema)),
|
|
1005
|
+
// Order characteristics
|
|
1006
|
+
priority: exports.OrderPrioritySchema,
|
|
1007
|
+
requirements: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderRequirementSchema)),
|
|
1008
|
+
schedule: typebox_1.Type.Optional(time_1.DateTimeScheduleSchema),
|
|
1009
|
+
// Exception tracking
|
|
1010
|
+
exceptions: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderExceptionSchema)),
|
|
1011
|
+
/**
|
|
1012
|
+
* Client identifier for customer-facing services
|
|
1013
|
+
* Present when customer directly books CSP/LSP service (delivery, ride, warehouse, etc.)
|
|
1014
|
+
* Absent for internal operations orders
|
|
1015
|
+
*/
|
|
1016
|
+
client: typebox_1.Type.Optional(exports.OrderClientSchema),
|
|
1017
|
+
sla: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
1018
|
+
deadline: time_1.DateTimeZoneSchema
|
|
1019
|
+
})),
|
|
1020
|
+
// Additional metadata
|
|
1021
|
+
notes: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderNoteSchema)),
|
|
1022
|
+
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
1023
|
+
metadata: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Any())),
|
|
1024
|
+
// Lock order from modifications
|
|
1025
|
+
locked: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
1026
|
+
created: time_1.ActionRecordSchema,
|
|
1027
|
+
updated: typebox_1.Type.Optional(time_1.ActionRecordSchema)
|
|
1028
|
+
});
|
|
1029
|
+
// Ride Order Schemas
|
|
1030
|
+
exports.RideOrderTypeSchema = typebox_1.Type.Union([
|
|
1031
|
+
typebox_1.Type.Literal('SHORT-MILE'),
|
|
1032
|
+
typebox_1.Type.Literal('LONG-MILE')
|
|
1033
|
+
]);
|
|
1034
|
+
exports.RideBaseOrderSchema = typebox_1.Type.Intersect([
|
|
1035
|
+
exports.BaseOrderSchema,
|
|
1036
|
+
typebox_1.Type.Object({
|
|
1037
|
+
type: exports.RideOrderTypeSchema
|
|
1038
|
+
// passengers: Type.Array(OrderPassengerSchema), // Uncomment when available
|
|
1039
|
+
// luggages: Type.Array(OrderLuggageSchema), // Uncomment when available
|
|
1040
|
+
})
|
|
1041
|
+
]);
|
|
1042
|
+
exports.LSPBaseOrderSchema = typebox_1.Type.Intersect([
|
|
1043
|
+
exports.BaseOrderSchema,
|
|
1044
|
+
typebox_1.Type.Object({
|
|
1045
|
+
type: lsp_1.LSPOrderTypeSchema,
|
|
1046
|
+
items: typebox_1.Type.Array(exports.OrderItemSchema),
|
|
1047
|
+
packages: typebox_1.Type.Object({
|
|
1048
|
+
totalWeight: typebox_1.Type.Optional(measure_1.WeightSchema),
|
|
1049
|
+
totalVolume: typebox_1.Type.Optional(measure_1.VolumeSchema),
|
|
1050
|
+
list: typebox_1.Type.Array(exports.OrderPackageSchema)
|
|
1051
|
+
}),
|
|
1052
|
+
consolidations: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderConsolidationSchema)),
|
|
1053
|
+
deconsolidations: typebox_1.Type.Optional(typebox_1.Type.Array(exports.OrderDeconsolidationSchema))
|
|
1054
|
+
})
|
|
1055
|
+
]);
|
|
1056
|
+
// Utility schemas for order operations
|
|
1057
|
+
exports.OrderSearchSchema = typebox_1.Type.Object({
|
|
1058
|
+
status: typebox_1.Type.Optional(typebox_1.Type.Array(exports.BaseOrderStatusSchema)),
|
|
1059
|
+
priority: typebox_1.Type.Optional(exports.OrderPrioritySchema),
|
|
1060
|
+
dateRange: typebox_1.Type.Optional(time_1.DateTimeRangeSchema),
|
|
1061
|
+
processor: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
1062
|
+
assigneeId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
1063
|
+
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
1064
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 1, maximum: 100 })),
|
|
1065
|
+
offset: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 0 }))
|
|
1066
|
+
});
|
|
1067
|
+
exports.OrderStatsSchema = typebox_1.Type.Object({
|
|
1068
|
+
total: typebox_1.Type.Number(),
|
|
1069
|
+
byStatus: typebox_1.Type.Record(exports.BaseOrderStatusSchema, typebox_1.Type.Number()),
|
|
1070
|
+
byPriority: typebox_1.Type.Record(exports.OrderPrioritySchema, typebox_1.Type.Number()),
|
|
1071
|
+
byType: typebox_1.Type.Object({
|
|
1072
|
+
shipping: typebox_1.Type.Number(),
|
|
1073
|
+
ride: typebox_1.Type.Number()
|
|
1074
|
+
}),
|
|
1075
|
+
avgProcessingTime: typebox_1.Type.Number(), // minutes
|
|
1076
|
+
onTimeDelivery: typebox_1.Type.Number({ minimum: 0, maximum: 100 }) // percentage
|
|
1077
|
+
});
|
|
1078
|
+
//# sourceMappingURL=order.js.map
|