@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,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { MapPin } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export const metadata = {
|
|
5
|
+
requireAuth: true,
|
|
6
|
+
requireFeatures: ['shipment_tracking.location_overrides.view'],
|
|
7
|
+
pageTitle: 'Location Overrides',
|
|
8
|
+
pageTitleKey: 'shipment_tracking.nav.location_overrides',
|
|
9
|
+
pageGroup: 'Shipment Tracking',
|
|
10
|
+
pageGroupKey: 'shipment_tracking.nav.group',
|
|
11
|
+
pageContext: 'settings' as const,
|
|
12
|
+
pagePriority: 10,
|
|
13
|
+
pageOrder: 140,
|
|
14
|
+
icon: React.createElement(MapPin, { size: 16 }),
|
|
15
|
+
breadcrumb: [{ label: 'Location Overrides', labelKey: 'shipment_tracking.nav.location_overrides' }],
|
|
16
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useCallback, useMemo, useState } from 'react'
|
|
5
|
+
import { Page, PageBody } from '@freighttech/ui/backend/Page'
|
|
6
|
+
import { BooleanIcon } from '@freighttech/ui/backend/ValueIcons'
|
|
7
|
+
import { Button } from '@freighttech/ui/primitives-v2'
|
|
8
|
+
import {
|
|
9
|
+
DynamicTable,
|
|
10
|
+
DynamicTableBadge,
|
|
11
|
+
TableSkeleton,
|
|
12
|
+
useDynamicTablePage,
|
|
13
|
+
} from '@freighttech/ui/backend/dynamic-table'
|
|
14
|
+
import type { ColumnDef, ContextMenuAction, DynamicTableBadgeVariant } from '@freighttech/ui/backend/dynamic-table'
|
|
15
|
+
import { apiCallOrThrow } from '@freighttech/ui/backend/utils/apiCall'
|
|
16
|
+
import { flash } from '@freighttech/ui/backend/FlashMessages'
|
|
17
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
18
|
+
import { Plus } from 'lucide-react'
|
|
19
|
+
import { LocationOverrideDrawer } from '../../components/LocationOverrideDrawer'
|
|
20
|
+
|
|
21
|
+
type LocationOverrideRow = {
|
|
22
|
+
id: string
|
|
23
|
+
carrierCode: string | null
|
|
24
|
+
unlocode: string
|
|
25
|
+
facilityCode: string
|
|
26
|
+
facilityCodeListProvider: 'BIC' | 'SMDG'
|
|
27
|
+
overrideName: string
|
|
28
|
+
description: string | null
|
|
29
|
+
isActive: boolean
|
|
30
|
+
createdAt: string | null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function mapItem(item: Record<string, unknown>): LocationOverrideRow | null {
|
|
34
|
+
const id = typeof item.id === 'string' ? item.id : null
|
|
35
|
+
if (!id) return null
|
|
36
|
+
|
|
37
|
+
const overrideData = (item.overrideData ?? item.override_data) as Record<string, unknown> | null
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
id,
|
|
41
|
+
carrierCode: (item.carrierCode as string) ?? (item.carrier_code as string) ?? null,
|
|
42
|
+
unlocode: (item.unlocode as string) ?? '',
|
|
43
|
+
facilityCode: (item.facilityCode as string) ?? (item.facility_code as string) ?? '',
|
|
44
|
+
facilityCodeListProvider: ((item.facilityCodeListProvider ?? item.facility_code_list_provider) as 'BIC' | 'SMDG') ?? 'SMDG',
|
|
45
|
+
overrideName: (overrideData?.name as string) ?? '',
|
|
46
|
+
description: (item.description as string) ?? null,
|
|
47
|
+
isActive: item.isActive === true || item.is_active === true,
|
|
48
|
+
createdAt: (item.createdAt as string) ?? (item.created_at as string) ?? null,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default function LocationOverridesPage() {
|
|
53
|
+
const t = useT()
|
|
54
|
+
const [drawerOpen, setDrawerOpen] = useState(false)
|
|
55
|
+
const [drawerMode, setDrawerMode] = useState<'create' | 'edit'>('create')
|
|
56
|
+
const [selectedOverrideId, setSelectedOverrideId] = useState<string | undefined>(undefined)
|
|
57
|
+
|
|
58
|
+
const columns = useMemo<ColumnDef[]>(
|
|
59
|
+
() => [
|
|
60
|
+
{
|
|
61
|
+
data: 'carrierCode',
|
|
62
|
+
title: t('shipment_tracking.location_overrides.fields.carrierCode', 'Carrier'),
|
|
63
|
+
width: 100,
|
|
64
|
+
readOnly: true,
|
|
65
|
+
renderer: (value: unknown) => (
|
|
66
|
+
<span className="font-mono text-sm">
|
|
67
|
+
{value ? String(value) : t('shipment_tracking.location_overrides.allCarriers', 'All Carriers')}
|
|
68
|
+
</span>
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
data: 'unlocode',
|
|
73
|
+
title: t('shipment_tracking.location_overrides.fields.unlocode', 'UNLOCODE'),
|
|
74
|
+
width: 90,
|
|
75
|
+
readOnly: true,
|
|
76
|
+
renderer: (value: unknown) => (
|
|
77
|
+
<span className="font-mono text-sm tracking-wider">{String(value || '-')}</span>
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
data: 'facilityCode',
|
|
82
|
+
title: t('shipment_tracking.location_overrides.fields.facilityCode', 'Facility Code'),
|
|
83
|
+
width: 120,
|
|
84
|
+
readOnly: true,
|
|
85
|
+
renderer: (value: unknown) => (
|
|
86
|
+
<span className="font-mono text-sm tracking-wider">{String(value || '-')}</span>
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
data: 'facilityCodeListProvider',
|
|
91
|
+
title: t('shipment_tracking.location_overrides.fields.provider', 'Provider'),
|
|
92
|
+
width: 80,
|
|
93
|
+
readOnly: true,
|
|
94
|
+
renderer: (value: unknown) => {
|
|
95
|
+
const variant: DynamicTableBadgeVariant = value === 'BIC' ? 'info' : 'purple'
|
|
96
|
+
return (
|
|
97
|
+
<DynamicTableBadge variant={variant}>
|
|
98
|
+
{String(value ?? 'SMDG')}
|
|
99
|
+
</DynamicTableBadge>
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
data: 'overrideName',
|
|
105
|
+
title: t('shipment_tracking.location_overrides.fields.overrideName', 'Override Name'),
|
|
106
|
+
width: 250,
|
|
107
|
+
readOnly: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
data: 'isActive',
|
|
111
|
+
title: t('shipment_tracking.location_overrides.fields.isActive', 'Active'),
|
|
112
|
+
width: 70,
|
|
113
|
+
readOnly: true,
|
|
114
|
+
renderer: (value: unknown) => <BooleanIcon value={!!value} />,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
[t],
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
const handleRowClick = useCallback((_rowIndex: number, rowData: Record<string, unknown>) => {
|
|
121
|
+
const id = rowData?.id as string | undefined
|
|
122
|
+
if (id) {
|
|
123
|
+
setDrawerMode('edit')
|
|
124
|
+
setSelectedOverrideId(id)
|
|
125
|
+
setDrawerOpen(true)
|
|
126
|
+
}
|
|
127
|
+
}, [])
|
|
128
|
+
|
|
129
|
+
const createButton = useMemo(
|
|
130
|
+
() => (
|
|
131
|
+
<Button
|
|
132
|
+
variant="primary"
|
|
133
|
+
size="sm"
|
|
134
|
+
icon={<Plus className="h-4 w-4" />}
|
|
135
|
+
onClick={() => {
|
|
136
|
+
setDrawerMode('create')
|
|
137
|
+
setSelectedOverrideId(undefined)
|
|
138
|
+
setDrawerOpen(true)
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{t('shipment_tracking.location_overrides.create', 'Create Override')}
|
|
142
|
+
</Button>
|
|
143
|
+
),
|
|
144
|
+
[t],
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
const table = useDynamicTablePage<LocationOverrideRow>({
|
|
148
|
+
source: '/api/shipment_tracking/location-overrides',
|
|
149
|
+
// Saved views. Without this the perspective tab strip auto-hides
|
|
150
|
+
// (hidePerspectiveTabs ?? !hasPerspectives), so users cannot save or
|
|
151
|
+
// switch a view on this list at all.
|
|
152
|
+
perspectives: 'shipment_tracking_location_overrides',
|
|
153
|
+
columns,
|
|
154
|
+
tableName: t('shipment_tracking.location_overrides.title', 'Location Overrides'),
|
|
155
|
+
defaultPageSize: 20,
|
|
156
|
+
mapApiItem: mapItem,
|
|
157
|
+
cellEdit: false,
|
|
158
|
+
tableProps: {
|
|
159
|
+
height: 'fill',
|
|
160
|
+
onRowClick: handleRowClick,
|
|
161
|
+
uiConfig: {
|
|
162
|
+
readOnlyStyle: 'normal',
|
|
163
|
+
hideAddRowButton: true,
|
|
164
|
+
searchBarEnd: createButton,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
const handleDelete = useCallback(
|
|
170
|
+
async (id: string) => {
|
|
171
|
+
if (!confirm(t('shipment_tracking.location_overrides.confirm.delete', 'Delete this location override?'))) return
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
await apiCallOrThrow('/api/shipment_tracking/location-overrides', {
|
|
175
|
+
method: 'DELETE',
|
|
176
|
+
body: JSON.stringify({ id }),
|
|
177
|
+
})
|
|
178
|
+
flash(t('shipment_tracking.location_overrides.deleted', 'Location override deleted'), 'success')
|
|
179
|
+
table.refresh()
|
|
180
|
+
} catch {
|
|
181
|
+
flash(t('shipment_tracking.location_overrides.errors.deleteFailed', 'Failed to delete location override'), 'error')
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
[t, table.refresh],
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
const rowActions = useCallback(
|
|
188
|
+
(rowData: any): ContextMenuAction[] => {
|
|
189
|
+
if (!rowData?.id) return []
|
|
190
|
+
return [
|
|
191
|
+
{ id: 'delete', label: t('common.actions.delete', 'Delete') },
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
[t],
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
const handleRowAction = useCallback(
|
|
198
|
+
(actionId: string, rowData: any) => {
|
|
199
|
+
const id = rowData?.id as string | undefined
|
|
200
|
+
if (!id) return
|
|
201
|
+
if (actionId === 'delete') handleDelete(id)
|
|
202
|
+
},
|
|
203
|
+
[handleDelete],
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
if (table.isLoading) {
|
|
207
|
+
return (
|
|
208
|
+
<Page>
|
|
209
|
+
<PageBody>
|
|
210
|
+
<TableSkeleton rows={10} columns={6} />
|
|
211
|
+
</PageBody>
|
|
212
|
+
</Page>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<Page>
|
|
218
|
+
<PageBody>
|
|
219
|
+
<div className="-mx-4 lg:-mx-6">
|
|
220
|
+
<DynamicTable
|
|
221
|
+
{...table.props}
|
|
222
|
+
striped
|
|
223
|
+
density="md"
|
|
224
|
+
rowActions={rowActions}
|
|
225
|
+
onRowAction={handleRowAction}
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<LocationOverrideDrawer
|
|
230
|
+
open={drawerOpen}
|
|
231
|
+
onOpenChange={setDrawerOpen}
|
|
232
|
+
mode={drawerMode}
|
|
233
|
+
overrideId={selectedOverrideId}
|
|
234
|
+
onSaved={() => {
|
|
235
|
+
table.refresh()
|
|
236
|
+
}}
|
|
237
|
+
/>
|
|
238
|
+
</PageBody>
|
|
239
|
+
</Page>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Ship } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export const metadata = {
|
|
5
|
+
requireAuth: true,
|
|
6
|
+
requireFeatures: ['shipment_tracking.shipments.view'],
|
|
7
|
+
pageTitle: 'Shipments',
|
|
8
|
+
pageTitleKey: 'shipment_tracking.nav.shipments',
|
|
9
|
+
pageGroup: 'Shipment Tracking',
|
|
10
|
+
pageGroupKey: 'shipment_tracking.nav.group',
|
|
11
|
+
pageContext: 'settings' as const,
|
|
12
|
+
pagePriority: 10,
|
|
13
|
+
pageOrder: 100,
|
|
14
|
+
icon: React.createElement(Ship, { size: 16 }),
|
|
15
|
+
breadcrumb: [{ label: 'Shipments', labelKey: 'shipment_tracking.nav.shipments' }],
|
|
16
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { useCallback, useMemo, useState, useEffect } from 'react'
|
|
5
|
+
import { useSearchParams, useRouter } from 'next/navigation'
|
|
6
|
+
import { Page, PageBody } from '@freighttech/ui/backend/Page'
|
|
7
|
+
import { Button } from '@freighttech/ui/primitives-v2'
|
|
8
|
+
import {
|
|
9
|
+
DynamicTable,
|
|
10
|
+
DynamicTableBadge,
|
|
11
|
+
TableSkeleton,
|
|
12
|
+
useDynamicTablePage,
|
|
13
|
+
} from '@freighttech/ui/backend/dynamic-table'
|
|
14
|
+
import type { ColumnDef, ContextMenuAction, DynamicTableBadgeVariant } from '@freighttech/ui/backend/dynamic-table'
|
|
15
|
+
import { apiCallOrThrow } from '@freighttech/ui/backend/utils/apiCall'
|
|
16
|
+
import { flash } from '@freighttech/ui/backend/FlashMessages'
|
|
17
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
18
|
+
import { Plus } from 'lucide-react'
|
|
19
|
+
import { ShipmentDrawer } from '../../components/ShipmentDrawer'
|
|
20
|
+
import { ShipmentDetailsDrawer } from '../../components/ShipmentDetailsDrawer'
|
|
21
|
+
import { CombinedTimestampCell, type TimestampEntry } from '../../components/CombinedTimestampCell'
|
|
22
|
+
|
|
23
|
+
type FacilityLocation = {
|
|
24
|
+
name?: string | null
|
|
25
|
+
unlocode?: string | null
|
|
26
|
+
countryCode?: string | null
|
|
27
|
+
facilityCode?: string | null
|
|
28
|
+
} | null
|
|
29
|
+
|
|
30
|
+
type ShipmentRow = {
|
|
31
|
+
id: string
|
|
32
|
+
status: string
|
|
33
|
+
carrierCode: string | null
|
|
34
|
+
containerNumber: string | null
|
|
35
|
+
bookingNumber: string | null
|
|
36
|
+
isoEquipmentCode: string | null
|
|
37
|
+
bolNumber: string | null
|
|
38
|
+
etdTimestamps: TimestampEntry[] | null
|
|
39
|
+
etaTimestamps: TimestampEntry[] | null
|
|
40
|
+
atdTimestamps: TimestampEntry[] | null
|
|
41
|
+
ataTimestamps: TimestampEntry[] | null
|
|
42
|
+
originLocation: FacilityLocation
|
|
43
|
+
destinationLocation: FacilityLocation
|
|
44
|
+
vesselName: string | null
|
|
45
|
+
eventCount: number
|
|
46
|
+
createdAt: string | null
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function mapItem(item: Record<string, unknown>): ShipmentRow | null {
|
|
50
|
+
const id = typeof item.id === 'string' ? item.id : null
|
|
51
|
+
if (!id) return null
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
id,
|
|
55
|
+
status: (item.status as string) ?? 'ORDERED',
|
|
56
|
+
carrierCode: (item.carrierCode as string) ?? (item.carrier_code as string) ?? null,
|
|
57
|
+
containerNumber: (item.containerNumber as string) ?? (item.container_number as string) ?? null,
|
|
58
|
+
bookingNumber: (item.bookingNumber as string) ?? (item.booking_number as string) ?? null,
|
|
59
|
+
isoEquipmentCode: (item.isoEquipmentCode as string) ?? (item.iso_equipment_code as string) ?? null,
|
|
60
|
+
bolNumber: (item.bolNumber as string) ?? (item.bol_number as string) ?? null,
|
|
61
|
+
etdTimestamps: (item.etdTimestamps as TimestampEntry[]) ?? (item.etd_timestamps as TimestampEntry[]) ?? null,
|
|
62
|
+
etaTimestamps: (item.etaTimestamps as TimestampEntry[]) ?? (item.eta_timestamps as TimestampEntry[]) ?? null,
|
|
63
|
+
atdTimestamps: (item.atdTimestamps as TimestampEntry[]) ?? (item.atd_timestamps as TimestampEntry[]) ?? null,
|
|
64
|
+
ataTimestamps: (item.ataTimestamps as TimestampEntry[]) ?? (item.ata_timestamps as TimestampEntry[]) ?? null,
|
|
65
|
+
originLocation: (item.originLocation ?? item.origin_location ?? null) as FacilityLocation,
|
|
66
|
+
destinationLocation: (item.destinationLocation ?? item.destination_location ?? null) as FacilityLocation,
|
|
67
|
+
vesselName: (item.vesselName as string) ?? (item.vessel_name as string) ?? null,
|
|
68
|
+
eventCount: typeof item.eventCount === 'number' ? item.eventCount : (typeof item.event_count === 'number' ? item.event_count : 0),
|
|
69
|
+
createdAt: (item.createdAt as string) ?? (item.created_at as string) ?? null,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const STATUS_VARIANTS: Record<string, DynamicTableBadgeVariant> = {
|
|
74
|
+
ORDERED: 'neutral',
|
|
75
|
+
BOOKED: 'info',
|
|
76
|
+
DEPARTED: 'warning',
|
|
77
|
+
PRE_ARRIVAL: 'orange',
|
|
78
|
+
IN_PORT: 'purple',
|
|
79
|
+
DELIVERED: 'success',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default function ShipmentListPage() {
|
|
83
|
+
const t = useT()
|
|
84
|
+
const searchParams = useSearchParams()
|
|
85
|
+
const router = useRouter()
|
|
86
|
+
|
|
87
|
+
const [editDrawerOpen, setEditDrawerOpen] = useState(false)
|
|
88
|
+
const [detailsDrawerOpen, setDetailsDrawerOpen] = useState(false)
|
|
89
|
+
const [drawerMode, setDrawerMode] = useState<'create' | 'edit'>('create')
|
|
90
|
+
const [selectedShipmentId, setSelectedShipmentId] = useState<string | null>(null)
|
|
91
|
+
const refreshRef = React.useRef<() => void>(() => {})
|
|
92
|
+
|
|
93
|
+
const columns = useMemo<ColumnDef[]>(
|
|
94
|
+
() => [
|
|
95
|
+
{
|
|
96
|
+
data: 'containerNumber',
|
|
97
|
+
title: t('shipment_tracking.shipments.fields.containerNumber', 'Container'),
|
|
98
|
+
width: 140,
|
|
99
|
+
readOnly: true,
|
|
100
|
+
renderer: (value: unknown) => (
|
|
101
|
+
<span className="font-medium font-mono text-sm tracking-wider">
|
|
102
|
+
{String(value || '-')}
|
|
103
|
+
</span>
|
|
104
|
+
),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
data: 'bookingNumber',
|
|
108
|
+
title: t('shipment_tracking.shipments.fields.bookingNumber', 'Booking'),
|
|
109
|
+
width: 130,
|
|
110
|
+
readOnly: true,
|
|
111
|
+
renderer: (value: unknown) => (
|
|
112
|
+
<span className="font-medium font-mono text-sm tracking-wider">
|
|
113
|
+
{String(value || '-')}
|
|
114
|
+
</span>
|
|
115
|
+
),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
data: 'isoEquipmentCode',
|
|
119
|
+
title: t('shipment_tracking.shipments.fields.size', 'Size'),
|
|
120
|
+
width: 70,
|
|
121
|
+
readOnly: true,
|
|
122
|
+
renderer: (value: unknown) => (
|
|
123
|
+
<span className="font-mono text-sm">
|
|
124
|
+
{String(value || '-')}
|
|
125
|
+
</span>
|
|
126
|
+
),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
data: 'status',
|
|
130
|
+
title: t('shipment_tracking.shipments.fields.status', 'Status'),
|
|
131
|
+
width: 110,
|
|
132
|
+
readOnly: true,
|
|
133
|
+
renderer: (value: unknown) => {
|
|
134
|
+
const status = String(value ?? '')
|
|
135
|
+
const label = t(`shipment_tracking.shipments.statuses.${status}`, status)
|
|
136
|
+
return (
|
|
137
|
+
<DynamicTableBadge variant={STATUS_VARIANTS[status] ?? 'neutral'}>
|
|
138
|
+
{label}
|
|
139
|
+
</DynamicTableBadge>
|
|
140
|
+
)
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
data: 'carrierCode',
|
|
145
|
+
title: t('shipment_tracking.shipments.fields.carrierCode', 'Carrier'),
|
|
146
|
+
width: 90,
|
|
147
|
+
readOnly: true,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
data: 'vesselName',
|
|
151
|
+
title: t('shipment_tracking.shipments.fields.vesselName', 'Vessel'),
|
|
152
|
+
width: 140,
|
|
153
|
+
readOnly: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
data: 'etdAtd',
|
|
157
|
+
title: t('shipment_tracking.shipments.fields.etdAtd', 'ETD/ATD'),
|
|
158
|
+
width: 150,
|
|
159
|
+
readOnly: true,
|
|
160
|
+
renderer: (_value: unknown, rowData: Record<string, unknown>) => (
|
|
161
|
+
<CombinedTimestampCell
|
|
162
|
+
estimatedTimestamps={rowData.etdTimestamps as TimestampEntry[] | null}
|
|
163
|
+
actualTimestamps={rowData.atdTimestamps as TimestampEntry[] | null}
|
|
164
|
+
label="ETD/ATD"
|
|
165
|
+
format="date"
|
|
166
|
+
/>
|
|
167
|
+
),
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
data: 'etaAta',
|
|
171
|
+
title: t('shipment_tracking.shipments.fields.etaAta', 'ETA/ATA'),
|
|
172
|
+
width: 150,
|
|
173
|
+
readOnly: true,
|
|
174
|
+
renderer: (_value: unknown, rowData: Record<string, unknown>) => (
|
|
175
|
+
<CombinedTimestampCell
|
|
176
|
+
estimatedTimestamps={rowData.etaTimestamps as TimestampEntry[] | null}
|
|
177
|
+
actualTimestamps={rowData.ataTimestamps as TimestampEntry[] | null}
|
|
178
|
+
label="ETA/ATA"
|
|
179
|
+
format="date"
|
|
180
|
+
/>
|
|
181
|
+
),
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
[t],
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
const handleDelete = useCallback(
|
|
188
|
+
async (id: string) => {
|
|
189
|
+
if (!confirm('Are you sure you want to delete this shipment?')) return
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
await apiCallOrThrow('/api/shipment_tracking/shipments', {
|
|
193
|
+
method: 'DELETE',
|
|
194
|
+
body: JSON.stringify({ id }),
|
|
195
|
+
})
|
|
196
|
+
flash('Shipment deleted', 'success')
|
|
197
|
+
refreshRef.current()
|
|
198
|
+
} catch {
|
|
199
|
+
flash('Failed to delete shipment', 'error')
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
[],
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
const handleEdit = useCallback((id: string) => {
|
|
206
|
+
setDrawerMode('edit')
|
|
207
|
+
setSelectedShipmentId(id)
|
|
208
|
+
setEditDrawerOpen(true)
|
|
209
|
+
}, [])
|
|
210
|
+
|
|
211
|
+
const handleView = useCallback((id: string) => {
|
|
212
|
+
setSelectedShipmentId(id)
|
|
213
|
+
setDetailsDrawerOpen(true)
|
|
214
|
+
}, [])
|
|
215
|
+
|
|
216
|
+
const handleRowClick = useCallback((_rowIndex: number, rowData: Record<string, unknown>) => {
|
|
217
|
+
const id = rowData?.id as string | undefined
|
|
218
|
+
if (id) {
|
|
219
|
+
setSelectedShipmentId(id)
|
|
220
|
+
setDetailsDrawerOpen(true)
|
|
221
|
+
}
|
|
222
|
+
}, [])
|
|
223
|
+
|
|
224
|
+
const rowActions = useCallback(
|
|
225
|
+
(rowData: any): ContextMenuAction[] => {
|
|
226
|
+
if (!rowData?.id) return []
|
|
227
|
+
return [
|
|
228
|
+
{ id: 'view', label: t('shipment_tracking.shipments.actions.view', 'View details') },
|
|
229
|
+
{ id: 'edit', label: t('shipment_tracking.shipments.actions.edit', 'Edit shipment') },
|
|
230
|
+
{ id: 'delete', label: t('shipment_tracking.shipments.actions.delete', 'Delete shipment') },
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
[t],
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
const handleRowAction = useCallback(
|
|
237
|
+
(actionId: string, rowData: any) => {
|
|
238
|
+
const id = rowData?.id as string | undefined
|
|
239
|
+
if (!id) return
|
|
240
|
+
if (actionId === 'view') handleView(id)
|
|
241
|
+
else if (actionId === 'edit') handleEdit(id)
|
|
242
|
+
else if (actionId === 'delete') handleDelete(id)
|
|
243
|
+
},
|
|
244
|
+
[handleView, handleEdit, handleDelete],
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
const createButton = useMemo(
|
|
248
|
+
() => (
|
|
249
|
+
<Button
|
|
250
|
+
variant="primary"
|
|
251
|
+
size="sm"
|
|
252
|
+
icon={<Plus className="h-4 w-4" />}
|
|
253
|
+
onClick={() => {
|
|
254
|
+
setDrawerMode('create')
|
|
255
|
+
setSelectedShipmentId(null)
|
|
256
|
+
setEditDrawerOpen(true)
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
{t('shipment_tracking.shipments.create', 'Create Shipment')}
|
|
260
|
+
</Button>
|
|
261
|
+
),
|
|
262
|
+
[t],
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
const table = useDynamicTablePage<ShipmentRow>({
|
|
266
|
+
source: '/api/shipment_tracking/shipments',
|
|
267
|
+
// Saved views. Without this the perspective tab strip auto-hides
|
|
268
|
+
// (hidePerspectiveTabs ?? !hasPerspectives), so users cannot save or
|
|
269
|
+
// switch a view on this list at all.
|
|
270
|
+
perspectives: 'shipment_tracking_shipments',
|
|
271
|
+
columns,
|
|
272
|
+
tableName: t('shipment_tracking.shipments.title', 'Shipments'),
|
|
273
|
+
defaultPageSize: 20,
|
|
274
|
+
mapApiItem: mapItem,
|
|
275
|
+
cellEdit: false,
|
|
276
|
+
tableProps: {
|
|
277
|
+
height: 'fill',
|
|
278
|
+
onRowClick: handleRowClick,
|
|
279
|
+
uiConfig: {
|
|
280
|
+
readOnlyStyle: 'normal',
|
|
281
|
+
hideAddRowButton: true,
|
|
282
|
+
searchBarEnd: createButton,
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
refreshRef.current = table.refresh
|
|
288
|
+
|
|
289
|
+
// Auto-open details drawer when ?shipment= query param is present (e.g., from notifications)
|
|
290
|
+
useEffect(() => {
|
|
291
|
+
const shipmentId = searchParams.get('shipment')
|
|
292
|
+
if (shipmentId) {
|
|
293
|
+
setSelectedShipmentId(shipmentId)
|
|
294
|
+
setDetailsDrawerOpen(true)
|
|
295
|
+
router.replace('/backend/shipment-tracking', { scroll: false })
|
|
296
|
+
}
|
|
297
|
+
}, [searchParams, router])
|
|
298
|
+
|
|
299
|
+
if (table.isLoading) {
|
|
300
|
+
return (
|
|
301
|
+
<Page>
|
|
302
|
+
<PageBody>
|
|
303
|
+
<TableSkeleton rows={10} columns={8} />
|
|
304
|
+
</PageBody>
|
|
305
|
+
</Page>
|
|
306
|
+
)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<Page>
|
|
311
|
+
<PageBody>
|
|
312
|
+
<div className="-mx-4 lg:-mx-6">
|
|
313
|
+
<DynamicTable
|
|
314
|
+
{...table.props}
|
|
315
|
+
striped
|
|
316
|
+
density="md"
|
|
317
|
+
rowActions={rowActions}
|
|
318
|
+
onRowAction={handleRowAction}
|
|
319
|
+
/>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<ShipmentDrawer
|
|
323
|
+
open={editDrawerOpen}
|
|
324
|
+
onOpenChange={setEditDrawerOpen}
|
|
325
|
+
mode={drawerMode}
|
|
326
|
+
shipmentId={selectedShipmentId ?? undefined}
|
|
327
|
+
onSaved={() => {
|
|
328
|
+
table.refresh()
|
|
329
|
+
}}
|
|
330
|
+
/>
|
|
331
|
+
|
|
332
|
+
<ShipmentDetailsDrawer
|
|
333
|
+
open={detailsDrawerOpen}
|
|
334
|
+
onOpenChange={setDetailsDrawerOpen}
|
|
335
|
+
shipmentId={selectedShipmentId}
|
|
336
|
+
/>
|
|
337
|
+
</PageBody>
|
|
338
|
+
</Page>
|
|
339
|
+
)
|
|
340
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Radar } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export const metadata = {
|
|
5
|
+
requireAuth: true,
|
|
6
|
+
requireFeatures: ['shipment_tracking.tracking_jobs.view'],
|
|
7
|
+
pageTitle: 'Tracking Jobs',
|
|
8
|
+
pageTitleKey: 'shipment_tracking.nav.tracking_jobs',
|
|
9
|
+
pageGroup: 'Shipment Tracking',
|
|
10
|
+
pageGroupKey: 'shipment_tracking.nav.group',
|
|
11
|
+
pageContext: 'settings' as const,
|
|
12
|
+
pagePriority: 10,
|
|
13
|
+
pageOrder: 110,
|
|
14
|
+
icon: React.createElement(Radar, { size: 16 }),
|
|
15
|
+
breadcrumb: [{ label: 'Tracking Jobs', labelKey: 'shipment_tracking.nav.tracking_jobs' }],
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
// Thin host over the registered table, wrapped in the split-view host so the
|
|
4
|
+
// user can open another module's table beside it without leaving this page.
|
|
5
|
+
// The table itself lives at
|
|
6
|
+
// `modules/shipment_tracking/tables/tracking_job/table.client.tsx` and is
|
|
7
|
+
// rendered here via the registry, so there is no second implementation.
|
|
8
|
+
//
|
|
9
|
+
// Specs: .ai/specs/2026-08-04-module-table-registry.md
|
|
10
|
+
// .ai/specs/2026-08-17-split-view-workspace-composition.md
|
|
11
|
+
|
|
12
|
+
import { SplitViewHost } from '@freighttech/ui/backend/dynamic-table'
|
|
13
|
+
|
|
14
|
+
export default function TrackingJobsPage() {
|
|
15
|
+
return <SplitViewHost tableId="shipment_tracking.tracking_job" />
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Webhook } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export const metadata = {
|
|
5
|
+
requireAuth: true,
|
|
6
|
+
requireFeatures: ['shipment_tracking.webhooks.view'],
|
|
7
|
+
pageTitle: 'Webhooks',
|
|
8
|
+
pageTitleKey: 'shipment_tracking.nav.webhooks',
|
|
9
|
+
pageGroup: 'Shipment Tracking',
|
|
10
|
+
pageGroupKey: 'shipment_tracking.nav.group',
|
|
11
|
+
pageContext: 'settings' as const,
|
|
12
|
+
pagePriority: 10,
|
|
13
|
+
pageOrder: 130,
|
|
14
|
+
icon: React.createElement(Webhook, { size: 16 }),
|
|
15
|
+
breadcrumb: [{ label: 'Webhooks', labelKey: 'shipment_tracking.nav.webhooks' }],
|
|
16
|
+
}
|