import {
  PensionAllocationMode,
  PensionAllocationProfile,
  PensionContributor,
  PensionPool,
} from './PensionConfig';

export interface DeductionType {
  id: string;
  name: string;
  code: string;
  is_pretax: boolean;
  is_statutory: boolean;
  is_pension_source?: boolean;
  pension_contributor?: PensionContributor | null;
  pension_allocation_mode?: PensionAllocationMode;
  pension_pool_id?: string | null;
  pension_allocation_profile_id?: string | null;
  pension_pool?: PensionPool | null;
  pension_allocation_profile?: PensionAllocationProfile | null;
  calculation_method: 'fixed' | 'percentage_of_basic' | 'percentage_of_gross';
  default_amount: string | null;
  default_percentage: string | null;
  default_duration_months: number | null;
  is_active: boolean;
  employee_deductions_count?: number;
  created_at: string;
  updated_at: string;
}

export interface CreateDeductionTypePayload {
  name: string;
  code: string;
  is_pretax?: boolean;
  is_statutory?: boolean;
  is_pension_source?: boolean;
  pension_contributor?: PensionContributor | null;
  pension_allocation_mode?: PensionAllocationMode;
  pension_pool_id?: string | null;
  pension_allocation_profile_id?: string | null;
  calculation_method: 'fixed' | 'percentage_of_basic' | 'percentage_of_gross';
  default_amount?: number | null;
  default_percentage?: number | null;
  default_duration_months?: number | null;
  is_active?: boolean;
}

export interface UpdateDeductionTypePayload extends Partial<CreateDeductionTypePayload> {
  id: string;
}

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