export interface HrKpi {
  id: number;
  company_id: number;
  name: string;
  name_en: string;
  name_ar: string;
  code: string;
  category: string | null;
  weight: number;
  target_value: number | null;
  unit: string | null;
  description: string | null;
  status: string;
  created_at: string;
  updated_at: string;
}

export interface CreateHrKpi {
  name_ar: string;
  name_en?: string;
  category?: string | null;
  weight?: number;
  target_value?: number | null;
  unit?: string | null;
  description?: string | null;
  status?: string;
}

export interface UpdateHrKpi extends Partial<CreateHrKpi> {}

export interface HrReviewTemplate {
  id: number;
  company_id: number;
  name: string;
  name_en: string;
  name_ar: string;
  code: string;
  description: string | null;
  kpi_ids: number[];
  status: string;
  kpis?: HrKpi[];
  created_at: string;
  updated_at: string;
}

export interface CreateHrReviewTemplate {
  name_ar: string;
  name_en?: string;
  description?: string | null;
  kpi_ids?: number[];
  status?: string;
}

export interface UpdateHrReviewTemplate extends Partial<CreateHrReviewTemplate> {}

export interface HrPerformanceReview {
  id: number;
  company_id: number;
  code: string;
  employee_id: number;
  reviewer_id: number | null;
  template_id: number | null;
  review_period_start: string;
  review_period_end: string;
  overall_rating: number | null;
  status: string;
  comments: string | null;
  employee_comments: string | null;
  scores?: HrReviewScore[];
  employee?: any;
  reviewer?: any;
  template?: any;
  created_at: string;
  updated_at: string;
}

export interface CreateHrPerformanceReview {
  employee_id: number;
  reviewer_id?: number | null;
  template_id?: number | null;
  review_period_start: string;
  review_period_end: string;
  comments?: string | null;
}

export interface UpdateHrPerformanceReview extends Partial<CreateHrPerformanceReview> {}

export interface HrReviewScore {
  id: number;
  review_id: number;
  kpi_id: number;
  score: number;
  weight: number;
  weighted_score: number;
  comments: string | null;
  kpi?: HrKpi;
}
