diff --git a/apps/edr-freight-api/src/seed/edr-freight.seed.ts b/apps/edr-freight-api/src/seed/edr-freight.seed.ts index e6ea89fbe..7ebcfb89c 100644 --- a/apps/edr-freight-api/src/seed/edr-freight.seed.ts +++ b/apps/edr-freight-api/src/seed/edr-freight.seed.ts @@ -304,4 +304,6 @@ export const EDR_FREIGHT_POSITIONS: FreightSeedPosition[] = [ { key: "djibouti_gl", name: { en: "Djibouti GL" }, rank: 3, permissionKeys: [...POSITION_PERMISSION_PRESETS.djiboutiGl] }, { key: "marketer", name: { en: "Marketer" }, rank: 4, permissionKeys: [...POSITION_PERMISSION_PRESETS.marketer] }, { key: "operation", name: { en: "Operation" }, rank: 4, permissionKeys: [...POSITION_PERMISSION_PRESETS.operation] }, + { key: "operations_chief", name: { en: "Operations Chief" }, rank: 2, permissionKeys: [...POSITION_PERMISSION_PRESETS.operationsChief] }, + { key: "dispatcher", name: { en: "Dispatcher" }, rank: 4, permissionKeys: [...POSITION_PERMISSION_PRESETS.dispatcher] }, ]; diff --git a/apps/edr-freight-api/src/seed/freight-permissions.registry.ts b/apps/edr-freight-api/src/seed/freight-permissions.registry.ts index 396ac95db..1f82f6e93 100644 --- a/apps/edr-freight-api/src/seed/freight-permissions.registry.ts +++ b/apps/edr-freight-api/src/seed/freight-permissions.registry.ts @@ -804,6 +804,48 @@ export const POSITION_PERMISSION_PRESETS = { ...ROLE_PERMISSION_PRESETS.operationsOfficer, FREIGHT_PERMS.allocation.manage, ]), + // Operations Chief: full operational authority — the entire freight + // permission catalog (all CRUD across bookings, contracts, scheduling, + // fleet, warehouse, mile, finance, settings, staff). + operationsChief: dedupe([...BOOKING_RULE_ENGINE_PERMISSION_KEYS]), + // Dispatcher: warehouse floor operations — receive/GRN, move, load/unload, + // inspect, dispatch, gate, release/deliver, interchange docs, fee invoices, + // plus truck dispatch on the mile legs and read-only operational context. + // Allocation & fee rules are VIEW-ONLY — never create/update/delete. + dispatcher: dedupe([ + FREIGHT_PERMS.warehouseDashboard.view, + FREIGHT_PERMS.warehouses.view, + FREIGHT_PERMS.warehouseYards.view, + FREIGHT_PERMS.warehouseZones.view, + FREIGHT_PERMS.warehouseInventory.view, + FREIGHT_PERMS.warehouseInventory.receive, + FREIGHT_PERMS.warehouseInventory.move, + FREIGHT_PERMS.warehouseInventory.load, + FREIGHT_PERMS.warehouseInventory.unload, + FREIGHT_PERMS.warehouseInventory.dispatch, + FREIGHT_PERMS.warehouseInventory.gatePass, + FREIGHT_PERMS.warehouseInventory.release, + FREIGHT_PERMS.warehouseInventory.deliver, + FREIGHT_PERMS.warehouseInventory.inspect, + FREIGHT_PERMS.warehouseInspectionReports.view, + FREIGHT_PERMS.warehouseInspectionReports.create, + FREIGHT_PERMS.warehouseInspectionReports.update, + FREIGHT_PERMS.interchangeDocuments.view, + FREIGHT_PERMS.interchangeDocuments.generate, + FREIGHT_PERMS.interchangeDocuments.acknowledge, + FREIGHT_PERMS.warehouseFeeInvoices.view, + FREIGHT_PERMS.warehouseFeeInvoices.generate, + // View-only on the rules that govern allocation and fees. + FREIGHT_PERMS.warehouseAllocationRules.view, + FREIGHT_PERMS.warehouseFeeRules.view, + // Truck dispatch on the EDR mile legs + operational context. + FREIGHT_PERMS.firstMile.view, + FREIGHT_PERMS.firstMile.assignVehicles, + FREIGHT_PERMS.lastMile.view, + FREIGHT_PERMS.lastMile.assignVehicles, + FREIGHT_PERMS.trainScheduling.view, + FREIGHT_PERMS.bookings.operations, + ]), } as const; /** Derive the module bucket from the resource segment of a permission key. */