/**
 * Registration status as a discriminated union: each variant owns exactly the
 * data that makes sense for it. Only an active (Geregistreerd) registration has
 * a herregistratie date; a struck-off (Doorgehaald) one cannot carry one. The
 * old flat interface allowed that impossible combination — this makes it
 * unrepresentable.
 */
export type RegistrationStatus =
  | { tag: 'Geregistreerd'; herregistratieDatum: string } // ISO date
  | { tag: 'Geschorst'; geschorstTot: string; reden: string }
  | { tag: 'Doorgehaald'; doorgehaaldOp: string; reden: string };

/** Just the discriminant — for atoms that only need the label/color. */
export type StatusTag = RegistrationStatus['tag'];

export interface Registration {
  bigNummer: string;
  naam: string;
  beroep: string; // arts, verpleegkundige, apotheker, ...
  registratiedatum: string; // ISO date
  geboortedatum: string;
  status: RegistrationStatus;
}

/** A note is either a recognised specialism or a plain annotation — a closed set,
    not an open string, so a typo can't slip through. */
export type AantekeningType = 'Specialisme' | 'Aantekening';

export interface Aantekening {
  type: AantekeningType;
  omschrijving: string;
  datum: string;
}
