infra, room, item, medicine, device, material ids into codes
This commit is contained in:
No files matched your search
@@ -8,11 +8,11 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -32,17 +32,18 @@ type FilterDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
|
||||
@@ -14,7 +14,9 @@ type Device struct {
|
||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code" gorm:"size:50"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -9,15 +9,15 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Infra_Id *uint16 `json:"-"` // for room
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
|
||||
Parent_Code *string `json:"parent_code"`
|
||||
Item_Id *uint `json:"-"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
Infra_Code *string `json:"infra_code"` // for room
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -32,24 +32,25 @@ type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Parent_Code *string `json:"parent-code"`
|
||||
Item_Id *string `json:"item-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id *uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -63,10 +64,10 @@ type ResponseDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent_Code *string `json:"parent_code"`
|
||||
Parent *Infra `json:"parent,omitempty"`
|
||||
Childrens []Infra `json:"childrens,omitempty"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Rooms []erb.Basic `json:"rooms,omitempty"`
|
||||
}
|
||||
@@ -76,10 +77,10 @@ func (d Infra) ToResponse() ResponseDto {
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
InfraGroup_Code: d.InfraGroup_Code,
|
||||
Parent_Id: d.Parent_Id,
|
||||
Parent_Code: d.Parent_Code,
|
||||
Parent: d.Parent,
|
||||
Childrens: d.Childrens,
|
||||
Item_Id: d.Item_Id,
|
||||
Item_Code: d.Item_Code,
|
||||
Item: d.Item,
|
||||
Rooms: d.Rooms,
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -10,13 +11,15 @@ import (
|
||||
|
||||
type Infra struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Code string `json:"code" gorm:"uniqueIndex;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_Code *string `json:"parent_code" gorm:"size:10"`
|
||||
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_Code *string `json:"item_code" gorm:"size:50"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Id"`
|
||||
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||
}
|
||||
@@ -11,7 +11,7 @@ type CreateDto struct {
|
||||
Name string `json:"name" validate:"maxLength=100"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" validate:"maxLength=10"`
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
@@ -27,23 +27,24 @@ type FilterDto struct {
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup-code"`
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Stock *int `json:"stock"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -59,7 +60,7 @@ type ResponseDto struct {
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
@@ -70,7 +71,7 @@ func (d Item) ToResponse() ResponseDto {
|
||||
ItemGroup_Code: d.ItemGroup_Code,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Stock: d.Stock,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
|
||||
@@ -15,5 +15,6 @@ type Item struct {
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -24,28 +24,29 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom-code"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Code *string `json:"item-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -56,28 +57,28 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ein.Infra `json:"infra,omitempty"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom,omitempty"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ein.Infra `json:"infra,omitempty"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d Material) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
Stock: d.Stock,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
Stock: d.Stock,
|
||||
Item_Code: d.Item_Code,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -14,8 +14,10 @@ type Material struct {
|
||||
Uom_Code string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code" gorm:"size:50"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -16,9 +16,9 @@ type CreateDto struct {
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code" validate:"maxLength=10"`
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -35,25 +35,26 @@ type FilterDto struct {
|
||||
MedicineMethod_Code *string `json:"medicineMethod-code"`
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Item_Code *string `json:"item-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Item_Code *uint `json:"item_code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -73,10 +74,10 @@ type ResponseDto struct {
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ein.Infra `json:"infra,omitempty"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code"`
|
||||
Item *eit.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
@@ -91,10 +92,10 @@ func (d Medicine) ToResponse() ResponseDto {
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Dose: d.Dose,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
Stock: d.Stock,
|
||||
Item_Id: d.Item_Id,
|
||||
Item_Code: d.Item_Code,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
|
||||
@@ -21,8 +21,10 @@ type Medicine struct {
|
||||
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Infra *ein.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Code *string `json:"item_code" gorm:"size:50"`
|
||||
Item *eit.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -9,17 +9,13 @@ import (
|
||||
|
||||
type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
func (Basic) TableName() string {
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -22,10 +22,10 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Unit_Id *uint16 `json:"unit-id"`
|
||||
Specialist_Id *uint16 `json:"specialist-id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -49,26 +49,26 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
}
|
||||
|
||||
func (d Room) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Specialist_Id: d.Specialist_Id,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Id: d.Subspecialist_Id,
|
||||
Subspecialist: d.Subspecialist,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Code: d.Subspecialist_Code,
|
||||
Subspecialist: d.Subspecialist,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
return resp
|
||||
|
||||
@@ -7,5 +7,5 @@ import (
|
||||
|
||||
type Room struct {
|
||||
ebase.Basic
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||
}
|
||||
Reference in New Issue
Block a user