package infra

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	ei "simrs-vx/internal/domain/main-entities/item"

	erb "simrs-vx/internal/domain/main-entities/procedure-room/base"

	ero "simrs-vx/internal/domain/references/organization"
)

type Infra struct {
	ecore.SmallMain                    // adjust this according to the needs
	Code            string             `json:"code" gorm:"uniqueIndex;size:20;not null"`
	Name            string             `json:"name" gorm:"size:50"`
	InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:20"`
	Parent_Code     *string            `json:"parent_code" gorm:"size:20"`
	Parent          *Infra             `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
	Childrens       []Infra            `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"`
	Item_Code       *string            `json:"item_code" gorm:"size:50"`
	Item            *ei.Item           `json:"item,omitempty" gorm:"foreignKey:Item_Code;references:Code"`
	ProcedureRooms  *erb.ProcedureRoom `json:"rooms" gorm:"foreignKey:Infra_Code;references:Code"`
}
