Merge pull request #1083 from Tria-plc/freight_feature/usermanagement

Freight feature/usermanagement
This commit is contained in:
marshal
2026-08-03 01:40:20 +03:00
committed by GitHub
60 changed files with 2722 additions and 218 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 {

View File

@@ -92,6 +92,13 @@ export interface NotificationRecipients {
organizationId?: string;
/** Backoffice: every current employee across all organizations. */
allBackoffice?: boolean;
/**
* Backoffice: current employees (any org) who hold ANY of these permission
* keys — e.g. notify only marketing, not every employee. Super/org admins
* are not implicitly included; add `allBackoffice`/explicit userIds too if
* admins should also see it.
*/
permissionKeys?: string[];
}
/** Input any subsystem passes to `NotificationInboxService.notify(...)`. */