import { TpeDevice } from './tpe';

export type AgentStatus = 'ACTIF' | 'INACTIF' | 'SUSPENDU';

export interface Agent {
  id: string;
  code: string;
  profile: string; // ex. AGENT, SUPERVISEUR, CAISSIER
  principalCode?: string; // Agent principal
  caisseProfile?: string;
  statut: AgentStatus;
  zone?: string;
  kiosk?: string;
  fonction?: string;
  dateEmbauche?: string; // ISO

  nom: string;
  prenom: string;
  autresNoms?: string;
  dateNaissance?: string;
  lieuNaissance?: string;
  ville?: string;
  adresse?: string;
  autoriserAides?: boolean;

  phone: string;
  pin?: string; // masked in UI

  limiteInferieure?: number;
  limiteSuperieure?: number;
  limiteParTransaction?: number;
  limiteMinAirtime?: number;
  limiteMaxAirtime?: number;

  maxPeripheriques?: number;

  limitId?: string; // reference to AgentLimit config

  // Légales
  nationalite?: string;
  cni?: string;
  cniDelivreeLe?: string;
  cniDelivreeA?: string;
  residence?: string;
  autreAdresse1?: string;
  statutMarital?: string;
  epoux?: string;
  autreTelephone?: string;

  // TPE assignés (actifs seulement)
  tpes?: TpeDevice[];

  createdAt?: string;
  updatedAt?: string;
  createdBy?: string;
}

export interface AgentFamilyMember {
  id: string;
  agentId: string;
  nom: string;
  statut?: string; // conjoint, enfant, etc.
  dateNaissance?: string;
  sexe?: 'M' | 'F';
}
