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

This commit is contained in:
dpurbosakti
2025-10-07 15:46:26 +07:00
4 changed files with 26 additions and 15 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
h1:ZyLhZFZoiN0F1XdEaKvIbcFdvrYL1nLWtjK94oqn9IA=
h1:4thtC22CJCQMIeVkYLmcFOT5w7S+bUUWy9wHZ21OHi8=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -27,4 +27,4 @@ h1:ZyLhZFZoiN0F1XdEaKvIbcFdvrYL1nLWtjK94oqn9IA=
20251006041122.sql h1:MlS7f21z06sutnf9dIekt5fuHJr4lgcQ4uCuCXAGsfc=
20251006045658.sql h1:3FmGCPCzjgMPdWDRodZTsx3KVaodd9zB9ilib69aewk=
20251006045928.sql h1:Z5g31PmnzNwk/OKdODcxZGm8fjJQdMFK32Xfnt3bRHg=
20251007022859.sql h1:fFz0Kjuopv0QqLDiMvq+9sfq6K6PdiOs55EECWk4U+I=
20251007022859.sql h1:FO03zEfaNEk/aXwY81d5Lp3MoBB9kPQuXlXJ4BPiSR8=
@@ -3,6 +3,7 @@ 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"
)
@@ -17,4 +18,5 @@ type Infra struct {
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"`
}
@@ -0,0 +1,19 @@
package base
import (
ecore "simrs-vx/internal/domain/base-entities/core"
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
eu "simrs-vx/internal/domain/main-entities/unit"
)
type Basic struct {
ecore.SmallMain // adjust this according to the needs
Infra_Id *uint16 `json:"infra_id"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
}
+3 -13
View File
@@ -1,21 +1,11 @@
package room
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ei "simrs-vx/internal/domain/main-entities/infra"
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
eu "simrs-vx/internal/domain/main-entities/unit"
ebase "simrs-vx/internal/domain/main-entities/room/base"
)
type Room struct {
ecore.SmallMain // adjust this according to the needs
Infra_Id *uint16 `json:"infra_id"`
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id"`
Unit_Id *uint16 `json:"unit_id"`
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
Specialist_Id *uint16 `json:"specialist_id"`
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
Subspecialist_Id *uint16 `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
ebase.Basic
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id"`
}