diff --git a/cmd/main-migration/migrations/20251024034832.sql b/cmd/main-migration/migrations/20251024034832.sql new file mode 100644 index 00000000..05794c82 --- /dev/null +++ b/cmd/main-migration/migrations/20251024034832.sql @@ -0,0 +1,12 @@ +-- Modify "Doctor" table +ALTER TABLE "public"."Doctor" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Doctor_Code" UNIQUE ("Code"); +-- Modify "Laborant" table +ALTER TABLE "public"."Laborant" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Laborant_Code" UNIQUE ("Code"); +-- Modify "Midwife" table +ALTER TABLE "public"."Midwife" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Midwife_Code" UNIQUE ("Code"); +-- Modify "Nurse" table +ALTER TABLE "public"."Nurse" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Nurse_Code" UNIQUE ("Code"); +-- Modify "Nutritionist" table +ALTER TABLE "public"."Nutritionist" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Nutritionist_Code" UNIQUE ("Code"); +-- Modify "Pharmacist" table +ALTER TABLE "public"."Pharmacist" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Pharmacist_Code" UNIQUE ("Code"); diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 26b28019..a52827a6 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:JmnFn6HtgFEjn6R7vQ/qii2smCP5Ye2B2JgnKEpkkLs= +h1:fAJxBGCfoMXYDjYBlq6RITZ/dXbqiYtQWwupcBMLHV0= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -55,4 +55,5 @@ h1:JmnFn6HtgFEjn6R7vQ/qii2smCP5Ye2B2JgnKEpkkLs= 20251020062553.sql h1:Iw7hulcm5iRQlfW+ygA4iTPxLqkxx6h9vXMXEwUAHKs= 20251021041042.sql h1:wMgSivBV2A0NDcsLmKGIp0kMcVh2IODSG9b4dgzCaOM= 20251021075552.sql h1:8gfSMAglflNO6L0sSzxFNEubYN8/O4thT7OQT+WH+3M= -20251023044432.sql h1:nax2UtrrEp7vE3uFbUbsExTPCvFr5Hv44NEPPTXTMtA= +20251023044432.sql h1:MkvajJs3bfk9+wHvQ43/ccAluJEBARm1gWr1u92ccLA= +20251024034832.sql h1:x3s3VEVYLOSKLAFxJGb2+c1FyTMMvPE+9k4Ew7rKQaI= diff --git a/internal/domain/main-entities/division-position/base/entity.go b/internal/domain/main-entities/division-position/base/entity.go new file mode 100644 index 00000000..d44c0b86 --- /dev/null +++ b/internal/domain/main-entities/division-position/base/entity.go @@ -0,0 +1,18 @@ +package base + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" +) + +type Basic struct { + ecore.SmallMain // adjust this according to the needs + Division_Id *uint16 `json:"division_id"` + Code string `json:"code" gorm:"unique;size:10"` + Name string `json:"name" gorm:"size:50"` + HeadStatus bool `json:"headStatus"` + Employee_Id *uint `json:"employee_id"` +} + +func (Basic) TableName() string { + return "DivisionPosition" +} diff --git a/internal/domain/main-entities/division-position/entity.go b/internal/domain/main-entities/division-position/entity.go index c7d70968..79379b52 100644 --- a/internal/domain/main-entities/division-position/entity.go +++ b/internal/domain/main-entities/division-position/entity.go @@ -1,18 +1,13 @@ package divisionposition import ( - ecore "simrs-vx/internal/domain/base-entities/core" ed "simrs-vx/internal/domain/main-entities/division" + eb "simrs-vx/internal/domain/main-entities/division-position/base" ee "simrs-vx/internal/domain/main-entities/employee" ) type DivisionPosition struct { - ecore.SmallMain // adjust this according to the needs - Division_Id *uint16 `json:"division_id"` - Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id;references:Id"` - Code string `json:"code" gorm:"unique;size:10"` - Name string `json:"name" gorm:"size:50"` - HeadStatus bool `json:"headStatus"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + eb.Basic + Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id;references:Id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` } diff --git a/internal/domain/main-entities/division/entity.go b/internal/domain/main-entities/division/entity.go index 470fab0d..4051c138 100644 --- a/internal/domain/main-entities/division/entity.go +++ b/internal/domain/main-entities/division/entity.go @@ -2,13 +2,15 @@ package division import ( ecore "simrs-vx/internal/domain/base-entities/core" + edpb "simrs-vx/internal/domain/main-entities/division-position/base" ) type Division struct { - ecore.SmallMain // adjust this according to the needs - Code string `json:"code" gorm:"unique;size:10"` - Name string `json:"name" gorm:"size:50"` - Parent_Id *uint16 `json:"parent_id"` - Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"` - Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:10"` + Name string `json:"name" gorm:"size:50"` + Parent_Id *uint16 `json:"parent_id"` + Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"` + Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self + DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Id;references:Id"` } diff --git a/internal/domain/main-entities/doctor/entity.go b/internal/domain/main-entities/doctor/entity.go index cf952380..ec882838 100644 --- a/internal/domain/main-entities/doctor/entity.go +++ b/internal/domain/main-entities/doctor/entity.go @@ -10,6 +10,7 @@ import ( type Doctor struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/installation-position/base/entity.go b/internal/domain/main-entities/installation-position/base/entity.go new file mode 100644 index 00000000..02fbbe84 --- /dev/null +++ b/internal/domain/main-entities/installation-position/base/entity.go @@ -0,0 +1,20 @@ +package base + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + ee "simrs-vx/internal/domain/main-entities/employee" +) + +type Basic struct { + ecore.SmallMain // adjust this according to the needs + Installation_Id *uint16 `json:"installation_id" gorm:"not null"` + Code string `json:"code" gorm:"unique;size:10;not null"` + Name string `json:"name" gorm:"size:30;not null"` + HeadStatus bool `json:"headStatus"` + Employee_Id *uint `json:"employee_id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` +} + +func (Basic) TableName() string { + return "InstallationPosition" +} diff --git a/internal/domain/main-entities/installation-position/entity.go b/internal/domain/main-entities/installation-position/entity.go index 03571326..48e95ac5 100644 --- a/internal/domain/main-entities/installation-position/entity.go +++ b/internal/domain/main-entities/installation-position/entity.go @@ -1,18 +1,11 @@ package installation_position import ( - ecore "simrs-vx/internal/domain/base-entities/core" - ee "simrs-vx/internal/domain/main-entities/employee" ei "simrs-vx/internal/domain/main-entities/installation" + eib "simrs-vx/internal/domain/main-entities/installation-position/base" ) type InstallationPosition struct { - ecore.SmallMain // adjust this according to the needs - Installation_Id *uint16 `json:"installation_id" gorm:"not null"` - Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Id;references:Id"` - Code string `json:"code" gorm:"unique;size:10;not null"` - Name string `json:"name" gorm:"size:30;not null"` - HeadStatus bool `json:"headStatus"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + eib.Basic // adjust this according to the needs + Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Id;references:Id"` } diff --git a/internal/domain/main-entities/installation/entity.go b/internal/domain/main-entities/installation/entity.go index 0cd5b7dd..dea63a45 100644 --- a/internal/domain/main-entities/installation/entity.go +++ b/internal/domain/main-entities/installation/entity.go @@ -2,12 +2,14 @@ package installation import ( ecore "simrs-vx/internal/domain/base-entities/core" + eipb "simrs-vx/internal/domain/main-entities/installation-position/base" ere "simrs-vx/internal/domain/references/encounter" ) type Installation struct { - ecore.SmallMain // adjust this according to the needs - Code string `json:"code" gorm:"unique;size:10"` - Name string `json:"name" gorm:"size:50"` - EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code" gorm:"size:10"` + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:10"` + Name string `json:"name" gorm:"size:50"` + EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code" gorm:"size:10"` + InstallationPositions []eipb.Basic `json:"installationPositions,omitempty" gorm:"foreignKey:Installation_Id;references:Id"` } diff --git a/internal/domain/main-entities/laborant/entity.go b/internal/domain/main-entities/laborant/entity.go index eeb63bef..9b48552e 100644 --- a/internal/domain/main-entities/laborant/entity.go +++ b/internal/domain/main-entities/laborant/entity.go @@ -7,6 +7,7 @@ import ( type Laborant struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/midwife/entity.go b/internal/domain/main-entities/midwife/entity.go index f98ba553..f0871e31 100644 --- a/internal/domain/main-entities/midwife/entity.go +++ b/internal/domain/main-entities/midwife/entity.go @@ -7,6 +7,7 @@ import ( type Midwife struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/nurse/entity.go b/internal/domain/main-entities/nurse/entity.go index c3332c45..9768c622 100644 --- a/internal/domain/main-entities/nurse/entity.go +++ b/internal/domain/main-entities/nurse/entity.go @@ -9,6 +9,7 @@ import ( type Nurse struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/nutritionist/entity.go b/internal/domain/main-entities/nutritionist/entity.go index be431f66..ab953c7f 100644 --- a/internal/domain/main-entities/nutritionist/entity.go +++ b/internal/domain/main-entities/nutritionist/entity.go @@ -7,6 +7,7 @@ import ( type Nutritionist struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/pharmacist/entity.go b/internal/domain/main-entities/pharmacist/entity.go index 318cc97e..604de4d4 100644 --- a/internal/domain/main-entities/pharmacist/entity.go +++ b/internal/domain/main-entities/pharmacist/entity.go @@ -7,6 +7,7 @@ import ( type Pharmacist struct { ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` Employee_Id *uint `json:"employee_id"` Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` diff --git a/internal/domain/main-entities/specialist-position/base/entity.go b/internal/domain/main-entities/specialist-position/base/entity.go new file mode 100644 index 00000000..5910689e --- /dev/null +++ b/internal/domain/main-entities/specialist-position/base/entity.go @@ -0,0 +1,20 @@ +package base + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + ee "simrs-vx/internal/domain/main-entities/employee" +) + +type Basic struct { + ecore.SmallMain // adjust this according to the needs + Specialist_Id *uint16 `json:"specialist_id" gorm:"not null"` + Code string `json:"code" gorm:"unique;size:10;not null"` + Name string `json:"name" gorm:"size:30;not null"` + HeadStatus bool `json:"headStatus"` + Employee_Id *uint `json:"employee_id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` +} + +func (Basic) TableName() string { + return "SpecialistPosition" +} diff --git a/internal/domain/main-entities/specialist-position/entity.go b/internal/domain/main-entities/specialist-position/entity.go index 0afa5ba3..26c1d27f 100644 --- a/internal/domain/main-entities/specialist-position/entity.go +++ b/internal/domain/main-entities/specialist-position/entity.go @@ -1,18 +1,11 @@ package specialist_position import ( - ecore "simrs-vx/internal/domain/base-entities/core" - ee "simrs-vx/internal/domain/main-entities/employee" es "simrs-vx/internal/domain/main-entities/specialist" + esb "simrs-vx/internal/domain/main-entities/specialist-position/base" ) type SpecialistPosition struct { - ecore.SmallMain // adjust this according to the needs - Specialist_Id *uint16 `json:"specialist_id" gorm:"not null"` - Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"` - Code string `json:"code" gorm:"unique;size:10;not null"` - Name string `json:"name" gorm:"size:30;not null"` - HeadStatus bool `json:"headStatus"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + esb.Basic + Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"` } diff --git a/internal/domain/main-entities/specialist/entity.go b/internal/domain/main-entities/specialist/entity.go index 3cea2ebd..5c2d5b89 100644 --- a/internal/domain/main-entities/specialist/entity.go +++ b/internal/domain/main-entities/specialist/entity.go @@ -2,13 +2,15 @@ package specialist import ( ecore "simrs-vx/internal/domain/base-entities/core" + eub "simrs-vx/internal/domain/main-entities/specialist-position/base" eu "simrs-vx/internal/domain/main-entities/unit" ) type Specialist struct { - ecore.SmallMain // adjust this according to the needs - Code string `json:"code" gorm:"unique;size:10"` - Name string `json:"name" gorm:"size:50"` - Unit_Id *uint16 `json:"unit_id"` - Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"` + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:10"` + Name string `json:"name" gorm:"size:50"` + Unit_Id *uint16 `json:"unit_id"` + Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"` + SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"` } diff --git a/internal/domain/main-entities/subspecialist-position/base/entity.go b/internal/domain/main-entities/subspecialist-position/base/entity.go new file mode 100644 index 00000000..147fcecb --- /dev/null +++ b/internal/domain/main-entities/subspecialist-position/base/entity.go @@ -0,0 +1,20 @@ +package base + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + ee "simrs-vx/internal/domain/main-entities/employee" +) + +type Basic struct { + ecore.SmallMain // adjust this according to the needs + Subspecialist_Id *uint16 `json:"subspecialist_id" gorm:"not null"` + Code string `json:"code" gorm:"unique;size:10;not null"` + Name string `json:"name" gorm:"size:30;not null"` + HeadStatus bool `json:"headStatus"` + Employee_Id *uint `json:"employee_id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` +} + +func (Basic) TableName() string { + return "SubspecialistPosition" +} diff --git a/internal/domain/main-entities/subspecialist-position/entity.go b/internal/domain/main-entities/subspecialist-position/entity.go index 5d4bdcb8..28a205ed 100644 --- a/internal/domain/main-entities/subspecialist-position/entity.go +++ b/internal/domain/main-entities/subspecialist-position/entity.go @@ -1,18 +1,11 @@ package subspecialist_position import ( - ecore "simrs-vx/internal/domain/base-entities/core" - ee "simrs-vx/internal/domain/main-entities/employee" es "simrs-vx/internal/domain/main-entities/subspecialist" + esb "simrs-vx/internal/domain/main-entities/subspecialist-position/base" ) type SubspecialistPosition struct { - ecore.SmallMain // adjust this according to the needs - Subspecialist_Id *uint16 `json:"subspecialist_id" gorm:"not null"` - Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"` - Code string `json:"code" gorm:"unique;size:10;not null"` - Name string `json:"name" gorm:"size:30;not null"` - HeadStatus bool `json:"headStatus"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + esb.Basic + Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"` } diff --git a/internal/domain/main-entities/subspecialist/entity.go b/internal/domain/main-entities/subspecialist/entity.go index 5de27442..a81d6ded 100644 --- a/internal/domain/main-entities/subspecialist/entity.go +++ b/internal/domain/main-entities/subspecialist/entity.go @@ -3,12 +3,14 @@ package subspecialist import ( ecore "simrs-vx/internal/domain/base-entities/core" es "simrs-vx/internal/domain/main-entities/specialist" + espb "simrs-vx/internal/domain/main-entities/subspecialist-position/base" ) type Subspecialist struct { - ecore.SmallMain // adjust this according to the needs - Code string `json:"code" gorm:"unique;size:10"` - Name string `json:"name" gorm:"size:50"` - Specialist_Id *uint16 `json:"specialist_id"` - Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"` + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:10"` + Name string `json:"name" gorm:"size:50"` + Specialist_Id *uint16 `json:"specialist_id"` + Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"` + SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"` } diff --git a/internal/domain/main-entities/unit-position/base/entity.go b/internal/domain/main-entities/unit-position/base/entity.go new file mode 100644 index 00000000..3d913d4f --- /dev/null +++ b/internal/domain/main-entities/unit-position/base/entity.go @@ -0,0 +1,18 @@ +package base + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" +) + +type Basic struct { + ecore.SmallMain // adjust this according to the needs + Unit_Id *uint16 `json:"unit_id" gorm:"not null"` + Code string `json:"code" gorm:"unique;size:10;not null"` + Name string `json:"name" gorm:"size:30;not null"` + HeadStatus bool `json:"headStatus"` + Employee_Id *uint `json:"employee_id"` +} + +func (Basic) TableName() string { + return "UnitPosition" +} diff --git a/internal/domain/main-entities/unit-position/entity.go b/internal/domain/main-entities/unit-position/entity.go index 3bd10d9e..5450cee2 100644 --- a/internal/domain/main-entities/unit-position/entity.go +++ b/internal/domain/main-entities/unit-position/entity.go @@ -1,18 +1,13 @@ package unit_position import ( - ecore "simrs-vx/internal/domain/base-entities/core" ee "simrs-vx/internal/domain/main-entities/employee" eu "simrs-vx/internal/domain/main-entities/unit" + eub "simrs-vx/internal/domain/main-entities/unit-position/base" ) type UnitPosition struct { - ecore.SmallMain // adjust this according to the needs - Unit_Id *uint16 `json:"unit_id" gorm:"not null"` - Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` - Code string `json:"code" gorm:"unique;size:10;not null"` - Name string `json:"name" gorm:"size:30;not null"` - HeadStatus bool `json:"headStatus"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + eub.Basic + Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` } diff --git a/internal/domain/main-entities/unit/entity.go b/internal/domain/main-entities/unit/entity.go index c86ad822..2142790f 100644 --- a/internal/domain/main-entities/unit/entity.go +++ b/internal/domain/main-entities/unit/entity.go @@ -3,6 +3,7 @@ package unit import ( ecore "simrs-vx/internal/domain/base-entities/core" ei "simrs-vx/internal/domain/main-entities/installation" + eub "simrs-vx/internal/domain/main-entities/unit-position/base" ero "simrs-vx/internal/domain/references/organization" ) @@ -13,4 +14,5 @@ type Unit struct { Code string `json:"code" gorm:"unique;size:10"` Name string `json:"name" gorm:"size:50"` Type_Code *ero.UnitTypeCode `json:"type_code"` + UnitPositions []eub.Basic `json:"unitPositions,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` }