add entity sync for division, specialist and subspecialist
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
-- Create "DivisionLink" table
|
||||
CREATE TABLE "public"."DivisionLink" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Simx_Id" bigint NULL,
|
||||
"Simgos_Id" bigint NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "uni_DivisionLink_Simgos_Id" UNIQUE ("Simgos_Id"),
|
||||
CONSTRAINT "uni_DivisionLink_Simx_Id" UNIQUE ("Simx_Id")
|
||||
);
|
||||
-- Create "DivisionSimgosLog" table
|
||||
CREATE TABLE "public"."DivisionSimgosLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "DivisionSimxLog" table
|
||||
CREATE TABLE "public"."DivisionSimxLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "SpecialistLink" table
|
||||
CREATE TABLE "public"."SpecialistLink" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Simx_Id" bigint NULL,
|
||||
"Simgos_Id" bigint NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "uni_SpecialistLink_Simgos_Id" UNIQUE ("Simgos_Id"),
|
||||
CONSTRAINT "uni_SpecialistLink_Simx_Id" UNIQUE ("Simx_Id")
|
||||
);
|
||||
-- Create "SpecialistSimgosLog" table
|
||||
CREATE TABLE "public"."SpecialistSimgosLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "SpecialistSimxLog" table
|
||||
CREATE TABLE "public"."SpecialistSimxLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "SubspecialistLink" table
|
||||
CREATE TABLE "public"."SubspecialistLink" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Simx_Id" bigint NULL,
|
||||
"Simgos_Id" bigint NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "uni_SubspecialistLink_Simgos_Id" UNIQUE ("Simgos_Id"),
|
||||
CONSTRAINT "uni_SubspecialistLink_Simx_Id" UNIQUE ("Simx_Id")
|
||||
);
|
||||
-- Create "SubspecialistSimgosLog" table
|
||||
CREATE TABLE "public"."SubspecialistSimgosLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "SubspecialistSimxLog" table
|
||||
CREATE TABLE "public"."SubspecialistSimxLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
@@ -1,3 +1,4 @@
|
||||
h1:xxkaO6rL13nwrZd1vrsoGJrrwCtXPgGRmwGEjWJ1V/c=
|
||||
h1:SN+f41iFH0m63kHeZHYricAjil5GJ9EC0LBOSdFDnmY=
|
||||
20251113035508.sql h1:rjDlu6yDdy5xv6nrCOr7NialrLSLT23pzduYNq29Hf0=
|
||||
20251114071129.sql h1:O4nfv4l9vcXpE2Kyu7vjnubD8kDZ7JltRaF2auOdMpc=
|
||||
20251114071129.sql h1:Z0GQ5bJo3C+tplaWzxT8n3J9HLkEaVsRVp5nn7bmYow=
|
||||
20251117041601.sql h1:mIxZ2luKQREXUBY36PwLNDFI/Wf1T6Z2DDoGOueXFwI=
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package division
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type DivisionLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type DivisionSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type DivisionSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package specialist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SpecialistLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type SpecialistSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type SpecialistSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package subspecialist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SubspecialistLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type SubspecialistSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type SubspecialistSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func getEntities(input string) []any {
|
||||
case "satusehat":
|
||||
return getSatuSehatEntities()
|
||||
case "simgossync":
|
||||
return getSimgosSyncEntities()
|
||||
return getSyncEntities()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package migration
|
||||
|
||||
import (
|
||||
/************** Source ***************/
|
||||
division "simrs-vx/internal/domain/sync-entities/division"
|
||||
installation "simrs-vx/internal/domain/sync-entities/installation"
|
||||
specialist "simrs-vx/internal/domain/sync-entities/specialist"
|
||||
subspecialist "simrs-vx/internal/domain/sync-entities/subspecialist"
|
||||
unit "simrs-vx/internal/domain/sync-entities/unit"
|
||||
)
|
||||
|
||||
func getSimgosSyncEntities() []any {
|
||||
func getSyncEntities() []any {
|
||||
return []any{
|
||||
&installation.InstallationLink{},
|
||||
&installation.InstallationSimxLog{},
|
||||
@@ -14,5 +17,14 @@ func getSimgosSyncEntities() []any {
|
||||
&unit.UnitLink{},
|
||||
&unit.UnitSimxLog{},
|
||||
&unit.UnitSimgosLog{},
|
||||
&division.DivisionLink{},
|
||||
&division.DivisionSimxLog{},
|
||||
&division.DivisionSimgosLog{},
|
||||
&specialist.SpecialistLink{},
|
||||
&specialist.SpecialistSimxLog{},
|
||||
&specialist.SpecialistSimgosLog{},
|
||||
&subspecialist.SubspecialistLink{},
|
||||
&subspecialist.SubspecialistSimxLog{},
|
||||
&subspecialist.SubspecialistSimgosLog{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user