23 lines
1.0 KiB
Go
23 lines
1.0 KiB
Go
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/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:"unique;size:10"`
|
|
Name string `json:"name" gorm:"size:50"`
|
|
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:15"`
|
|
Parent_Id *uint16 `json:"parent_id"`
|
|
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
|
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
|
Item_Id *uint `json:"item_id"`
|
|
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
|
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Id"`
|
|
}
|