feat(wagons): audited maintenance/availability toggle

This commit is contained in:
Marshal
2026-08-07 12:10:43 +00:00
parent 756325c814
commit 70215a9f37
12 changed files with 419 additions and 31 deletions

View File

@@ -644,6 +644,13 @@ export const FLEET_RAIL_PERMISSIONS: FreightPermissionSeed[] = [
"edr_freight_app:wagons:hard_delete",
"Permanently delete wagon",
),
// Maintenance ⇄ availability flip on the wagons desk — its own key so
// operations/OCC can flip readiness without holding full wagon edit.
perm(
"e1b00001-0001-4000-8000-00000000000c",
"edr_freight_app:wagons:status_toggle",
"Flip wagon between maintenance and available",
),
perm(
"e1c00001-0001-4000-8000-000000000001",
"edr_freight_app:trains:view",
@@ -1511,6 +1518,8 @@ export const FREIGHT_PERMS = {
transferView: "edr_freight_app:wagons:transfer_view",
/** Withdraw a request that has not moved any wagon yet. */
transferCancel: "edr_freight_app:wagons:transfer_cancel",
/** Maintenance ⇄ availability flip on the wagons desk (audited). */
statusToggle: "edr_freight_app:wagons:status_toggle",
/** End a request short — anyone who can fulfil may also do this. */
transferCloseShort: "edr_freight_app:wagons:transfer_close_short",
// Admin: read every staffer's transfer history. Without it, a user only sees
@@ -1777,6 +1786,7 @@ const FLEET_GRANULAR_KEYS: string[] = [
FREIGHT_PERMS.wagons.create,
FREIGHT_PERMS.wagons.update,
FREIGHT_PERMS.wagons.delete,
FREIGHT_PERMS.wagons.statusToggle,
FREIGHT_PERMS.trains.view,
FREIGHT_PERMS.trains.create,
FREIGHT_PERMS.trains.update,