fix four digit

This commit is contained in:
natib21
2026-07-17 09:47:37 +00:00
parent 1abf71306e
commit 84d5add58e

View File

@@ -126,20 +126,22 @@ const WAGON_STATUS_OPTIONS = [
/** /**
* EDR run-number pairs, keyed by the odd EXPORT run (Ethiopia → Djibouti). The * 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 * even IMPORT run (Djibouti → Ethiopia) is fixed by the export run, so choosing
* an export number fully determines the import one. Listed explicitly rather * an export number fully determines the import one.
* than computed as export+1, so a pair that ever breaks that convention stays *
* correct here. * 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<string, string> = { const TRAIN_RUN_PAIRS: Record<string, string> = {
"8001": "8002", "8001": "8002",
"81001": "81002", "8101": "8102",
"82001": "82002", "8201": "8202",
"83001": "83002", "8301": "8302",
"84001": "84002", "8401": "8402",
"85001": "85002", "8501": "8502",
"86001": "86002", "8601": "8602",
"87001": "87002", "8701": "8702",
"88001": "88002", "8801": "8802",
"8901": "8902", "8901": "8902",
"9001": "9002", "9001": "9002",
}; };
@@ -294,12 +296,23 @@ export const FLEET_RESOURCES: FleetResourceConfig[] = [
], ],
cardTitleKey: "wagonNumber", cardTitleKey: "wagonNumber",
cardSubtitleKey: "currentYard", cardSubtitleKey: "currentYard",
searchKeys: ["wagonNumber", "wagonTypeId", "trainId", "status", "currentYardId"], searchKeys: [
"wagonNumber",
"wagonTypeId",
"trainId",
"exportTrainNumber",
"importTrainNumber",
"status",
"currentYardId",
],
columns: [ columns: [
// Tare weight and payload capacity are not wagon columns — they belong to the // Tare weight and payload capacity are not wagon columns — they belong to the
// wagon type and are shown through it (see WagonsCrudPage in FleetCrudPages). // wagon type and are shown through it (see WagonsCrudPage in FleetCrudPages).
{ id: "wagonNumber", header: "Number", accessorKey: "wagonNumber", format: "code" }, { id: "wagonNumber", header: "Number", accessorKey: "wagonNumber", format: "code" },
{ id: "wagonTypeId", header: "Type", accessorKey: "wagonTypeId", format: "entityLabel" }, { 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: "currentYard", header: "Current Yard", accessorKey: "currentYard", format: "entityLabel" },
{ id: "status", header: "Status", accessorKey: "status", format: "statusBadge" }, { id: "status", header: "Status", accessorKey: "status", format: "statusBadge" },
], ],