export interface HrJobOpening {
  id: number;
  company_id: number;
  code: string;
  title: string;
  title_en: string;
  title_ar: string;
  department_id: number | null;
  position_id: number | null;
  branch_id: number | null;
  vacancies: number;
  description: string | null;
  requirements: string | null;
  salary_from: number | null;
  salary_to: number | null;
  opening_date: string;
  closing_date: string | null;
  status: string;
  department?: any;
  position?: any;
  applications_count?: number;
  created_at: string;
  updated_at: string;
}

export interface CreateHrJobOpening {
  title_ar: string;
  title_en?: string;
  department_id?: number | null;
  position_id?: number | null;
  branch_id?: number | null;
  vacancies?: number;
  description?: string | null;
  requirements?: string | null;
  salary_from?: number | null;
  salary_to?: number | null;
  opening_date?: string;
  closing_date?: string | null;
  status?: string;
}

export interface UpdateHrJobOpening extends Partial<CreateHrJobOpening> {}

export interface HrCandidate {
  id: number;
  company_id: number;
  code: string;
  first_name: string;
  first_name_en: string;
  first_name_ar: string;
  last_name: string;
  last_name_en: string;
  last_name_ar: string;
  full_name: string;
  email: string | null;
  phone: string | null;
  experience_years: number | null;
  current_salary: number | null;
  expected_salary: number | null;
  resume_url: string | null;
  source: string | null;
  notes: string | null;
  status: string;
  applications?: HrApplication[];
  created_at: string;
  updated_at: string;
}

export interface CreateHrCandidate {
  first_name_ar: string;
  first_name_en?: string;
  last_name_ar: string;
  last_name_en?: string;
  email?: string | null;
  phone?: string | null;
  experience_years?: number | null;
  current_salary?: number | null;
  expected_salary?: number | null;
  source?: string | null;
  notes?: string | null;
  status?: string;
}

export interface UpdateHrCandidate extends Partial<CreateHrCandidate> {}

export interface HrApplication {
  id: number;
  company_id: number;
  candidate_id: number;
  job_opening_id: number;
  status: string;
  stage: string;
  rating: number | null;
  interview_date: string | null;
  notes: string | null;
  candidate?: HrCandidate;
  job_opening?: HrJobOpening;
  created_at: string;
  updated_at: string;
}

export interface CreateHrApplication {
  candidate_id: number;
  job_opening_id: number;
  status?: string;
  stage?: string;
  notes?: string | null;
}

export interface UpdateHrApplication extends Partial<CreateHrApplication> {}

export interface HrOffer {
  id: number;
  company_id: number;
  code: string;
  application_id: number;
  candidate_id: number;
  position_id: number | null;
  department_id: number | null;
  offered_salary: number;
  start_date: string;
  expiry_date: string | null;
  status: string;
  terms: string | null;
  notes: string | null;
  application?: HrApplication;
  candidate?: HrCandidate;
  created_at: string;
  updated_at: string;
}

export interface CreateHrOffer {
  application_id: number;
  candidate_id: number;
  position_id?: number | null;
  department_id?: number | null;
  offered_salary: number;
  start_date: string;
  expiry_date?: string | null;
  terms?: string | null;
  notes?: string | null;
}

export interface UpdateHrOffer extends Partial<CreateHrOffer> {}
