export type ParentType = "PAPA" | "MAMAN";
export type Trimester = "DATATION" | "T1" | "T2" | "T3";

export type ParentIndexPhoto = {
  id: string;
  parentIndicesId: string;
  url: string;
  sortOrder: number;
  createdAt: string;
};

export type ParentIndices = {
  id: string;
  projectId: string;
  parentType: ParentType;
  poids: number | null;
  taille: number | null;
  perimCranien: number | null;
  dateNaissance: string | null;
  updatedAt: string;
  photos: ParentIndexPhoto[];
};

export type BabyTrimesterPhoto = {
  id: string;
  trimesterEntryId: string;
  url: string;
  sortOrder: number;
  createdAt: string;
};

export type BabyTrimesterEntry = {
  id: string;
  babyIndicesId: string;
  trimester: Trimester;
  date: string | null;
  note: string | null;
  poids: number | null;
  taille: number | null;
  perimCranien: number | null;
  updatedAt: string;
  photos: BabyTrimesterPhoto[];
};

export type BabyIndices = {
  id: string;
  projectId: string;
  babyIndex: number;
  dpa: string | null;
  updatedAt: string;
  trimesters: BabyTrimesterEntry[];
};

export type ProjectIndicesResponse = {
  parentIndices: ParentIndices[];
  babyIndices: BabyIndices[];
};

export type UpsertParentIndicesPayload = {
  poids?: number | null;
  taille?: number | null;
  perimCranien?: number | null;
  dateNaissance?: string | null;
};

export type UpsertBabyIndicesPayload = {
  dpa?: string | null;
};

export type UpsertBabyTrimesterPayload = {
  date?: string | null;
  note?: string | null;
  poids?: number | null;
  taille?: number | null;
  perimCranien?: number | null;
};
