import { type Encounter, genEncounter } from "./encounter";
import { type Doctor, genDoctor } from "./doctor";
import { type PrescriptionItem } from "./prescription-item";
import type { SpecialistIntern } from "./specialist-intern";

export interface Prescription {
  id: number
  encounter_id: number
  encounter: Encounter
  doctor_id: number
  doctor: Doctor
  specialistIntern_id?: number
  specialistIntern?: SpecialistIntern
  issuedAt: string
  status_code: string
  items: PrescriptionItem[]
}

export interface CreateDto {
  encounter_id: number
  doctor_id: number
  issuedAt: string
  status_code: string
}

export interface GetListDto {
  encounter_id: number
  doctor_id: number
  issuedAt: string
  status_code: string
}

export interface GetDetailDto {
  id?: string
}

export interface UpdateDto extends CreateDto {
  id?: number
}

export interface DeleteDto {
  id?: string
}

export function genPresciption(): Prescription {
  return {
    id: 0,
    encounter_id: 0,
    encounter: genEncounter(),
    doctor_id: 0,
    doctor: genDoctor(),
    issuedAt: '',
    status_code: '',
    items: [],
  }
}
