interface LocaleText {
  en?: string;
  am?: string;
}

interface AuthRole {
  id?: string;
  key?: string;
}

interface AuthPermission {
  id?: string;
  key?: string;
}

interface AuthEmployeePosition {
  id?: string;
  employeePositionId?: string;
  name?: LocaleText;
  key?: string;
  isDelegate?: boolean;
  parentPositionId?: string | null;
  permissions?: AuthPermission[];
}

interface AuthEmployeeRecord {
  id?: string;
  organizationId?: string;
  unitId?: string;
  name?: LocaleText;
  positions?: AuthEmployeePosition[];
}

export interface AuthUser {
  id?: string;
  email?: string;
  username?: string;
  phoneNumber?: string;
  name?: LocaleText;
  roles?: AuthRole[];
  permissions?: AuthPermission[];
  /** Flat keys from GET /api/me (roles + position permissions). */
  permissionKeys?: string[];
  isSuperAdmin?: boolean;
  employee?: AuthEmployeeRecord[];
  hasSetPassword?: boolean;
  status?: string;
}

export interface AuthTokens {
  token: string;
  refreshToken: string;
}

export interface LoginResponse extends Partial<AuthTokens> {
  mfaRequired?: boolean;
}

// Additional types for Matrix form test
export interface User {
  id: string;
  name: string;
  role: "ADMIN" | "MANAGER" | "CHIEF_EXECUTIVE";
}
