export interface SessionResponse {
  success: boolean
  data: AuthUser
  active_role: AuthRole | null
  can_switch_role: boolean
  redirect_path: string
}

export interface LoginCredentials {
  email: string
  password: string
  remember?: boolean
}

export interface AuthRole {
  id: string
  name: string
  fullname: string | null
  guard_name: string
  context: string
}

export interface AuthPermission {
  id: string
  name: string
  guard_name: string
  route_name: string | null
}

export interface AuthUser {
  id: string
  name: string
  email: string
  ic_number: string | null
  position: string | null
  phone_number: string | null
  image_url: string | null
  member_number: number | null
  member_type: string | null
  status: string
  gender: string | null
  marriage_status: string | null
  join_date: string | null
  birth_date: string | null
  birth_place: string | null
  roles?: Array<AuthRole & { permissions?: AuthPermission[] }>
}

export interface LoginSessionData {
  user: AuthUser
  token_type: string
  expires_at: string
}

export interface LoginVerificationRequiredData {
  email: string
  requires_email_verification: true
}

export interface LoginResponse {
  success: boolean
  message: string
  data: LoginSessionData | LoginVerificationRequiredData
  active_role?: AuthRole | null
  can_switch_role?: boolean
  redirect_path?: string
}

export interface SwitchRoleResponse extends SessionResponse {
  message: string
}

export interface RegisterCredentials {
  name: string
  email: string
  ic_number: string
  password: string
  password_confirmation: string
}

export interface RegisterResponse {
  success: boolean
  message: string
  data: {
    email: string
    requires_email_verification: boolean
  }
}

export interface VerifyEmailPayload {
  email: string
  otp: string
}

export type VerifyEmailResponse = LoginResponse

export interface ResendVerificationResponse {
  success: boolean
  message: string
}

export interface ForgotPasswordPayload {
  email: string
}

export interface ForgotPasswordResponse {
  success: boolean
  message: string
}

export interface ResetPasswordPayload {
  email: string
  otp: string
  password: string
  password_confirmation: string
}

export interface ResetPasswordResponse {
  success: boolean
  message: string
}
