package prescriptionitem

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	em "simrs-vx/internal/domain/main-entities/medicine"
	emm "simrs-vx/internal/domain/main-entities/medicine-mix"

	erc "simrs-vx/internal/domain/references/common"
)

type PrescriptionItem struct {
	ecore.Main                         // adjust this according to the needs
	Prescription_Id   *uint            `json:"prescription_id"`
	IsMix             bool             `json:"isMix"`
	Medicine_Code     *string          `json:"medicine_code"`
	Medicine          *em.Medicine     `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Code;references:Code"`
	MedicineMix_Id    *uint            `json:"medicineMix_id"`
	MedicineMix       *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
	Frequency         *uint16          `json:"frequency"`
	Dose              float64          `json:"dose"`
	Usage             string           `json:"usage" gorm:"size:255"`
	Interval          uint8            `json:"interval"`
	IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
	Quantity          float64          `json:"quantity"`
}
