per-user trade-direction access scope

This commit is contained in:
Marshal
2026-08-02 22:29:58 +00:00
parent c055abe8c1
commit f4fd469643
47 changed files with 1451 additions and 107 deletions

View File

@@ -303,6 +303,22 @@ export const TRADE_DIRECTION_LABELS: Record<ScheduleTradeDirection, string> = {
DOMESTIC: "Intercity",
};
/** All trade directions a backoffice user can be scoped to. */
export const ALL_TRADE_DIRECTIONS: ScheduleTradeDirection[] = [
"IMPORT",
"EXPORT",
"DOMESTIC",
];
/**
* Per-user backoffice data scope: which trade directions the user may see.
* A missing config (or all three directions) means unrestricted.
*/
export interface UserTradeAccessDto {
userId: string;
directions: ScheduleTradeDirection[];
}
export enum TrainCheckpointKind {
Departed = "DEPARTED",
Passed = "PASSED",
@@ -951,6 +967,16 @@ export interface BookingReferenceYard {
name: string;
code: string;
country: string;
/**
* Which freight types this yard can take, per side of the trip. False for a
* yard with no facility record at all. Forms use these to offer a yard as an
* origin or destination only where the selected cargo can actually be
* handled.
*/
hasContainerFacilityOrigin: boolean;
hasBulkFacilityOrigin: boolean;
hasContainerFacilityDestination: boolean;
hasBulkFacilityDestination: boolean;
}
export interface BookingReferenceContainerType {