package medicationitem

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	eme "simrs-vx/internal/domain/main-entities/medication"
	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 MedicationItem struct {
	ecore.Main                         // adjust this according to the needs
	Medication_Id     *uint            `json:"medication_id"`
	Medication        *eme.Medication  `json:"medication,omitempty" gorm:"foreignKey:Medication_Id;references: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"`
	IsRedeemed        bool             `json:"isRedeemed"`
	Quantity          float64          `json:"quantity"`
	Note              *string          `json:"note" gorm:"size:1024"`
}
