feat(seed): operations_chief and dispatcher freight positions

Operations Chief gets the full freight permission catalog (all CRUD).
Dispatcher gets warehouse floor operations — receive/GRN, load/unload,
inspect, dispatch, gate, release/deliver, interchange docs, fee
invoices, mile truck assignment — with allocation & fee rules view-only.
This commit is contained in:
Hagernesh
2026-07-22 07:25:52 +00:00
parent 19906b273e
commit 64b205a71e
2 changed files with 44 additions and 0 deletions

View File

@@ -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] },
];

View File

@@ -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. */