Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into fix/anything-moko

This commit is contained in:
dpurbosakti
2025-10-03 10:21:49 +07:00
6 changed files with 18 additions and 3 deletions
@@ -2,6 +2,7 @@ package deviceorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
erc "simrs-vx/internal/domain/references/common"
@@ -11,6 +12,8 @@ type DeviceOrder struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
@@ -9,6 +9,6 @@ type Division struct {
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Parent_Id *uint16 `json:"parent_id"`
Parent *Division `gorm:"foreignKey:Parent_Id;references:Id"`
Childrens []Division `gorm:"foreignKey:Parent_Id"` // may need references to self
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
}
@@ -13,6 +13,8 @@ type Infra struct {
Name string `json:"name" gorm:"size:50"`
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:10"`
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"`
}
@@ -2,6 +2,7 @@ package materialorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
erc "simrs-vx/internal/domain/references/common"
@@ -11,6 +12,8 @@ type MaterialOrder struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
Status_Code erc.DataStatusCode `json:"status_code"`
}