export type AdminUserRead = {
  id: string
  email: string | null
  phone: string | null
  full_name_ar: string | null
  full_name_en: string | null
  user_type: string
  status: string
  created_at: string
  updated_at: string
  must_change_password: boolean
  is_admin_approved: boolean
}

export type PendingApprovalUser = {
  id: string
  email: string | null
  phone: string | null
  user_type: string
  status: string
  created_at: string | null
}

export type AdminRoleRead = {
  id: string
  code: string
  name_ar: string
  name_en: string | null
  description?: string | null
  is_system?: boolean
}

export type UserCreatePayload = {
  email?: string | null
  phone?: string | null
  full_name_ar?: string | null
  role_ids: string[]
  auto_approve: boolean
  password?: string | null
}

export type UserUpdatePayload = {
  email?: string | null
  phone?: string | null
  full_name_ar?: string | null
  status?: string
}

export type RegeneratePasswordResponse = {
  temp_password: string
  message: string
}

export type CreateUserResponse = {
  user_id: string
  temp_password?: string
  message?: string
}

export type UserWhitelistIpRead = {
  user_id: string
  ip_addresses: string[]
}

export type IpBlacklistRead = {
  id: string
  ip_address: string
  device_info: Record<string, unknown> | null
  reason: string | null
  blocked_by: string | null
  blocked_at: string
  expires_at: string | null
  created_at: string
  is_active: boolean
}

export type IpBlacklistCreatePayload = {
  ip_address: string
  reason: string
  device_info?: Record<string, unknown> | null
  expires_at?: string | null
}

export type IpBlacklistUpdatePayload = {
  reason?: string | null
  device_info?: Record<string, unknown> | null
  expires_at?: string | null
}
