import {
  PASSENGER_PERMISSIONS,
  PASSENGER_PERMISSION_KEYS,
  ROLE_PERMISSION_PRESETS,
} from './passenger-permissions.registry';

export type PassengerSeedRole = {
  key: string;
  name: { en: string };
  permissionKeys: string[];
};

export const EDR_PASSENGER_APPLICATION = {
  id: '921cd1a4-98a7-4601-bfb1-6fe19518be52',
  key: 'edr_passenger_app',
  name: {
    am: 'EDR Passenger App',
    en: 'EDR Passenger App',
  },
} as const;

export const EDR_PASSENGER_PERMISSIONS = [...PASSENGER_PERMISSIONS];

export { PASSENGER_PERMISSION_KEYS } from './passenger-permissions.registry';

export const EDR_PASSENGER_ROLES: PassengerSeedRole[] = [
  {
    key: 'edr_passenger_backoffice_admin',
    name: { en: 'EDR Passenger Backoffice Admin' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.backofficeAdmin],
  },
  {
    key: 'edr_passenger_station_master',
    name: { en: 'EDR Passenger Station Master' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.stationMaster],
  },
  {
    key: 'edr_passenger_ticket_officer',
    name: { en: 'EDR Passenger Ticket Officer' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.ticketOfficer],
  },
  {
    key: 'edr_passenger_agent',
    name: { en: 'EDR Passenger Agent' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.agent],
  },
  {
    key: 'edr_passenger_backoffice_staff',
    name: { en: 'EDR Passenger Backoffice Staff' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.backofficeStaff],
  },
  {
    key: 'edr_passenger_finance',
    name: { en: 'EDR Passenger Finance' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.finance],
  },
  {
    key: 'edr_passenger_operations_manager',
    name: { en: 'EDR Passenger Operations Manager' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.operationsManager],
  },
  {
    key: 'edr_passenger_marketing_manager',
    name: { en: 'EDR Passenger Marketing Manager' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.marketingManager],
  },
  {
    key: 'edr_passenger_finance_manager',
    name: { en: 'EDR Passenger Finance Manager' },
    permissionKeys: [...ROLE_PERMISSION_PRESETS.financeManager],
  },
];
