import { UniversalOption } from "@/components/common/CustomPersonalDetails";

// ─── API shape ────────────────────────────────────────────────────────────────
export interface EducationApiItem {
  id: number;
  degree_name: string;
  institute_name: string;
  country: string;
  passing_year: string;
  major: string;
  result: string;
}

// ─── Mapped shape — extends UniversalOption so CustomTextbox is happy ─────────
export interface MappedEducation extends UniversalOption {
  id: number;
  label: string; // required by UniversalOption (use degree_name)
  degree_name: string;
  institute_name: string;
  location: string;
  passing_year: string;
  major: string;
  result: string;
  end_date: Date;
  start_date: Date;
  is_ongoing: boolean;
  country: string;
  city: string;
}

// ─── API request body ─────────────────────────────────────────────────────────
export interface EducationBody {
  id?: number;
  degree_name: string;
  institute_name: string;
  passing_year: string;
  major: string;
  result: string;
  end_date: Date;
  start_date: Date;
  is_ongoing: boolean;
  country: string;
  city: string;
}

// ─── RHF form values (matches CustomDialog field shape) ───────────────────────
export interface EducationFormValues {
  degree_name: string;
  institute_name: string;
  passing_year: string;
  major: string;
  result: string;
  end_date: Date;
  start_date: Date;
  is_ongoing: boolean;
  country: string;
  city: string;
}

// ─── Dialog wrapper (matches useFieldArray name "education") ──────────────────
export interface EducationDialogValues {
  education: EducationFormValues[];
}
