diff --git a/apps/edr-freight-web/backoffice/src/pages/fleet/config/resources.ts b/apps/edr-freight-web/backoffice/src/pages/fleet/config/resources.ts index baeaa99a5..7a473fdb1 100644 --- a/apps/edr-freight-web/backoffice/src/pages/fleet/config/resources.ts +++ b/apps/edr-freight-web/backoffice/src/pages/fleet/config/resources.ts @@ -126,20 +126,22 @@ const WAGON_STATUS_OPTIONS = [ /** * EDR run-number pairs, keyed by the odd EXPORT run (Ethiopia → Djibouti). The * even IMPORT run (Djibouti → Ethiopia) is fixed by the export run, so choosing - * an export number fully determines the import one. Listed explicitly rather - * than computed as export+1, so a pair that ever breaks that convention stays - * correct here. + * an export number fully determines the import one. + * + * Run numbers are always 4 digits (8401, never 84001). Pairs are listed out + * rather than computed from the 8001/+100/+1 pattern, so a run that ever breaks + * the convention stays correct here. */ const TRAIN_RUN_PAIRS: Record = { "8001": "8002", - "81001": "81002", - "82001": "82002", - "83001": "83002", - "84001": "84002", - "85001": "85002", - "86001": "86002", - "87001": "87002", - "88001": "88002", + "8101": "8102", + "8201": "8202", + "8301": "8302", + "8401": "8402", + "8501": "8502", + "8601": "8602", + "8701": "8702", + "8801": "8802", "8901": "8902", "9001": "9002", }; @@ -294,12 +296,23 @@ export const FLEET_RESOURCES: FleetResourceConfig[] = [ ], cardTitleKey: "wagonNumber", cardSubtitleKey: "currentYard", - searchKeys: ["wagonNumber", "wagonTypeId", "trainId", "status", "currentYardId"], + searchKeys: [ + "wagonNumber", + "wagonTypeId", + "trainId", + "exportTrainNumber", + "importTrainNumber", + "status", + "currentYardId", + ], columns: [ // Tare weight and payload capacity are not wagon columns — they belong to the // wagon type and are shown through it (see WagonsCrudPage in FleetCrudPages). { id: "wagonNumber", header: "Number", accessorKey: "wagonNumber", format: "code" }, { id: "wagonTypeId", header: "Type", accessorKey: "wagonTypeId", format: "entityLabel" }, + // Unset on a wagon that is not on a run — renders as a dimmed dash. + { id: "exportTrainNumber", header: "Export train no.", accessorKey: "exportTrainNumber", format: "code" }, + { id: "importTrainNumber", header: "Import train no.", accessorKey: "importTrainNumber", format: "code" }, { id: "currentYard", header: "Current Yard", accessorKey: "currentYard", format: "entityLabel" }, { id: "status", header: "Status", accessorKey: "status", format: "statusBadge" }, ],