// Type definitions for the application

export interface Voucher {
  id: string
  serialNumber: string
  pin: string
  price: number
  used: boolean
  purchaseDate: string
  email: string
  userId?: string
}

export interface StudentApplication {
  id: string
  userId: string
  voucherSerialNumber: string
  submitted: boolean
  submittedAt?: string
  studentType: "local" | "foreign"

  // Application sections
  biodata: BiodataSection
  address: AddressSection
  education: EducationSection
  program: ProgramSection
  guardian: GuardianSection
  scholarship: ScholarshipSection
  referee: RefereeSection
  uploads: UploadsSection
  declaration: DeclarationSection
  foreignStudent?: ForeignStudentSection
}

export interface BiodataSection {
  firstName: string
  middleName?: string
  lastName: string
  dateOfBirth: string
  gender: string
  nationality: string
  stateOfOrigin: string
  localGovernment?: string
  phoneNumber: string
  email: string
  maritalStatus?: string
  religion?: string
  passportNumber?: string
  passportExpiryDate?: string
  countryOfBirth?: string
}

export interface AddressSection {
  permanentAddress: string
  permanentCity: string
  permanentState: string
  permanentCountry: string
  permanentPostalCode?: string
  currentAddress?: string
  currentCity?: string
  currentState?: string
  currentCountry?: string
  currentPostalCode?: string
  sameAsPermanent: boolean
}

export interface EducationEntry {
  id: string
  institution: string
  qualification: string
  grade?: string
  yearCompleted: string
  subjects?: string
}

export interface EducationSection {
  entries: EducationEntry[]
}

export interface ProgramSection {
  firstChoice: string
  secondChoice?: string
  thirdChoice?: string
  studyMode: string
  entryLevel: string
  previousApplication?: string
  jamb?: string
  postUtme?: string
  personalStatement: string
  careerGoals?: string
}

export interface GuardianSection {
  guardianName: string
  relationship: string
  occupation?: string
  phoneNumber: string
  email?: string
  address: string
  city?: string
  state?: string
  country?: string
  emergencyName: string
  emergencyRelationship?: string
  emergencyPhone: string
  emergencyAddress?: string
}

export interface ScholarshipSection {
  applyingForScholarship: boolean
  scholarshipType?: string
  financialNeed?: string
  familyIncome?: string
  achievements?: string
  extracurricular?: string
  communityService?: string
  workExperience?: string
  personalCircumstances?: string
  otherScholarships?: string
}

export interface RefereeEntry {
  id: string
  name: string
  title?: string
  organization: string
  relationship: string
  phoneNumber: string
  email: string
  address?: string
  yearsKnown?: string
}

export interface RefereeSection {
  referees: RefereeEntry[]
}

export interface UploadedFile {
  id: string
  name: string
  size: number
  type: string
  category: string
  uploaded: boolean
  url?: string
}

export interface UploadsSection {
  files: UploadedFile[]
}

export interface DeclarationSection {
  truthfulnessDeclaration: boolean
  accuracyDeclaration: boolean
  consequencesDeclaration: boolean
  updatesDeclaration: boolean
  termsDeclaration: boolean
  signature: string
  date: string
}

export interface ApiResponse<T = any> {
  success: boolean
  data?: T
  error?: string
  message?: string
}

export interface ForeignStudentSection {
  passportNumber: string
  passportExpiryDate: string
  visaStatus: string
  visaType?: string
  visaExpiryDate?: string
  countryOfBirth: string
  previousStudyInNigeria: boolean
  previousInstitution?: string
  englishProficiency: string
  englishTestScore?: string
  englishTestDate?: string
  sponsorshipType: string
  sponsorName?: string
  sponsorRelationship?: string
  sponsorAddress?: string
  sponsorPhone?: string
  sponsorEmail?: string
  financialSupport: string
  bankStatement: boolean
  medicalCertificate: boolean
  criminalRecord: boolean
}
