import type { Site } from './site'
import type { Contract } from './contract'
import type { ContractPhase } from './contract-phase'

export type ContractSuspension = {
  id: number
  startDate: string
  endDate?: string | null
  comment?: string | null
}

export type ContractHistoryItem = {
  contractId?: number | null
  contractName?: string | null
  weeklyHours?: number | null
  contractNature: 'CDI' | 'CDD' | 'INTERIM'
  startDate: string
  endDate?: string | null
  comment?: string | null
  periodId?: number | null
  suspensions?: ContractSuspension[]
  isDriver?: boolean
  workDaysHours?: Record<number, number> | null
  interimAgencyId?: number | null
  interimAgencyName?: string | null
}

export type Employee = {
  id: number
  firstName: string
  lastName: string
  site: Site
  contract?: Contract | null
  hasActiveContract?: boolean
  isDriver?: boolean
  currentContractNature?: 'CDI' | 'CDD' | 'INTERIM'
  currentContractStartDate?: string | null
  currentContractEndDate?: string | null
  contractHistory?: ContractHistoryItem[]
  displayOrder?: number
  entryDate?: string | null
  currentSuspensions?: ContractSuspension[]
  currentInterimAgencyId?: number | null
  currentInterimAgencyName?: string | null
  contractPhases?: ContractPhase[]
}
