export type TrainingPolicyStatus = 'active' | 'inactive';

export interface TrainingPolicy {
  id: number;
  organization_id: string;
  year: number;
  total_hours: number;
  k_hours: number;
  s_hours: number;
  a_hours: number;
  is_active: boolean;
  status: TrainingPolicyStatus;
  display_name: string;
  updated_by_name: string | null;
  created_at: string;
  updated_at: string;
}

export interface TrainingPolicyFilters {
  page?: number;
  limit?: number;
  search?: string;
  status?: string;
  sort?: string;
}

export interface TrainingPoliciesResponse {
  success: boolean;
  time: string;
  message: string;
  total_training_policies: number;
  offset: number;
  limit: number;
  active_policy: TrainingPolicy | null;
  policies: TrainingPolicy[];
}

export interface TrainingPolicyByIdResponse {
  success: boolean;
  time: string;
  message: string;
  policy: TrainingPolicy;
}

export interface TrainingPolicyMutationPayload {
  year: number;
  totalHours: number;
  kHours: number;
  sHours: number;
  aHours: number;
  isActive: boolean;
}

export interface TrainingPolicyHistoryEntry {
  id: number;
  action: string;
  details: string;
  user_name: string | null;
  created_at: string;
  old_value: Record<string, unknown> | null;
  new_value: Record<string, unknown> | null;
}

export interface TrainingPolicyHistoryResponse {
  success: boolean;
  time: string;
  message: string;
  history: TrainingPolicyHistoryEntry[];
}
