feat: ( users ) seed ticket officer and director users

This commit is contained in:
Abubeker Yasin
2026-07-19 18:57:31 +03:00
parent 7792c56efd
commit 5317ca0d19
3 changed files with 16 additions and 0 deletions

View File

@@ -69,4 +69,9 @@ export const EDR_PASSENGER_ROLES: PassengerSeedRole[] = [
name: { en: 'EDR Passenger Finance Manager' },
permissionKeys: [...ROLE_PERMISSION_PRESETS.financeManager],
},
{
key: 'edr_passenger_director',
name: { en: 'EDR Passenger Director' },
permissionKeys: [...ROLE_PERMISSION_PRESETS.director],
},
];

View File

@@ -166,9 +166,18 @@ export const PASSENGER_PERMS = {
admin: 'edr_passenger_app:admin',
} as const;
// Every view-only permission (`:view` and `:view_all`), derived from the registry
// so newly-added view permissions are automatically included.
export const PASSENGER_VIEW_PERMISSION_KEYS = PASSENGER_PERMISSION_KEYS.filter(
(key) => key.endsWith(':view') || key.endsWith(':view_all'),
);
export const ROLE_PERMISSION_PRESETS = {
backofficeAdmin: [...PASSENGER_PERMISSION_KEYS],
// Director: read-only across the whole app — can view every resource, cannot manage/mutate anything.
director: [...PASSENGER_VIEW_PERMISSION_KEYS],
stationMaster: [
PASSENGER_PERMS.bookings.view,
PASSENGER_PERMS.bookings.manage,

View File

@@ -20,6 +20,8 @@ const STAFF_USERS = [
{ email: 'passenger.staff@edr.local', username: 'passenger_staff', roleKey: 'edr_passenger_backoffice_staff' },
{ email: 'passenger.agent@edr.local', username: 'passenger_agent', roleKey: 'edr_passenger_agent' },
{ email: 'passenger.finance@edr.local', username: 'passenger_finance', roleKey: 'edr_passenger_finance' },
{ email: 'passenger.director@edr.local', username: 'passenger_director', roleKey: 'edr_passenger_director' },
{ email: 'passenger.ticketofficer@edr.local', username: 'passenger_ticket_officer', roleKey: 'edr_passenger_ticket_officer' },
] as const;
@Injectable()