@freighttech/shipment-tracking 0.6.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/LICENSE +21 -0
- package/NOTICE +25 -0
- package/dist/generated/entities/bic_config/index.js +21 -0
- package/dist/generated/entities/bic_config/index.js.map +7 -0
- package/dist/generated/entities/carrier_config/index.js +27 -0
- package/dist/generated/entities/carrier_config/index.js.map +7 -0
- package/dist/generated/entities/location_override/index.js +33 -0
- package/dist/generated/entities/location_override/index.js.map +7 -0
- package/dist/generated/entities/shipment/index.js +73 -0
- package/dist/generated/entities/shipment/index.js.map +7 -0
- package/dist/generated/entities/ships_go_config/index.js +31 -0
- package/dist/generated/entities/ships_go_config/index.js.map +7 -0
- package/dist/generated/entities/tracking_event/index.js +101 -0
- package/dist/generated/entities/tracking_event/index.js.map +7 -0
- package/dist/generated/entities/tracking_job/index.js +47 -0
- package/dist/generated/entities/tracking_job/index.js.map +7 -0
- package/dist/generated/entities/webhook/index.js +25 -0
- package/dist/generated/entities/webhook/index.js.map +7 -0
- package/dist/generated/entities/webhook_delivery/index.js +25 -0
- package/dist/generated/entities/webhook_delivery/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +21 -0
- package/dist/generated/entities.ids.generated.js.map +7 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +7 -0
- package/dist/modules/shipment_tracking/acl.js +22 -0
- package/dist/modules/shipment_tracking/acl.js.map +7 -0
- package/dist/modules/shipment_tracking/api/bic-configs/route.js +176 -0
- package/dist/modules/shipment_tracking/api/bic-configs/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/bic-configs/test/route.js +95 -0
- package/dist/modules/shipment_tracking/api/bic-configs/test/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/cargo-events/route.js +93 -0
- package/dist/modules/shipment_tracking/api/cargo-events/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/carrier-configs/route.js +139 -0
- package/dist/modules/shipment_tracking/api/carrier-configs/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/dashboard/ships-map/route.js +177 -0
- package/dist/modules/shipment_tracking/api/dashboard/ships-map/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/location-overrides/route.js +179 -0
- package/dist/modules/shipment_tracking/api/location-overrides/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/openapi.js +27 -0
- package/dist/modules/shipment_tracking/api/openapi.js.map +7 -0
- package/dist/modules/shipment_tracking/api/shipments/route.js +192 -0
- package/dist/modules/shipment_tracking/api/shipments/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/shipsgo-configs/route.js +185 -0
- package/dist/modules/shipment_tracking/api/shipsgo-configs/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/tracking-jobs/route.js +144 -0
- package/dist/modules/shipment_tracking/api/tracking-jobs/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/tracking-jobs/sync/route.js +107 -0
- package/dist/modules/shipment_tracking/api/tracking-jobs/sync/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/utils.js +12 -0
- package/dist/modules/shipment_tracking/api/utils.js.map +7 -0
- package/dist/modules/shipment_tracking/api/webhooks/deliveries/route.js +76 -0
- package/dist/modules/shipment_tracking/api/webhooks/deliveries/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/webhooks/route.js +135 -0
- package/dist/modules/shipment_tracking/api/webhooks/route.js.map +7 -0
- package/dist/modules/shipment_tracking/api/webhooks/test/route.js +71 -0
- package/dist/modules/shipment_tracking/api/webhooks/test/route.js.map +7 -0
- package/dist/modules/shipment_tracking/assets/carriers/cma_cgm.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/cosco.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/evergreen.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/hapag_lloyd.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/maersk.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/msc.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/one.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/oocl.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/yang_ming.png +0 -0
- package/dist/modules/shipment_tracking/assets/carriers/zim.png +0 -0
- package/dist/modules/shipment_tracking/assets/index.js +52 -0
- package/dist/modules/shipment_tracking/assets/index.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/carrier-configs/page.js +621 -0
- package/dist/modules/shipment_tracking/backend/carrier-configs/page.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/carrier-configs/page.meta.js +19 -0
- package/dist/modules/shipment_tracking/backend/carrier-configs/page.meta.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/location-overrides/page.js +198 -0
- package/dist/modules/shipment_tracking/backend/location-overrides/page.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/location-overrides/page.meta.js +19 -0
- package/dist/modules/shipment_tracking/backend/location-overrides/page.meta.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/shipment-tracking/page.js +279 -0
- package/dist/modules/shipment_tracking/backend/shipment-tracking/page.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/shipment-tracking/page.meta.js +19 -0
- package/dist/modules/shipment_tracking/backend/shipment-tracking/page.meta.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/tracking-jobs/page.js +10 -0
- package/dist/modules/shipment_tracking/backend/tracking-jobs/page.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/tracking-jobs/page.meta.js +19 -0
- package/dist/modules/shipment_tracking/backend/tracking-jobs/page.meta.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/webhooks/page.js +198 -0
- package/dist/modules/shipment_tracking/backend/webhooks/page.js.map +7 -0
- package/dist/modules/shipment_tracking/backend/webhooks/page.meta.js +19 -0
- package/dist/modules/shipment_tracking/backend/webhooks/page.meta.js.map +7 -0
- package/dist/modules/shipment_tracking/ce.js +52 -0
- package/dist/modules/shipment_tracking/ce.js.map +7 -0
- package/dist/modules/shipment_tracking/cli.js +229 -0
- package/dist/modules/shipment_tracking/cli.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/bic-configs.js +66 -0
- package/dist/modules/shipment_tracking/commands/bic-configs.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/carrier-configs.js +65 -0
- package/dist/modules/shipment_tracking/commands/carrier-configs.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/index.js +9 -0
- package/dist/modules/shipment_tracking/commands/index.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/location-overrides.js +93 -0
- package/dist/modules/shipment_tracking/commands/location-overrides.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/shipments.js +200 -0
- package/dist/modules/shipment_tracking/commands/shipments.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/shipsgo-configs.js +75 -0
- package/dist/modules/shipment_tracking/commands/shipsgo-configs.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/tracking-jobs.js +120 -0
- package/dist/modules/shipment_tracking/commands/tracking-jobs.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/tracking.js +140 -0
- package/dist/modules/shipment_tracking/commands/tracking.js.map +7 -0
- package/dist/modules/shipment_tracking/commands/webhooks.js +115 -0
- package/dist/modules/shipment_tracking/commands/webhooks.js.map +7 -0
- package/dist/modules/shipment_tracking/components/CombinedTimestampCell.js +168 -0
- package/dist/modules/shipment_tracking/components/CombinedTimestampCell.js.map +7 -0
- package/dist/modules/shipment_tracking/components/FacilityLocationInput.js +202 -0
- package/dist/modules/shipment_tracking/components/FacilityLocationInput.js.map +7 -0
- package/dist/modules/shipment_tracking/components/LocationOverrideDrawer.js +501 -0
- package/dist/modules/shipment_tracking/components/LocationOverrideDrawer.js.map +7 -0
- package/dist/modules/shipment_tracking/components/ShipmentDetailsDrawer.js +818 -0
- package/dist/modules/shipment_tracking/components/ShipmentDetailsDrawer.js.map +7 -0
- package/dist/modules/shipment_tracking/components/ShipmentDrawer.js +404 -0
- package/dist/modules/shipment_tracking/components/ShipmentDrawer.js.map +7 -0
- package/dist/modules/shipment_tracking/components/ShipsGoConfigSection.js +200 -0
- package/dist/modules/shipment_tracking/components/ShipsGoConfigSection.js.map +7 -0
- package/dist/modules/shipment_tracking/components/TimestampCell.js +108 -0
- package/dist/modules/shipment_tracking/components/TimestampCell.js.map +7 -0
- package/dist/modules/shipment_tracking/components/TrackingJobDrawer.js +343 -0
- package/dist/modules/shipment_tracking/components/TrackingJobDrawer.js.map +7 -0
- package/dist/modules/shipment_tracking/components/VesselTrackingMap.js +496 -0
- package/dist/modules/shipment_tracking/components/VesselTrackingMap.js.map +7 -0
- package/dist/modules/shipment_tracking/components/WebhookDrawer.js +332 -0
- package/dist/modules/shipment_tracking/components/WebhookDrawer.js.map +7 -0
- package/dist/modules/shipment_tracking/data/entities.js +686 -0
- package/dist/modules/shipment_tracking/data/entities.js.map +7 -0
- package/dist/modules/shipment_tracking/data/validators.js +434 -0
- package/dist/modules/shipment_tracking/data/validators.js.map +7 -0
- package/dist/modules/shipment_tracking/di.js +60 -0
- package/dist/modules/shipment_tracking/di.js.map +7 -0
- package/dist/modules/shipment_tracking/encryption.js +12 -0
- package/dist/modules/shipment_tracking/encryption.js.map +7 -0
- package/dist/modules/shipment_tracking/events.js +87 -0
- package/dist/modules/shipment_tracking/events.js.map +7 -0
- package/dist/modules/shipment_tracking/hooks/useVesselTracking.js +137 -0
- package/dist/modules/shipment_tracking/hooks/useVesselTracking.js.map +7 -0
- package/dist/modules/shipment_tracking/i18n/de.json +327 -0
- package/dist/modules/shipment_tracking/i18n/en.json +327 -0
- package/dist/modules/shipment_tracking/i18n/es.json +327 -0
- package/dist/modules/shipment_tracking/i18n/pl.json +327 -0
- package/dist/modules/shipment_tracking/index.js +15 -0
- package/dist/modules/shipment_tracking/index.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/cma-cgm.js +66 -0
- package/dist/modules/shipment_tracking/lib/adapters/cma-cgm.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/cosco-types.js +1 -0
- package/dist/modules/shipment_tracking/lib/adapters/cosco-types.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/cosco.js +236 -0
- package/dist/modules/shipment_tracking/lib/adapters/cosco.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/evergreen.js +87 -0
- package/dist/modules/shipment_tracking/lib/adapters/evergreen.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/hapag-lloyd.js +68 -0
- package/dist/modules/shipment_tracking/lib/adapters/hapag-lloyd.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/index.js +20 -0
- package/dist/modules/shipment_tracking/lib/adapters/index.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/maersk.js +84 -0
- package/dist/modules/shipment_tracking/lib/adapters/maersk.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/msc.js +170 -0
- package/dist/modules/shipment_tracking/lib/adapters/msc.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/adapters/zim.js +85 -0
- package/dist/modules/shipment_tracking/lib/adapters/zim.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/audit-helpers.js +20 -0
- package/dist/modules/shipment_tracking/lib/audit-helpers.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/auth/base64url.js +8 -0
- package/dist/modules/shipment_tracking/lib/auth/base64url.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/auth/oauth-client.js +38 -0
- package/dist/modules/shipment_tracking/lib/auth/oauth-client.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/background.js +15 -0
- package/dist/modules/shipment_tracking/lib/background.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/bic-api-client.js +106 -0
- package/dist/modules/shipment_tracking/lib/bic-api-client.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/carrier-adapter.js +17 -0
- package/dist/modules/shipment_tracking/lib/carrier-adapter.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/current-vessel.js +149 -0
- package/dist/modules/shipment_tracking/lib/current-vessel.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/dcsa-event-mapping.js +124 -0
- package/dist/modules/shipment_tracking/lib/dcsa-event-mapping.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/dcsa-event-parser.js +112 -0
- package/dist/modules/shipment_tracking/lib/dcsa-event-parser.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/dcsa-params.js +16 -0
- package/dist/modules/shipment_tracking/lib/dcsa-params.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/empty-return.js +48 -0
- package/dist/modules/shipment_tracking/lib/empty-return.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/location-overrides.js +85 -0
- package/dist/modules/shipment_tracking/lib/location-overrides.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/location-types.js +59 -0
- package/dist/modules/shipment_tracking/lib/location-types.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/logger.js +113 -0
- package/dist/modules/shipment_tracking/lib/logger.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/poi-event-processor.js +183 -0
- package/dist/modules/shipment_tracking/lib/poi-event-processor.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/poi-nats-config.js +52 -0
- package/dist/modules/shipment_tracking/lib/poi-nats-config.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/poi-types.js +43 -0
- package/dist/modules/shipment_tracking/lib/poi-types.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/rate-limiter.js +31 -0
- package/dist/modules/shipment_tracking/lib/rate-limiter.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/route-extraction.js +187 -0
- package/dist/modules/shipment_tracking/lib/route-extraction.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/route-inference.js +106 -0
- package/dist/modules/shipment_tracking/lib/route-inference.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/schedule-generator.js +63 -0
- package/dist/modules/shipment_tracking/lib/schedule-generator.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/shipsgo-client.js +143 -0
- package/dist/modules/shipment_tracking/lib/shipsgo-client.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/shipsgo-mapper.js +204 -0
- package/dist/modules/shipment_tracking/lib/shipsgo-mapper.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/status-machine.js +131 -0
- package/dist/modules/shipment_tracking/lib/status-machine.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/time-extraction.js +41 -0
- package/dist/modules/shipment_tracking/lib/time-extraction.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/timestamp-utils.js +100 -0
- package/dist/modules/shipment_tracking/lib/timestamp-utils.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/vessel-api.js +111 -0
- package/dist/modules/shipment_tracking/lib/vessel-api.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/vessel-cache.js +50 -0
- package/dist/modules/shipment_tracking/lib/vessel-cache.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/vessel-extraction.js +13 -0
- package/dist/modules/shipment_tracking/lib/vessel-extraction.js.map +7 -0
- package/dist/modules/shipment_tracking/lib/webhook-dispatcher.js +62 -0
- package/dist/modules/shipment_tracking/lib/webhook-dispatcher.js.map +7 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.js +48 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.js.map +7 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.js +15 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.js.map +7 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.js +47 -0
- package/dist/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.js.map +7 -0
- package/dist/modules/shipment_tracking/notifications.js +145 -0
- package/dist/modules/shipment_tracking/notifications.js.map +7 -0
- package/dist/modules/shipment_tracking/services/carrierRegistry.js +24 -0
- package/dist/modules/shipment_tracking/services/carrierRegistry.js.map +7 -0
- package/dist/modules/shipment_tracking/services/poiNatsService.js +397 -0
- package/dist/modules/shipment_tracking/services/poiNatsService.js.map +7 -0
- package/dist/modules/shipment_tracking/services/shipsGoProvider.js +163 -0
- package/dist/modules/shipment_tracking/services/shipsGoProvider.js.map +7 -0
- package/dist/modules/shipment_tracking/services/trackingService.js +1283 -0
- package/dist/modules/shipment_tracking/services/trackingService.js.map +7 -0
- package/dist/modules/shipment_tracking/services/webhookService.js +263 -0
- package/dist/modules/shipment_tracking/services/webhookService.js.map +7 -0
- package/dist/modules/shipment_tracking/setup.js +72 -0
- package/dist/modules/shipment_tracking/setup.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/cargo-event-created.js +60 -0
- package/dist/modules/shipment_tracking/subscribers/cargo-event-created.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.js +58 -0
- package/dist/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/poi-event-notification.js +82 -0
- package/dist/modules/shipment_tracking/subscribers/poi-event-notification.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.js +53 -0
- package/dist/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/shipment-status-changed.js +28 -0
- package/dist/modules/shipment_tracking/subscribers/shipment-status-changed.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/terminal-event-ingest.js +67 -0
- package/dist/modules/shipment_tracking/subscribers/terminal-event-ingest.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/tracking-job-initial-poll.js +30 -0
- package/dist/modules/shipment_tracking/subscribers/tracking-job-initial-poll.js.map +7 -0
- package/dist/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.js +19 -0
- package/dist/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.js.map +7 -0
- package/dist/modules/shipment_tracking/tables/index.js +6 -0
- package/dist/modules/shipment_tracking/tables/index.js.map +7 -0
- package/dist/modules/shipment_tracking/tables/tracking_job/table.client.js +284 -0
- package/dist/modules/shipment_tracking/tables/tracking_job/table.client.js.map +7 -0
- package/dist/modules/shipment_tracking/tables/tracking_job/table.js +36 -0
- package/dist/modules/shipment_tracking/tables/tracking_job/table.js.map +7 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/config.js +25 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/config.js.map +7 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.js +355 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.js.map +7 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.js +26 -0
- package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.js.map +7 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/assets.d.js.map +7 -0
- package/generated/entities/bic_config/index.ts +20 -0
- package/generated/entities/carrier_config/index.ts +23 -0
- package/generated/entities/location_override/index.ts +26 -0
- package/generated/entities/shipment/index.ts +46 -0
- package/generated/entities/ships_go_config/index.ts +25 -0
- package/generated/entities/tracking_event/index.ts +60 -0
- package/generated/entities/tracking_job/index.ts +33 -0
- package/generated/entities/webhook/index.ts +22 -0
- package/generated/entities/webhook_delivery/index.ts +22 -0
- package/generated/entities.ids.generated.ts +47 -0
- package/package.json +81 -0
- package/src/index.ts +39 -0
- package/src/modules/shipment_tracking/__integration__/TC-TRACK-410-shipsgo-config-api.spec.ts +133 -0
- package/src/modules/shipment_tracking/__integration__/meta.ts +4 -0
- package/src/modules/shipment_tracking/__tests__/empty-return-stop.test.ts +231 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/hapag-lloyd-transship-container.json +702 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/index.ts +434 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/maersk-multi-transship-completed.json +1518 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/maersk-transship-intransit.json +558 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/msc-direct.json +222 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/msc-multi-transship-completed.json +974 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/msc-multi.json +4846 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/msc-transship.json +409 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/poi-events.json +240 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/synthetic/index.ts +138 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-eta-updates.json +288 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-route-inference.json +201 -0
- package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-voyage-progression.json +410 -0
- package/src/modules/shipment_tracking/__tests__/shipsgo-air-mapper.test.ts +157 -0
- package/src/modules/shipment_tracking/__tests__/shipsgo-client.test.ts +155 -0
- package/src/modules/shipment_tracking/__tests__/shipsgo-mapper.test.ts +201 -0
- package/src/modules/shipment_tracking/__tests__/shipsgo-poll.test.ts +357 -0
- package/src/modules/shipment_tracking/__tests__/shipsgo-provider.test.ts +364 -0
- package/src/modules/shipment_tracking/__tests__/trackingService.integration.test.ts +2248 -0
- package/src/modules/shipment_tracking/__tests__/webhookPayload.test.ts +151 -0
- package/src/modules/shipment_tracking/acl.ts +18 -0
- package/src/modules/shipment_tracking/api/bic-configs/route.ts +206 -0
- package/src/modules/shipment_tracking/api/bic-configs/test/route.ts +108 -0
- package/src/modules/shipment_tracking/api/cargo-events/route.ts +101 -0
- package/src/modules/shipment_tracking/api/carrier-configs/route.ts +142 -0
- package/src/modules/shipment_tracking/api/dashboard/ships-map/route.ts +246 -0
- package/src/modules/shipment_tracking/api/location-overrides/route.ts +185 -0
- package/src/modules/shipment_tracking/api/openapi.ts +28 -0
- package/src/modules/shipment_tracking/api/shipments/route.ts +197 -0
- package/src/modules/shipment_tracking/api/shipsgo-configs/route.ts +215 -0
- package/src/modules/shipment_tracking/api/tracking-jobs/route.ts +149 -0
- package/src/modules/shipment_tracking/api/tracking-jobs/sync/route.ts +116 -0
- package/src/modules/shipment_tracking/api/utils.ts +10 -0
- package/src/modules/shipment_tracking/api/webhooks/deliveries/route.ts +82 -0
- package/src/modules/shipment_tracking/api/webhooks/route.ts +138 -0
- package/src/modules/shipment_tracking/api/webhooks/test/route.ts +84 -0
- package/src/modules/shipment_tracking/assets/carriers/cma_cgm.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/cosco.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/evergreen.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/hapag_lloyd.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/maersk.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/msc.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/one.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/oocl.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/yang_ming.png +0 -0
- package/src/modules/shipment_tracking/assets/carriers/zim.png +0 -0
- package/src/modules/shipment_tracking/assets/index.ts +66 -0
- package/src/modules/shipment_tracking/backend/carrier-configs/page.meta.ts +16 -0
- package/src/modules/shipment_tracking/backend/carrier-configs/page.tsx +782 -0
- package/src/modules/shipment_tracking/backend/location-overrides/page.meta.ts +16 -0
- package/src/modules/shipment_tracking/backend/location-overrides/page.tsx +241 -0
- package/src/modules/shipment_tracking/backend/shipment-tracking/page.meta.ts +16 -0
- package/src/modules/shipment_tracking/backend/shipment-tracking/page.tsx +340 -0
- package/src/modules/shipment_tracking/backend/tracking-jobs/page.meta.ts +16 -0
- package/src/modules/shipment_tracking/backend/tracking-jobs/page.tsx +16 -0
- package/src/modules/shipment_tracking/backend/webhooks/page.meta.ts +16 -0
- package/src/modules/shipment_tracking/backend/webhooks/page.tsx +228 -0
- package/src/modules/shipment_tracking/ce.ts +48 -0
- package/src/modules/shipment_tracking/cli.ts +321 -0
- package/src/modules/shipment_tracking/commands/bic-configs.ts +94 -0
- package/src/modules/shipment_tracking/commands/carrier-configs.ts +89 -0
- package/src/modules/shipment_tracking/commands/index.ts +8 -0
- package/src/modules/shipment_tracking/commands/location-overrides.ts +119 -0
- package/src/modules/shipment_tracking/commands/shipments.ts +247 -0
- package/src/modules/shipment_tracking/commands/shipsgo-configs.ts +101 -0
- package/src/modules/shipment_tracking/commands/tracking-jobs.ts +158 -0
- package/src/modules/shipment_tracking/commands/tracking.ts +230 -0
- package/src/modules/shipment_tracking/commands/webhooks.ts +159 -0
- package/src/modules/shipment_tracking/components/CombinedTimestampCell.tsx +236 -0
- package/src/modules/shipment_tracking/components/FacilityLocationInput.tsx +235 -0
- package/src/modules/shipment_tracking/components/LocationOverrideDrawer.tsx +586 -0
- package/src/modules/shipment_tracking/components/ShipmentDetailsDrawer.tsx +1364 -0
- package/src/modules/shipment_tracking/components/ShipmentDrawer.tsx +498 -0
- package/src/modules/shipment_tracking/components/ShipsGoConfigSection.tsx +266 -0
- package/src/modules/shipment_tracking/components/TimestampCell.tsx +146 -0
- package/src/modules/shipment_tracking/components/TrackingJobDrawer.tsx +467 -0
- package/src/modules/shipment_tracking/components/VesselTrackingMap.tsx +761 -0
- package/src/modules/shipment_tracking/components/WebhookDrawer.tsx +434 -0
- package/src/modules/shipment_tracking/data/entities.ts +748 -0
- package/src/modules/shipment_tracking/data/validators.ts +523 -0
- package/src/modules/shipment_tracking/di.ts +73 -0
- package/src/modules/shipment_tracking/encryption.ts +17 -0
- package/src/modules/shipment_tracking/events.ts +122 -0
- package/src/modules/shipment_tracking/hooks/useVesselTracking.ts +297 -0
- package/src/modules/shipment_tracking/i18n/de.json +327 -0
- package/src/modules/shipment_tracking/i18n/en.json +327 -0
- package/src/modules/shipment_tracking/i18n/es.json +327 -0
- package/src/modules/shipment_tracking/i18n/pl.json +327 -0
- package/src/modules/shipment_tracking/index.ts +13 -0
- package/src/modules/shipment_tracking/lib/__tests__/dcsa-event-mapping.test.ts +385 -0
- package/src/modules/shipment_tracking/lib/__tests__/dcsa-event-parser.test.ts +398 -0
- package/src/modules/shipment_tracking/lib/__tests__/empty-return.test.ts +174 -0
- package/src/modules/shipment_tracking/lib/__tests__/poi-event-processor.test.ts +699 -0
- package/src/modules/shipment_tracking/lib/__tests__/route-inference.test.ts +402 -0
- package/src/modules/shipment_tracking/lib/__tests__/status-machine.test.ts +447 -0
- package/src/modules/shipment_tracking/lib/__tests__/time-extraction.test.ts +331 -0
- package/src/modules/shipment_tracking/lib/__tests__/timestamp-utils.test.ts +260 -0
- package/src/modules/shipment_tracking/lib/__tests__/vessel-api.test.ts +125 -0
- package/src/modules/shipment_tracking/lib/__tests__/vessel-extraction.test.ts +108 -0
- package/src/modules/shipment_tracking/lib/adapters/cma-cgm.ts +84 -0
- package/src/modules/shipment_tracking/lib/adapters/cosco-types.ts +145 -0
- package/src/modules/shipment_tracking/lib/adapters/cosco.ts +314 -0
- package/src/modules/shipment_tracking/lib/adapters/evergreen.ts +107 -0
- package/src/modules/shipment_tracking/lib/adapters/hapag-lloyd.ts +88 -0
- package/src/modules/shipment_tracking/lib/adapters/index.ts +18 -0
- package/src/modules/shipment_tracking/lib/adapters/maersk.ts +104 -0
- package/src/modules/shipment_tracking/lib/adapters/msc.ts +223 -0
- package/src/modules/shipment_tracking/lib/adapters/zim.ts +106 -0
- package/src/modules/shipment_tracking/lib/audit-helpers.ts +29 -0
- package/src/modules/shipment_tracking/lib/auth/base64url.ts +4 -0
- package/src/modules/shipment_tracking/lib/auth/oauth-client.ts +53 -0
- package/src/modules/shipment_tracking/lib/background.ts +24 -0
- package/src/modules/shipment_tracking/lib/bic-api-client.ts +199 -0
- package/src/modules/shipment_tracking/lib/carrier-adapter.ts +136 -0
- package/src/modules/shipment_tracking/lib/current-vessel.ts +274 -0
- package/src/modules/shipment_tracking/lib/dcsa-event-mapping.ts +202 -0
- package/src/modules/shipment_tracking/lib/dcsa-event-parser.ts +163 -0
- package/src/modules/shipment_tracking/lib/dcsa-params.ts +14 -0
- package/src/modules/shipment_tracking/lib/empty-return.ts +122 -0
- package/src/modules/shipment_tracking/lib/location-overrides.ts +150 -0
- package/src/modules/shipment_tracking/lib/location-types.ts +154 -0
- package/src/modules/shipment_tracking/lib/logger.ts +195 -0
- package/src/modules/shipment_tracking/lib/poi-event-processor.ts +302 -0
- package/src/modules/shipment_tracking/lib/poi-nats-config.ts +134 -0
- package/src/modules/shipment_tracking/lib/poi-types.ts +198 -0
- package/src/modules/shipment_tracking/lib/rate-limiter.ts +58 -0
- package/src/modules/shipment_tracking/lib/route-extraction.ts +439 -0
- package/src/modules/shipment_tracking/lib/route-inference.ts +238 -0
- package/src/modules/shipment_tracking/lib/schedule-generator.ts +92 -0
- package/src/modules/shipment_tracking/lib/shipsgo-client.ts +350 -0
- package/src/modules/shipment_tracking/lib/shipsgo-mapper.ts +296 -0
- package/src/modules/shipment_tracking/lib/status-machine.ts +230 -0
- package/src/modules/shipment_tracking/lib/time-extraction.ts +85 -0
- package/src/modules/shipment_tracking/lib/timestamp-utils.ts +244 -0
- package/src/modules/shipment_tracking/lib/vessel-api.ts +299 -0
- package/src/modules/shipment_tracking/lib/vessel-cache.ts +102 -0
- package/src/modules/shipment_tracking/lib/vessel-extraction.ts +39 -0
- package/src/modules/shipment_tracking/lib/webhook-dispatcher.ts +93 -0
- package/src/modules/shipment_tracking/migrations/.snapshot-open-mercato.json +2914 -0
- package/src/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.ts +60 -0
- package/src/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.ts +22 -0
- package/src/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.ts +65 -0
- package/src/modules/shipment_tracking/notifications.ts +151 -0
- package/src/modules/shipment_tracking/services/carrierRegistry.ts +29 -0
- package/src/modules/shipment_tracking/services/poiNatsService.ts +526 -0
- package/src/modules/shipment_tracking/services/shipsGoProvider.ts +231 -0
- package/src/modules/shipment_tracking/services/trackingService.ts +1777 -0
- package/src/modules/shipment_tracking/services/webhookService.ts +347 -0
- package/src/modules/shipment_tracking/setup.ts +99 -0
- package/src/modules/shipment_tracking/subscribers/__tests__/terminal-event-ingest.test.ts +141 -0
- package/src/modules/shipment_tracking/subscribers/cargo-event-created.ts +115 -0
- package/src/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.ts +115 -0
- package/src/modules/shipment_tracking/subscribers/poi-event-notification.ts +144 -0
- package/src/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.ts +94 -0
- package/src/modules/shipment_tracking/subscribers/shipment-status-changed.ts +41 -0
- package/src/modules/shipment_tracking/subscribers/terminal-event-ingest.ts +109 -0
- package/src/modules/shipment_tracking/subscribers/tracking-job-initial-poll.ts +53 -0
- package/src/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.ts +50 -0
- package/src/modules/shipment_tracking/tables/index.ts +4 -0
- package/src/modules/shipment_tracking/tables/tracking_job/table.client.tsx +337 -0
- package/src/modules/shipment_tracking/tables/tracking_job/table.ts +34 -0
- package/src/modules/shipment_tracking/widgets/dashboard/ships-map/config.ts +32 -0
- package/src/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.tsx +448 -0
- package/src/modules/shipment_tracking/widgets/dashboard/ships-map/widget.ts +25 -0
- package/src/types/assets.d.ts +5 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"eventType": "EQUIPMENT",
|
|
4
|
+
"equipmentEventTypeCode": "GTOT",
|
|
5
|
+
"eventId": "SYN-1679232491",
|
|
6
|
+
"eventDateTime": "2025-10-24T05:00:00-06:00",
|
|
7
|
+
"eventClassifierCode": "ACT",
|
|
8
|
+
"eventCreatedDateTime": "2025-10-24T05:00:00-06:00",
|
|
9
|
+
"description": "Empty to Shipper",
|
|
10
|
+
"equipmentReference": "MSNU2138133",
|
|
11
|
+
"ISOEquipmentCode": "2210",
|
|
12
|
+
"emptyIndicatorCode": "EMPTY",
|
|
13
|
+
"transportCall": {
|
|
14
|
+
"transportCallID": "CRCARTRB",
|
|
15
|
+
"unLocationCode": "CRCAR",
|
|
16
|
+
"facilityCode": "CRCARTRAA",
|
|
17
|
+
"facilityCodeListProvider": "SMDG",
|
|
18
|
+
"facilityTypeCode": "DEPO",
|
|
19
|
+
"modeOfTransport": "TRUCK",
|
|
20
|
+
"vessel": null,
|
|
21
|
+
"exportVoyageNumber": null,
|
|
22
|
+
"importVoyageNumber": null
|
|
23
|
+
},
|
|
24
|
+
"eventLocation": {
|
|
25
|
+
"locationName": "CARTAGO",
|
|
26
|
+
"unLocationCode": "CRCAR",
|
|
27
|
+
"facilityCode": "CRCARTRAA",
|
|
28
|
+
"facilityCodeListProvider": "SMDG"
|
|
29
|
+
},
|
|
30
|
+
"documentReferences": [
|
|
31
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
32
|
+
],
|
|
33
|
+
"seals": [],
|
|
34
|
+
"references": []
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"eventType": "EQUIPMENT",
|
|
38
|
+
"equipmentEventTypeCode": "GTIN",
|
|
39
|
+
"eventId": "SYN-1679340160",
|
|
40
|
+
"eventDateTime": "2025-10-24T12:02:00-06:00",
|
|
41
|
+
"eventClassifierCode": "ACT",
|
|
42
|
+
"eventCreatedDateTime": "2025-10-24T12:02:00-06:00",
|
|
43
|
+
"description": "Export received at CY",
|
|
44
|
+
"equipmentReference": "MSNU2138133",
|
|
45
|
+
"ISOEquipmentCode": "2210",
|
|
46
|
+
"emptyIndicatorCode": "LADEN",
|
|
47
|
+
"transportCall": {
|
|
48
|
+
"transportCallID": "CRMOBTRB",
|
|
49
|
+
"unLocationCode": "CRMOB",
|
|
50
|
+
"facilityCode": "APMT",
|
|
51
|
+
"facilityCodeListProvider": "SMDG",
|
|
52
|
+
"facilityTypeCode": "POTE",
|
|
53
|
+
"modeOfTransport": "TRUCK",
|
|
54
|
+
"vessel": null,
|
|
55
|
+
"exportVoyageNumber": null,
|
|
56
|
+
"importVoyageNumber": null
|
|
57
|
+
},
|
|
58
|
+
"eventLocation": {
|
|
59
|
+
"locationName": "MOIN",
|
|
60
|
+
"unLocationCode": "CRMOB",
|
|
61
|
+
"facilityCode": "APMT",
|
|
62
|
+
"facilityCodeListProvider": "SMDG"
|
|
63
|
+
},
|
|
64
|
+
"documentReferences": [
|
|
65
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
66
|
+
],
|
|
67
|
+
"seals": [{ "sealNumber": "TESTSEAL001", "sealSource": "CAR" }],
|
|
68
|
+
"references": []
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"eventType": "EQUIPMENT",
|
|
72
|
+
"equipmentEventTypeCode": "LOAD",
|
|
73
|
+
"eventId": "SYN-1681072009",
|
|
74
|
+
"eventDateTime": "2025-10-27T15:10:00-06:00",
|
|
75
|
+
"eventClassifierCode": "ACT",
|
|
76
|
+
"eventCreatedDateTime": "2025-10-27T15:10:00-06:00",
|
|
77
|
+
"description": "Export Loaded on Vessel",
|
|
78
|
+
"equipmentReference": "MSNU2138133",
|
|
79
|
+
"ISOEquipmentCode": "2210",
|
|
80
|
+
"emptyIndicatorCode": "LADEN",
|
|
81
|
+
"transportCall": {
|
|
82
|
+
"transportCallID": "CRMOBNN542R",
|
|
83
|
+
"unLocationCode": "CRMOB",
|
|
84
|
+
"facilityCode": "APMT",
|
|
85
|
+
"facilityCodeListProvider": "SMDG",
|
|
86
|
+
"facilityTypeCode": "POTE",
|
|
87
|
+
"modeOfTransport": "VESSEL",
|
|
88
|
+
"vessel": {
|
|
89
|
+
"vesselIMONumber": "9227340",
|
|
90
|
+
"vesselName": "MSC VAISHNAVI R.",
|
|
91
|
+
"vesselFlag": "LR",
|
|
92
|
+
"vesselCallSignNumber": "XXXXX"
|
|
93
|
+
},
|
|
94
|
+
"exportVoyageNumber": "NN542R",
|
|
95
|
+
"importVoyageNumber": null
|
|
96
|
+
},
|
|
97
|
+
"eventLocation": {
|
|
98
|
+
"locationName": "MOIN",
|
|
99
|
+
"unLocationCode": "CRMOB",
|
|
100
|
+
"facilityCode": "APMT",
|
|
101
|
+
"facilityCodeListProvider": "SMDG"
|
|
102
|
+
},
|
|
103
|
+
"documentReferences": [
|
|
104
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
105
|
+
],
|
|
106
|
+
"seals": [{ "sealNumber": "TESTSEAL001", "sealSource": "CAR" }],
|
|
107
|
+
"references": []
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"eventType": "TRANSPORT",
|
|
111
|
+
"transportEventTypeCode": "DEPA",
|
|
112
|
+
"eventId": "SYN-ACT-DEPA-CRMOB",
|
|
113
|
+
"eventDateTime": "2025-10-27T21:18:00-06:00",
|
|
114
|
+
"eventClassifierCode": "ACT",
|
|
115
|
+
"eventCreatedDateTime": "2025-10-27T21:18:00-06:00",
|
|
116
|
+
"description": "Vessel Departure",
|
|
117
|
+
"transportCall": {
|
|
118
|
+
"transportCallID": "CRMOBNN542R",
|
|
119
|
+
"unLocationCode": "CRMOB",
|
|
120
|
+
"facilityCode": "APMT",
|
|
121
|
+
"facilityCodeListProvider": "SMDG",
|
|
122
|
+
"facilityTypeCode": "POTE",
|
|
123
|
+
"modeOfTransport": "VESSEL",
|
|
124
|
+
"vessel": {
|
|
125
|
+
"vesselIMONumber": "9227340",
|
|
126
|
+
"vesselName": "MSC VAISHNAVI R.",
|
|
127
|
+
"vesselFlag": "LR",
|
|
128
|
+
"vesselCallSignNumber": "XXXXX"
|
|
129
|
+
},
|
|
130
|
+
"exportVoyageNumber": "NN542R",
|
|
131
|
+
"importVoyageNumber": null
|
|
132
|
+
},
|
|
133
|
+
"documentReferences": [
|
|
134
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
135
|
+
],
|
|
136
|
+
"references": []
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"eventType": "TRANSPORT",
|
|
140
|
+
"transportEventTypeCode": "ARRI",
|
|
141
|
+
"eventId": "SYN-ACT-ARRI-BEANR",
|
|
142
|
+
"eventDateTime": "2025-11-11T13:24:00+01:00",
|
|
143
|
+
"eventClassifierCode": "ACT",
|
|
144
|
+
"eventCreatedDateTime": "2025-11-11T13:24:00+01:00",
|
|
145
|
+
"description": "Vessel Arrival",
|
|
146
|
+
"transportCall": {
|
|
147
|
+
"transportCallID": "BEANRNN542R",
|
|
148
|
+
"unLocationCode": "BEANR",
|
|
149
|
+
"facilityCode": "K1742",
|
|
150
|
+
"facilityCodeListProvider": "SMDG",
|
|
151
|
+
"facilityTypeCode": "POTE",
|
|
152
|
+
"modeOfTransport": "VESSEL",
|
|
153
|
+
"vessel": {
|
|
154
|
+
"vesselIMONumber": "9227340",
|
|
155
|
+
"vesselName": "MSC VAISHNAVI R.",
|
|
156
|
+
"vesselFlag": "LR",
|
|
157
|
+
"vesselCallSignNumber": "XXXXX"
|
|
158
|
+
},
|
|
159
|
+
"exportVoyageNumber": null,
|
|
160
|
+
"importVoyageNumber": "NN542R"
|
|
161
|
+
},
|
|
162
|
+
"documentReferences": [
|
|
163
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
164
|
+
],
|
|
165
|
+
"references": []
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"eventType": "EQUIPMENT",
|
|
169
|
+
"equipmentEventTypeCode": "DISC",
|
|
170
|
+
"eventId": "SYN-1690735125",
|
|
171
|
+
"eventDateTime": "2025-11-11T15:18:00+01:00",
|
|
172
|
+
"eventClassifierCode": "ACT",
|
|
173
|
+
"eventCreatedDateTime": "2025-11-11T15:18:00+01:00",
|
|
174
|
+
"description": "Import Discharged from Vessel",
|
|
175
|
+
"equipmentReference": "MSNU2138133",
|
|
176
|
+
"ISOEquipmentCode": "2210",
|
|
177
|
+
"emptyIndicatorCode": "LADEN",
|
|
178
|
+
"transportCall": {
|
|
179
|
+
"transportCallID": "BEANRNN542R",
|
|
180
|
+
"unLocationCode": "BEANR",
|
|
181
|
+
"facilityCode": "K1742",
|
|
182
|
+
"facilityCodeListProvider": "SMDG",
|
|
183
|
+
"facilityTypeCode": "POTE",
|
|
184
|
+
"modeOfTransport": "VESSEL",
|
|
185
|
+
"vessel": {
|
|
186
|
+
"vesselIMONumber": "9227340",
|
|
187
|
+
"vesselName": "MSC VAISHNAVI R.",
|
|
188
|
+
"vesselFlag": "LR",
|
|
189
|
+
"vesselCallSignNumber": "XXXXX"
|
|
190
|
+
},
|
|
191
|
+
"exportVoyageNumber": null,
|
|
192
|
+
"importVoyageNumber": "NN542R"
|
|
193
|
+
},
|
|
194
|
+
"eventLocation": {
|
|
195
|
+
"locationName": "ANTWERP",
|
|
196
|
+
"unLocationCode": "BEANR",
|
|
197
|
+
"facilityCode": "K1742",
|
|
198
|
+
"facilityCodeListProvider": "SMDG"
|
|
199
|
+
},
|
|
200
|
+
"documentReferences": [
|
|
201
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
202
|
+
],
|
|
203
|
+
"seals": [{ "sealNumber": "TESTSEAL001", "sealSource": "CAR" }],
|
|
204
|
+
"references": []
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"eventType": "EQUIPMENT",
|
|
208
|
+
"equipmentEventTypeCode": "LOAD",
|
|
209
|
+
"eventId": "SYN-1693354659",
|
|
210
|
+
"eventDateTime": "2025-11-15T08:31:00+01:00",
|
|
211
|
+
"eventClassifierCode": "ACT",
|
|
212
|
+
"eventCreatedDateTime": "2025-11-15T08:31:00+01:00",
|
|
213
|
+
"description": "Export Loaded on Vessel",
|
|
214
|
+
"equipmentReference": "MSNU2138133",
|
|
215
|
+
"ISOEquipmentCode": "2210",
|
|
216
|
+
"emptyIndicatorCode": "LADEN",
|
|
217
|
+
"transportCall": {
|
|
218
|
+
"transportCallID": "BEANRQB538W",
|
|
219
|
+
"unLocationCode": "BEANR",
|
|
220
|
+
"facilityCode": "K1742",
|
|
221
|
+
"facilityCodeListProvider": "SMDG",
|
|
222
|
+
"facilityTypeCode": "POTE",
|
|
223
|
+
"modeOfTransport": "VESSEL",
|
|
224
|
+
"vessel": {
|
|
225
|
+
"vesselIMONumber": "9963619",
|
|
226
|
+
"vesselName": "MSC IERANTO",
|
|
227
|
+
"vesselFlag": "LR",
|
|
228
|
+
"vesselCallSignNumber": "XXXXX"
|
|
229
|
+
},
|
|
230
|
+
"exportVoyageNumber": "QB538W",
|
|
231
|
+
"importVoyageNumber": null
|
|
232
|
+
},
|
|
233
|
+
"eventLocation": {
|
|
234
|
+
"locationName": "ANTWERP",
|
|
235
|
+
"unLocationCode": "BEANR",
|
|
236
|
+
"facilityCode": "K1742",
|
|
237
|
+
"facilityCodeListProvider": "SMDG"
|
|
238
|
+
},
|
|
239
|
+
"documentReferences": [
|
|
240
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
241
|
+
],
|
|
242
|
+
"seals": [{ "sealNumber": "TESTSEAL001", "sealSource": "CAR" }],
|
|
243
|
+
"references": []
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"eventType": "TRANSPORT",
|
|
247
|
+
"transportEventTypeCode": "DEPA",
|
|
248
|
+
"eventId": "SYN-ACT-DEPA-BEANR",
|
|
249
|
+
"eventDateTime": "2025-11-16T07:06:00+01:00",
|
|
250
|
+
"eventClassifierCode": "ACT",
|
|
251
|
+
"eventCreatedDateTime": "2025-11-16T07:06:00+01:00",
|
|
252
|
+
"description": "Vessel Departure",
|
|
253
|
+
"transportCall": {
|
|
254
|
+
"transportCallID": "BEANRQB538W",
|
|
255
|
+
"unLocationCode": "BEANR",
|
|
256
|
+
"facilityCode": "K1742",
|
|
257
|
+
"facilityCodeListProvider": "SMDG",
|
|
258
|
+
"facilityTypeCode": "POTE",
|
|
259
|
+
"modeOfTransport": "VESSEL",
|
|
260
|
+
"vessel": {
|
|
261
|
+
"vesselIMONumber": "9963619",
|
|
262
|
+
"vesselName": "MSC IERANTO",
|
|
263
|
+
"vesselFlag": "LR",
|
|
264
|
+
"vesselCallSignNumber": "XXXXX"
|
|
265
|
+
},
|
|
266
|
+
"exportVoyageNumber": "QB538W",
|
|
267
|
+
"importVoyageNumber": null
|
|
268
|
+
},
|
|
269
|
+
"documentReferences": [
|
|
270
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
271
|
+
],
|
|
272
|
+
"references": []
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"eventType": "TRANSPORT",
|
|
276
|
+
"transportEventTypeCode": "ARRI",
|
|
277
|
+
"eventId": "SYN-ACT-ARRI-PLGDY",
|
|
278
|
+
"eventDateTime": "2025-11-25T12:30:00+01:00",
|
|
279
|
+
"eventClassifierCode": "ACT",
|
|
280
|
+
"eventCreatedDateTime": "2025-11-25T12:30:00+01:00",
|
|
281
|
+
"description": "Vessel Arrival",
|
|
282
|
+
"transportCall": {
|
|
283
|
+
"transportCallID": "PLGDYQB538W",
|
|
284
|
+
"unLocationCode": "PLGDY",
|
|
285
|
+
"facilityCode": "PLBCT",
|
|
286
|
+
"facilityCodeListProvider": "SMDG",
|
|
287
|
+
"facilityTypeCode": "POTE",
|
|
288
|
+
"modeOfTransport": "VESSEL",
|
|
289
|
+
"vessel": {
|
|
290
|
+
"vesselIMONumber": "9963619",
|
|
291
|
+
"vesselName": "MSC IERANTO",
|
|
292
|
+
"vesselFlag": "LR",
|
|
293
|
+
"vesselCallSignNumber": "XXXXX"
|
|
294
|
+
},
|
|
295
|
+
"exportVoyageNumber": null,
|
|
296
|
+
"importVoyageNumber": "QB538W"
|
|
297
|
+
},
|
|
298
|
+
"documentReferences": [
|
|
299
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
300
|
+
],
|
|
301
|
+
"references": []
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"eventType": "EQUIPMENT",
|
|
305
|
+
"equipmentEventTypeCode": "DISC",
|
|
306
|
+
"eventId": "SYN-1700998316",
|
|
307
|
+
"eventDateTime": "2025-11-27T02:55:00+01:00",
|
|
308
|
+
"eventClassifierCode": "ACT",
|
|
309
|
+
"eventCreatedDateTime": "2025-11-27T02:55:00+01:00",
|
|
310
|
+
"description": "Import Discharged from Vessel",
|
|
311
|
+
"equipmentReference": "MSNU2138133",
|
|
312
|
+
"ISOEquipmentCode": "2210",
|
|
313
|
+
"emptyIndicatorCode": "LADEN",
|
|
314
|
+
"transportCall": {
|
|
315
|
+
"transportCallID": "PLGDYQB538W",
|
|
316
|
+
"unLocationCode": "PLGDY",
|
|
317
|
+
"facilityCode": "PLBCT",
|
|
318
|
+
"facilityCodeListProvider": "SMDG",
|
|
319
|
+
"facilityTypeCode": "POTE",
|
|
320
|
+
"modeOfTransport": "VESSEL",
|
|
321
|
+
"vessel": {
|
|
322
|
+
"vesselIMONumber": "9963619",
|
|
323
|
+
"vesselName": "MSC IERANTO",
|
|
324
|
+
"vesselFlag": "LR",
|
|
325
|
+
"vesselCallSignNumber": "XXXXX"
|
|
326
|
+
},
|
|
327
|
+
"exportVoyageNumber": null,
|
|
328
|
+
"importVoyageNumber": "QB538W"
|
|
329
|
+
},
|
|
330
|
+
"eventLocation": {
|
|
331
|
+
"locationName": "GDYNIA",
|
|
332
|
+
"unLocationCode": "PLGDY",
|
|
333
|
+
"facilityCode": "PLBCT",
|
|
334
|
+
"facilityCodeListProvider": "SMDG"
|
|
335
|
+
},
|
|
336
|
+
"documentReferences": [
|
|
337
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
338
|
+
],
|
|
339
|
+
"seals": [{ "sealNumber": "TESTSEAL001", "sealSource": "CAR" }],
|
|
340
|
+
"references": []
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"eventType": "EQUIPMENT",
|
|
344
|
+
"equipmentEventTypeCode": "GTOT",
|
|
345
|
+
"eventId": "SYN-1704657763",
|
|
346
|
+
"eventDateTime": "2025-12-03T00:16:00+01:00",
|
|
347
|
+
"eventClassifierCode": "ACT",
|
|
348
|
+
"eventCreatedDateTime": "2025-12-03T00:16:00+01:00",
|
|
349
|
+
"description": "Import to consignee",
|
|
350
|
+
"equipmentReference": "MSNU2138133",
|
|
351
|
+
"ISOEquipmentCode": "2210",
|
|
352
|
+
"emptyIndicatorCode": "LADEN",
|
|
353
|
+
"transportCall": {
|
|
354
|
+
"transportCallID": "PLGDYTRB",
|
|
355
|
+
"unLocationCode": "PLGDY",
|
|
356
|
+
"facilityCode": "PLBCT",
|
|
357
|
+
"facilityCodeListProvider": "SMDG",
|
|
358
|
+
"facilityTypeCode": "POTE",
|
|
359
|
+
"modeOfTransport": "TRUCK",
|
|
360
|
+
"vessel": null,
|
|
361
|
+
"exportVoyageNumber": null,
|
|
362
|
+
"importVoyageNumber": null
|
|
363
|
+
},
|
|
364
|
+
"eventLocation": {
|
|
365
|
+
"locationName": "GDYNIA",
|
|
366
|
+
"unLocationCode": "PLGDY",
|
|
367
|
+
"facilityCode": "PLBCT",
|
|
368
|
+
"facilityCodeListProvider": "SMDG"
|
|
369
|
+
},
|
|
370
|
+
"documentReferences": [
|
|
371
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
372
|
+
],
|
|
373
|
+
"seals": [],
|
|
374
|
+
"references": []
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"eventType": "EQUIPMENT",
|
|
378
|
+
"equipmentEventTypeCode": "GTIN",
|
|
379
|
+
"eventId": "SYN-1708307647",
|
|
380
|
+
"eventDateTime": "2025-12-08T21:36:00+01:00",
|
|
381
|
+
"eventClassifierCode": "ACT",
|
|
382
|
+
"eventCreatedDateTime": "2025-12-08T21:36:00+01:00",
|
|
383
|
+
"description": "Empty received at CY",
|
|
384
|
+
"equipmentReference": "MSNU2138133",
|
|
385
|
+
"ISOEquipmentCode": "2210",
|
|
386
|
+
"emptyIndicatorCode": "EMPTY",
|
|
387
|
+
"transportCall": {
|
|
388
|
+
"transportCallID": "PLGDYTRB",
|
|
389
|
+
"unLocationCode": "PLGDY",
|
|
390
|
+
"facilityCode": "PLBCT",
|
|
391
|
+
"facilityCodeListProvider": "SMDG",
|
|
392
|
+
"facilityTypeCode": "POTE",
|
|
393
|
+
"modeOfTransport": "TRUCK",
|
|
394
|
+
"vessel": null,
|
|
395
|
+
"exportVoyageNumber": null,
|
|
396
|
+
"importVoyageNumber": null
|
|
397
|
+
},
|
|
398
|
+
"eventLocation": {
|
|
399
|
+
"locationName": "GDYNIA",
|
|
400
|
+
"unLocationCode": "PLGDY",
|
|
401
|
+
"facilityCode": "PLBCT",
|
|
402
|
+
"facilityCodeListProvider": "SMDG"
|
|
403
|
+
},
|
|
404
|
+
"documentReferences": [
|
|
405
|
+
{ "documentReferenceType": "BKG", "documentReferenceValue": "TEST-VOYAGE-001" }
|
|
406
|
+
],
|
|
407
|
+
"seals": [],
|
|
408
|
+
"references": []
|
|
409
|
+
}
|
|
410
|
+
]
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mapAirShipmentToEvents } from '../lib/shipsgo-mapper'
|
|
3
|
+
import { deriveAirShipmentStatus } from '../lib/status-machine'
|
|
4
|
+
import type { ShipsGoAirShipment } from '../lib/shipsgo-client'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TC-TRACK-415 — ShipsGo air movement mapping + air status machine.
|
|
8
|
+
*
|
|
9
|
+
* Air has no container/vessel model: mapAirShipmentToEvents emits one TRANSPORT
|
|
10
|
+
* event per movement (DEP→DEPA, ARR→ARRI so shared time-extraction fills
|
|
11
|
+
* ATD/ATA) and carries AWB/flight/airline + the ShipsGo top-level status on the
|
|
12
|
+
* result. deriveAirShipmentStatus maps that top-level status forward-only.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function airShipment(overrides: Partial<ShipsGoAirShipment> = {}): ShipsGoAirShipment {
|
|
16
|
+
return {
|
|
17
|
+
id: 55555,
|
|
18
|
+
reference: 'job-air',
|
|
19
|
+
awb_number: '020-12345678',
|
|
20
|
+
airline: { iata: 'LH', name: 'Lufthansa' },
|
|
21
|
+
status: 'EN_ROUTE',
|
|
22
|
+
movements: [
|
|
23
|
+
{ event: 'RCS', status: 'ACT', location: { iata: 'WAW', name: 'Warsaw', country: { code: 'PL', name: 'Poland' } }, flight: null, timestamp: '2026-08-01T08:00:00Z' },
|
|
24
|
+
{ event: 'DEP', status: 'ACT', location: { iata: 'WAW', name: 'Warsaw', country: { code: 'PL', name: 'Poland' } }, flight: 'LH1234', timestamp: '2026-08-01T12:00:00Z' },
|
|
25
|
+
{ event: 'ARR', status: 'EST', location: { iata: 'JFK', name: 'New York', country: { code: 'US', name: 'United States' } }, flight: 'LH1234', timestamp: '2026-08-01T20:00:00Z' },
|
|
26
|
+
],
|
|
27
|
+
...overrides,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('mapAirShipmentToEvents', () => {
|
|
32
|
+
it('maps air movements to transport events and carries AWB/flight/airline', () => {
|
|
33
|
+
const result = mapAirShipmentToEvents(airShipment())
|
|
34
|
+
|
|
35
|
+
expect(result.events).toHaveLength(3)
|
|
36
|
+
for (const e of result.events) {
|
|
37
|
+
expect(e.source).toBe('shipsgo')
|
|
38
|
+
expect(e.eventType).toBe('TRANSPORT')
|
|
39
|
+
}
|
|
40
|
+
// DEP→DEPA, ARR→ARRI so the shared time-extraction fills ATD/ATA/ETA.
|
|
41
|
+
const codes = result.events.map((e) => e.eventCode)
|
|
42
|
+
expect(codes).toContain('DEPA')
|
|
43
|
+
expect(codes).toContain('ARRI')
|
|
44
|
+
expect(codes).toContain('RCS')
|
|
45
|
+
|
|
46
|
+
expect(result.awbNumber).toBe('020-12345678')
|
|
47
|
+
expect(result.airlineCode).toBe('LH')
|
|
48
|
+
expect(result.airlineName).toBe('Lufthansa')
|
|
49
|
+
expect(result.flightNumber).toBe('LH1234') // latest flight seen
|
|
50
|
+
expect(result.airStatus).toBe('EN_ROUTE')
|
|
51
|
+
expect(result.containerNumber).toBeNull()
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('persists the local UTC offset from the ShipsGo timestamp (eventDateTimeOffset)', () => {
|
|
55
|
+
const result = mapAirShipmentToEvents(
|
|
56
|
+
airShipment({
|
|
57
|
+
movements: [
|
|
58
|
+
{ event: 'DEP', status: 'EST', location: { iata: 'PEK', name: 'Beijing' }, flight: 'CA841', timestamp: '2026-09-09T02:55:00+08:00' },
|
|
59
|
+
{ event: 'ARR', status: 'EST', location: { iata: 'VIE', name: 'Vienna' }, flight: 'CA841', timestamp: '2026-09-09T06:50:00+02:00' },
|
|
60
|
+
{ event: 'RCS', status: 'ACT', location: { iata: 'FRA', name: 'Frankfurt' }, flight: null, timestamp: '2026-09-08T10:00:00Z' },
|
|
61
|
+
],
|
|
62
|
+
}),
|
|
63
|
+
)
|
|
64
|
+
const byCode = Object.fromEntries(result.events.map((e) => [e.eventCode, e]))
|
|
65
|
+
expect(byCode['DEPA'].eventDateTimeOffset).toBe('+08:00')
|
|
66
|
+
expect(byCode['ARRI'].eventDateTimeOffset).toBe('+02:00')
|
|
67
|
+
// Z / UTC → null (already the default)
|
|
68
|
+
expect(byCode['RCS'].eventDateTimeOffset).toBeNull()
|
|
69
|
+
// The stored instant is still the correct UTC moment regardless of offset.
|
|
70
|
+
expect(byCode['DEPA'].eventDateTime.toISOString()).toBe('2026-09-08T18:55:00.000Z')
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('flags AIR mode of transport on flight-bearing movements', () => {
|
|
74
|
+
const result = mapAirShipmentToEvents(airShipment())
|
|
75
|
+
const dep = result.events.find((e) => e.eventCode === 'DEPA')!
|
|
76
|
+
expect(dep.modeOfTransport).toBe('AIR')
|
|
77
|
+
expect(dep.eventClassifierCode).toBe('ACT')
|
|
78
|
+
const arr = result.events.find((e) => e.eventCode === 'ARRI')!
|
|
79
|
+
expect(arr.eventClassifierCode).toBe('EST')
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('produces deterministic ids and skips unknown/invalid movements', () => {
|
|
83
|
+
const s = airShipment({
|
|
84
|
+
movements: [
|
|
85
|
+
{ event: 'XXX', status: 'ACT', timestamp: '2026-08-01T10:00:00Z' },
|
|
86
|
+
{ event: 'DEP', status: 'ACT', timestamp: 'not-a-date' },
|
|
87
|
+
{ event: 'DLV', status: 'ACT', timestamp: '2026-08-02T10:00:00Z' },
|
|
88
|
+
],
|
|
89
|
+
})
|
|
90
|
+
const a = mapAirShipmentToEvents(s)
|
|
91
|
+
const b = mapAirShipmentToEvents(s)
|
|
92
|
+
expect(a.events).toHaveLength(1)
|
|
93
|
+
expect(a.events[0].eventCode).toBe('DLVR')
|
|
94
|
+
expect(a.events.map((e) => e.sourceEventId)).toEqual(b.events.map((e) => e.sourceEventId))
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('handles a shipment with no movements', () => {
|
|
98
|
+
const result = mapAirShipmentToEvents(airShipment({ movements: [], status: 'BOOKED' }))
|
|
99
|
+
expect(result.events).toEqual([])
|
|
100
|
+
expect(result.airStatus).toBe('BOOKED')
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('captures cargo (pieces/weight/volume) + status_extended into extra', () => {
|
|
104
|
+
const result = mapAirShipmentToEvents(
|
|
105
|
+
airShipment({
|
|
106
|
+
cargo: { pieces: 12, weight: 340.5, weight_unit: 'kg', volume: 2.1, volume_unit: 'm3' },
|
|
107
|
+
status_extended: { EN_ROUTE: 12 },
|
|
108
|
+
}),
|
|
109
|
+
)
|
|
110
|
+
const extra = result.extra as any
|
|
111
|
+
expect(extra.shipsgoAir.cargo).toEqual({ pieces: 12, weight: 340.5, weightUnit: 'kg', volume: 2.1, volumeUnit: 'm3' })
|
|
112
|
+
expect(extra.shipsgoAir.statusExtended).toEqual({ EN_ROUTE: 12 })
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it('captures the air route (origin/destination airports + transit/CO2) into extra', () => {
|
|
116
|
+
const result = mapAirShipmentToEvents(
|
|
117
|
+
airShipment({
|
|
118
|
+
route: {
|
|
119
|
+
origin: { location: { iata: 'PEK', name: 'Beijing Capital' }, date_of_dep: '2026-09-09T02:55:00+08:00' },
|
|
120
|
+
destination: { location: { iata: 'VIE', name: 'Vienna' }, date_of_rcf: '2026-09-09T06:50:00+02:00' },
|
|
121
|
+
transit_time: 10,
|
|
122
|
+
transit_percentage: 0,
|
|
123
|
+
co2_emission: 1.61,
|
|
124
|
+
ts_count: 0,
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
)
|
|
128
|
+
const extra = result.extra as any
|
|
129
|
+
expect(extra.shipsgoAir.route).toMatchObject({
|
|
130
|
+
origin: { iata: 'PEK', name: 'Beijing Capital' },
|
|
131
|
+
destination: { iata: 'VIE', name: 'Vienna' },
|
|
132
|
+
transitTimeDays: 10,
|
|
133
|
+
co2Emission: 1.61,
|
|
134
|
+
transshipmentCount: 0,
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it('leaves extra null when no cargo, route or status_extended', () => {
|
|
139
|
+
expect(mapAirShipmentToEvents(airShipment()).extra).toBeNull()
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
describe('deriveAirShipmentStatus', () => {
|
|
144
|
+
it('maps ShipsGo top-level status onto the internal enum', () => {
|
|
145
|
+
expect(deriveAirShipmentStatus('BOOKED', 'PENDING')).toBe('BOOKED')
|
|
146
|
+
expect(deriveAirShipmentStatus('EN_ROUTE', 'BOOKED')).toBe('IN_TRANSIT')
|
|
147
|
+
expect(deriveAirShipmentStatus('LANDED', 'IN_TRANSIT')).toBe('ARRIVED')
|
|
148
|
+
expect(deriveAirShipmentStatus('DELIVERED', 'ARRIVED')).toBe('DELIVERED')
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
it('never downgrades and ignores unknown/empty status', () => {
|
|
152
|
+
expect(deriveAirShipmentStatus('BOOKED', 'IN_TRANSIT')).toBe('IN_TRANSIT')
|
|
153
|
+
expect(deriveAirShipmentStatus('UNTRACKED', 'IN_TRANSIT')).toBe('IN_TRANSIT')
|
|
154
|
+
expect(deriveAirShipmentStatus(null, 'BOOKED')).toBe('BOOKED')
|
|
155
|
+
expect(deriveAirShipmentStatus('WHatever', 'BOOKED')).toBe('BOOKED')
|
|
156
|
+
})
|
|
157
|
+
})
|