package medicine

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	ein "simrs-vx/internal/domain/main-entities/infra"
	eit "simrs-vx/internal/domain/main-entities/item"
	emf "simrs-vx/internal/domain/main-entities/medicine-form"
	emg "simrs-vx/internal/domain/main-entities/medicine-group"
	emm "simrs-vx/internal/domain/main-entities/medicine-method"
	eu "simrs-vx/internal/domain/main-entities/uom"
)

type Medicine struct {
	ecore.Main                              // adjust this according to the needs
	Code                string              `json:"code" gorm:"unique;size:10"`
	Name                string              `json:"name" gorm:"size:50"`
	MedicineGroup_Code  *string             `json:"medicineGroup_code" gorm:"size:10"`
	MedicineGroup       *emg.MedicineGroup  `json:"medicineGroup,omitempty" gorm:"foreignKey:MedicineGroup_Code;references:Code"`
	MedicineMethod_Code *string             `json:"medicineMethod_code" gorm:"size:10"`
	MedicineMethod      *emm.MedicineMethod `json:"medicineMethod,omitempty" gorm:"foreignKey:MedicineMethod_Code;references:Code"`
	MedicineForm_Code   *string             `json:"medicineForm_code" gorm:"size:20"`
	MedicineForm        *emf.MedicineForm   `json:"medicineForm,omitempty" gorm:"foreignKey:MedicineForm_Code;references:Code"`
	Uom_Code            *string             `json:"uom_code" gorm:"size:10"`
	Uom                 *eu.Uom             `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
	Dose                uint8               `json:"dose"`
	Infra_Code          *string             `json:"infra_code" gorm:"size:10"`
	Infra               *ein.Infra          `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
	Stock               *int                `json:"stock"`
	Item_Code           *string             `json:"item_code" gorm:"size:50"`
	Item                *eit.Item           `json:"item,omitempty" gorm:"foreignKey:Item_Code;references:Code"`
}
