export type AppRole = "admin" | "donor";
export type Gender = "male" | "female";
export type OrphanStatus = "available" | "partially_covered" | "fully_covered" | "paused" | "archived";
export type SponsorshipStatus = "pending" | "active" | "paused" | "ended" | "rejected";
export type PaymentStatus = "unpaid" | "partial" | "paid";
export type TransferStatus = "pending" | "paid";
export type OrphanDocumentType = "orphan_national_id" | "father_death_certificate" | "guardian_national_id";

export type Profile = {
  id: string;
  role: AppRole;
  full_name: string;
  phone: string | null;
  login_username: string | null;
  must_change_password: boolean;
  deleted_at: string | null;
  is_active: boolean;
  last_activity_at: string | null;
  created_at: string;
  updated_at: string;
};

export type OrphanRecord = {
  id: string;
  case_number: string;
  full_name: string | null;
  date_of_birth: string | null;
  gender: Gender | null;
  sponsor_notes: string | null;
  private_notes: string | null;
  guardian_name: string | null;
  guardian_phone: string | null;
  guardian_relationship: string | null;
  address: string | null;
  bank_name: string | null;
  bank_account_name: string | null;
  bank_account_number: string | null;
  monthly_need: number | null;
  covered_amount: number;
  status: OrphanStatus;
  created_at: string;
  updated_at: string;
};

export type SponsorRecord = {
  id: string;
  full_name: string;
  phone: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
};

export type SponsorshipRecord = {
  id: string;
  donor_id: string;
  orphan_id: string;
  monthly_amount: number;
  status: SponsorshipStatus;
  start_date: string;
  end_date: string | null;
  stop_reason: string | null;
  notes: string | null;
  created_at: string;
  updated_at: string;
  donor?: { full_name: string } | null;
  orphan?: { case_number: string; full_name: string } | null;
};
