import { DeductionType } from './DeductionType';

export interface EmployeeDeduction {
  id: string;
  employee_id: string;
  deduction_type_id: string;
  amount: string;
  effective_date: string;
  end_date: string | null;
  employee?: {
    employee_id: string;
    staff_id: string;
    firstname: string;
    lastname: string;
    full_name: string;
  };
  deduction_type?: DeductionType;
  created_at: string;
  updated_at: string;
}

export interface CreateEmployeeDeductionPayload {
  employee_id: string;
  deduction_type_id: string;
  amount: number;
  effective_date: string;
  end_date?: string | null;
}

export interface UpdateEmployeeDeductionPayload {
  id: string;
  amount?: number;
  effective_date?: string;
  end_date?: string | null;
}

export interface DeleteEmployeeDeductionPayload {
  message: string;
  id?: string;
}

export interface DeductionMatrixEmployee {
  employee_id: string;
  staff_id: string;
  full_name: string;
  deductions: Record<string, { deduction_id: string | null; amount: string | null }>;
}

export interface DeductionMatrixResponse {
  deduction_types: { id: string; name: string; code: string }[];
  employees: DeductionMatrixEmployee[];
}
