import { genMedicine, type Medicine } from "./medicine";
import { genMedicinemix, type Medicinemix } from "./medicinemix";

export interface PrescriptionItem {
  id: number;
  prescription_id: number;
  isMix: boolean;
  medicine_id: number;
  medicine: Medicine;
  medicineMix_id: number;
  medicineMix: Medicinemix
  frequency: number;
  dose: number;
  interval: number;
  intervalUnit_code: string;
  quantity: number;
  usage: string;
}

export interface CreateDto {
  prescription_Id: number;
  isMix: boolean;
  medicine_Id: number;
  medicineMix_id: number;
  frequency: number;
  multiplier: number;
  interval: number;
  intervalUnit_code: string;
  quantity: number;
  usage: string;
}
 
export interface GetListDto {
  page: number
  size: number
  name?: string
//   code?: string
}
 
export interface GetDetailDto {
  id?: string
}
 
export interface UpdateDto extends CreateDto {
  id?: number
}
 
export interface DeleteDto {
  id?: string
}
 
export function genPresciptionItem(): PrescriptionItem {
  return {
    id: 0,
    prescription_id: 0,
    isMix: false,
    medicine_id: 0,
    medicine: genMedicine(),
    medicineMix_id: 0,
    medicineMix: genMedicinemix(),
    frequency: 0,
    dose: 0,
    interval: 0,
    intervalUnit_code: '',
    quantity: 0,
    usage: ''
  }
}
 