import { Role } from '../../../src/generated/prisma/enums.js';

export const E2E_SEED_PASSWORD = 'Seed@1234';

export const E2E_ROLE_LIST = [
  Role.SYSTEM_ADMIN,
  Role.HOSPITAL_ADMIN,
  Role.DIRECTOR,
  Role.LEADER,
  Role.DOCTOR,
  Role.ENGINEER,
] as const;

export type E2ERole = (typeof E2E_ROLE_LIST)[number];

export interface E2ESeedCredential {
  role: E2ERole;
  phone: string;
  password: string;
  openId: string;
  hospitalId?: number;
}

export const E2E_SEED_CREDENTIALS: Record<E2ERole, E2ESeedCredential> = {
  [Role.SYSTEM_ADMIN]: {
    role: Role.SYSTEM_ADMIN,
    phone: '13800001000',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-system-admin-openid',
  },
  [Role.HOSPITAL_ADMIN]: {
    role: Role.HOSPITAL_ADMIN,
    phone: '13800001001',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-hospital-admin-a-openid',
    hospitalId: 1,
  },
  [Role.DIRECTOR]: {
    role: Role.DIRECTOR,
    phone: '13800001002',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-director-a-openid',
    hospitalId: 1,
  },
  [Role.LEADER]: {
    role: Role.LEADER,
    phone: '13800001003',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-leader-a-openid',
    hospitalId: 1,
  },
  [Role.DOCTOR]: {
    role: Role.DOCTOR,
    phone: '13800001004',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-doctor-a-openid',
    hospitalId: 1,
  },
  [Role.ENGINEER]: {
    role: Role.ENGINEER,
    phone: '13800001005',
    password: E2E_SEED_PASSWORD,
    openId: 'seed-engineer-a-openid',
    hospitalId: 1,
  },
};
