From 6c07024eb17c401ef82aa2d066817591a75d1117 Mon Sep 17 00:00:00 2001 From: Andrian Roshandy Date: Sat, 29 Nov 2025 20:50:06 +0700 Subject: [PATCH 1/8] Merge from 'dev' --- internal/infra/sync-consumer-cfg/tycovar.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 internal/infra/sync-consumer-cfg/tycovar.go diff --git a/internal/infra/sync-consumer-cfg/tycovar.go b/internal/infra/sync-consumer-cfg/tycovar.go new file mode 100644 index 00000000..d2146c2b --- /dev/null +++ b/internal/infra/sync-consumer-cfg/tycovar.go @@ -0,0 +1,11 @@ +package synccfg + +var O SyncConsumerUrlCfg = SyncConsumerUrlCfg{} // old + +type SyncConsumerUrlCfg struct { + Prefix string `yaml:"prefix"` + TargetHost string `yaml:"targetHost"` + Enable bool `yaml:"enable"` + Source string `yaml:"source"` + SecretKey string `yaml:"secretKey"` +} From b65c86750ab673866c46b21e7980e4d6c78e561d Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Mon, 1 Dec 2025 18:39:28 +0700 Subject: [PATCH 2/8] feat/action-report: new migration --- .../migrations/20251201113804.sql | 2 ++ .../migrations/20251201113858.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 4 ++- .../domain/main-entities/action-report/dto.go | 29 ++++++++++--------- .../main-entities/action-report/entity.go | 12 ++++---- 5 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 cmd/main-migration/migrations/20251201113804.sql create mode 100644 cmd/main-migration/migrations/20251201113858.sql diff --git a/cmd/main-migration/migrations/20251201113804.sql b/cmd/main-migration/migrations/20251201113804.sql new file mode 100644 index 00000000..0f5c5123 --- /dev/null +++ b/cmd/main-migration/migrations/20251201113804.sql @@ -0,0 +1,2 @@ +-- Modify "ActionReport" table +ALTER TABLE "public"."ActionReport" DROP COLUMN "Date", DROP COLUMN "Procedures"; diff --git a/cmd/main-migration/migrations/20251201113858.sql b/cmd/main-migration/migrations/20251201113858.sql new file mode 100644 index 00000000..fd6fddc9 --- /dev/null +++ b/cmd/main-migration/migrations/20251201113858.sql @@ -0,0 +1,2 @@ +-- Modify "ActionReport" table +ALTER TABLE "public"."ActionReport" ADD COLUMN "Date" timestamptz NOT NULL; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 8f71fcc5..db6de529 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:NUsCmkoiBso9yZsv4HWrn3+woqMcFRFtgXKln5rY4pQ= +h1:EpEYOCY46tEg91o5Y4scmFj3/yIyR311HaP95Ts3vus= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -133,3 +133,5 @@ h1:NUsCmkoiBso9yZsv4HWrn3+woqMcFRFtgXKln5rY4pQ= 20251126064057.sql h1:vAdhz5Nn/gGJy0UKZAEldeXv8HpHtJU/t8ygDVIbTsU= 20251201081333.sql h1:PoC8ADRdwDuohDTB74yW/DaB42igdYa4B6humbrEJBk= 20251201104439.sql h1:tpqdrOf9d2aGwZshqm62nG6SXnfVaO/g6A7z0efPS14= +20251201113804.sql h1:pR0nbmjJNDLi929vmGm2W9RKxLJ2iECzf2otO+JpKWA= +20251201113858.sql h1:JciS3xbCF94huB0qkGJ24YtS1a+nqV26hxzeKh2AOj0= diff --git a/internal/domain/main-entities/action-report/dto.go b/internal/domain/main-entities/action-report/dto.go index 1edb4a73..45c26d17 100644 --- a/internal/domain/main-entities/action-report/dto.go +++ b/internal/domain/main-entities/action-report/dto.go @@ -3,20 +3,21 @@ package actionreport import ( ecore "simrs-vx/internal/domain/base-entities/core" ee "simrs-vx/internal/domain/main-entities/encounter" + "time" pa "simrs-vx/internal/lib/auth" ) type CreateDto struct { - Encounter_Id uint64 `json:"encounter_id"` - Date string `json:"date"` - Doctor_Code string `json:"doctor_code"` - Operator_Employe_Id *uint `json:"operator_employe_id"` - Assistant_Employe_Id *uint `json:"assistant_employe_id"` - Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"` - Diagnose *string `json:"diagnose"` - Nurse_Code *string `json:"nurse_code"` - Value string `json:"value"` + Encounter_Id uint64 `json:"encounter_id" validate:"required"` + Date *time.Time `json:"date" validate:"required"` + Doctor_Code string `json:"doctor_code" validate:"required"` + Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"` + Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"` + Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"` + Diagnose *string `json:"diagnose"` + Nurse_Code string `json:"nurse_code" validate:"required"` + Value string `json:"value" validate:"required"` pa.AuthInfo } @@ -54,13 +55,13 @@ type ResponseDto struct { ecore.Main Encounter_Id uint64 `json:"encounter_id"` Encounter *ee.Encounter `json:"encounter,omitempty"` - Date string `json:"date"` + Date *time.Time `json:"date"` Doctor_Code string `json:"doctor_code"` - Operator_Employe_Id *uint `json:"operator_employe_id"` - Assistant_Employe_Id *uint `json:"assistant_employe_id"` - Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"` + Operator_Employe_Id uint `json:"operator_employe_id"` + Assistant_Employe_Id uint `json:"assistant_employe_id"` + Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"` Diagnose *string `json:"diagnose"` - Nurse_Code *string `json:"nurse_code"` + Nurse_Code string `json:"nurse_code"` Value *string `json:"value"` } diff --git a/internal/domain/main-entities/action-report/entity.go b/internal/domain/main-entities/action-report/entity.go index 3437136e..b3fc1956 100644 --- a/internal/domain/main-entities/action-report/entity.go +++ b/internal/domain/main-entities/action-report/entity.go @@ -3,20 +3,20 @@ package actionreport import ( ecore "simrs-vx/internal/domain/base-entities/core" ee "simrs-vx/internal/domain/main-entities/encounter" + "time" ) type ActionReport struct { ecore.Main // adjust this according to the needs Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"` Encounter *ee.Encounter `json:"doctor,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` - Date string `json:"date" gorm:"not null;size:20"` + Date *time.Time `json:"date" gorm:"not null;size:20"` Doctor_Code string `json:"doctor_code" gorm:"size:10"` - Operator_Employe_Id *uint `json:"operator_employe_id"` - Assistant_Employe_Id *uint `json:"assistant_employe_id"` - Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"` + Operator_Employe_Id uint `json:"operator_employe_id"` + Assistant_Employe_Id uint `json:"assistant_employe_id"` + Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"` Diagnose *string `json:"diagnose" gorm:"size:1024"` - Procedures *string `json:"procedures" gorm:"size:10240"` - Nurse_Code *string `json:"nurse_code" gorm:"size:10"` + Nurse_Code string `json:"nurse_code" gorm:"size:10"` Value string `json:"value"` // SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"` From 47d2e427c0d75a4e5f937291e4911194625530ea Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Mon, 1 Dec 2025 18:49:54 +0700 Subject: [PATCH 3/8] feat/action-report: adjust table structure --- cmd/main-migration/migrations/20251201114751.sql | 2 ++ cmd/main-migration/migrations/20251201114913.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 8 +++++--- .../domain/main-entities/action-report/entity.go | 12 +++++++++--- 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 cmd/main-migration/migrations/20251201114751.sql create mode 100644 cmd/main-migration/migrations/20251201114913.sql diff --git a/cmd/main-migration/migrations/20251201114751.sql b/cmd/main-migration/migrations/20251201114751.sql new file mode 100644 index 00000000..6611b811 --- /dev/null +++ b/cmd/main-migration/migrations/20251201114751.sql @@ -0,0 +1,2 @@ +-- Modify "ActionReport" table +ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Instrumentor_Employe" FOREIGN KEY ("Instrumentor_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Nurse" FOREIGN KEY ("Nurse_Code") REFERENCES "public"."Nurse" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Operator_Employe" FOREIGN KEY ("Operator_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION; diff --git a/cmd/main-migration/migrations/20251201114913.sql b/cmd/main-migration/migrations/20251201114913.sql new file mode 100644 index 00000000..5155ed37 --- /dev/null +++ b/cmd/main-migration/migrations/20251201114913.sql @@ -0,0 +1,2 @@ +-- Modify "ActionReport" table +ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index db6de529..51161909 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:EpEYOCY46tEg91o5Y4scmFj3/yIyR311HaP95Ts3vus= +h1:bYhAmgY4p8jgE8JpZ6YeJyS1iYCH2LEvDXW2PE+iZpc= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -133,5 +133,7 @@ h1:EpEYOCY46tEg91o5Y4scmFj3/yIyR311HaP95Ts3vus= 20251126064057.sql h1:vAdhz5Nn/gGJy0UKZAEldeXv8HpHtJU/t8ygDVIbTsU= 20251201081333.sql h1:PoC8ADRdwDuohDTB74yW/DaB42igdYa4B6humbrEJBk= 20251201104439.sql h1:tpqdrOf9d2aGwZshqm62nG6SXnfVaO/g6A7z0efPS14= -20251201113804.sql h1:pR0nbmjJNDLi929vmGm2W9RKxLJ2iECzf2otO+JpKWA= -20251201113858.sql h1:JciS3xbCF94huB0qkGJ24YtS1a+nqV26hxzeKh2AOj0= +20251201113804.sql h1:kIEmVoETJXBkab2Q+b3y/pP84eF8W2BdQ47amHCnc+c= +20251201113858.sql h1:KLXKZO5XTQPoEU0YLHE8Fhg9WPKpSN3wNgYPJ+RGFcg= +20251201114751.sql h1:QMcFLz4vr6lwQ03k0Wthhosce743DW9A3w6WJzfqjoU= +20251201114913.sql h1:GvRLyn62Z5CIckonFhtHOZKbJK43yyoCXUfFiADLiAo= diff --git a/internal/domain/main-entities/action-report/entity.go b/internal/domain/main-entities/action-report/entity.go index b3fc1956..8447a2e5 100644 --- a/internal/domain/main-entities/action-report/entity.go +++ b/internal/domain/main-entities/action-report/entity.go @@ -2,23 +2,29 @@ package actionreport import ( ecore "simrs-vx/internal/domain/base-entities/core" + ed "simrs-vx/internal/domain/main-entities/doctor" + eem "simrs-vx/internal/domain/main-entities/employee" ee "simrs-vx/internal/domain/main-entities/encounter" + en "simrs-vx/internal/domain/main-entities/nurse" "time" ) type ActionReport struct { ecore.Main // adjust this according to the needs Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"` - Encounter *ee.Encounter `json:"doctor,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` + Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` Date *time.Time `json:"date" gorm:"not null;size:20"` Doctor_Code string `json:"doctor_code" gorm:"size:10"` + Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"` Operator_Employe_Id uint `json:"operator_employe_id"` + Operator_Employe *eem.Employee `json:"operator_employe,omitempty" gorm:"foreignKey:Operator_Employe_Id;references:Id"` Assistant_Employe_Id uint `json:"assistant_employe_id"` Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"` + Instrumentor_Employe *eem.Employee `json:"instrumentor_employe,omitempty" gorm:"foreignKey:Instrumentor_Employe_Id;references:Id"` Diagnose *string `json:"diagnose" gorm:"size:1024"` Nurse_Code string `json:"nurse_code" gorm:"size:10"` - - Value string `json:"value"` + Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"` + Value string `json:"value"` // SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"` // Billing_Code *string `json:"billing_code" gorm:"size:10"` // SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"` From 17bf6cd2ae0c3280435cf72c2fbf211c6dff3d20 Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Mon, 1 Dec 2025 20:12:13 +0700 Subject: [PATCH 4/8] feat/mcu-order: wip --- .../mcu-order-sub-item/base/entity.go | 17 +++++++++++++++++ .../main-entities/mcu-order-sub-item/entity.go | 12 ++++-------- .../main-entities/mcu-src-category/dto.go | 10 +++++----- .../main-entities/mcu-src-category/entity.go | 2 +- internal/domain/references/clinical/clinical.go | 8 ++++++-- 5 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 internal/domain/main-entities/mcu-order-sub-item/base/entity.go diff --git a/internal/domain/main-entities/mcu-order-sub-item/base/entity.go b/internal/domain/main-entities/mcu-order-sub-item/base/entity.go new file mode 100644 index 00000000..fea105a4 --- /dev/null +++ b/internal/domain/main-entities/mcu-order-sub-item/base/entity.go @@ -0,0 +1,17 @@ +package mcuordersubitem + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + emss "simrs-vx/internal/domain/main-entities/mcu-sub-src" + + erc "simrs-vx/internal/domain/references/common" +) + +type McuOrderSubItem struct { + ecore.Main // adjust this according to the needs + McuSubSrc_Code *string `json:"mcuSubSrc_code" gorm:"uniqueIndex:idx_order_sub_src"` + McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Code;references:Code"` + McuOrderItem_Id *uint `json:"mcuOrderItem_id" gorm:"uniqueIndex:idx_order_sub_src"` + Result *string `json:"result"` + Status_Code erc.DataStatusCode `json:"status_code"` +} diff --git a/internal/domain/main-entities/mcu-order-sub-item/entity.go b/internal/domain/main-entities/mcu-order-sub-item/entity.go index a9bde496..990cd048 100644 --- a/internal/domain/main-entities/mcu-order-sub-item/entity.go +++ b/internal/domain/main-entities/mcu-order-sub-item/entity.go @@ -3,19 +3,15 @@ package mcuordersubitem import ( ecore "simrs-vx/internal/domain/base-entities/core" emoi "simrs-vx/internal/domain/main-entities/mcu-order-item" - emss "simrs-vx/internal/domain/main-entities/mcu-sub-src" + eb "simrs-vx/internal/domain/main-entities/mcu-order-sub-item/base" erc "simrs-vx/internal/domain/references/common" ) type McuOrderSubItem struct { - ecore.Main // adjust this according to the needs - McuSubSrc_Code *string `json:"mcuSubSrc_code" gorm:"uniqueIndex:idx_order_sub_src"` - McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Code;references:Code"` - McuOrderItem_Id *uint `json:"mcuOrderItem_id" gorm:"uniqueIndex:idx_order_sub_src"` - McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"` - Result *string `json:"result"` - Status_Code erc.DataStatusCode `json:"status_code"` + ecore.Main // adjust this according to the needs + eb.McuOrderSubItem + McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"` } func (d McuOrderSubItem) IsCompleted() bool { diff --git a/internal/domain/main-entities/mcu-src-category/dto.go b/internal/domain/main-entities/mcu-src-category/dto.go index f9bb7d00..e1ef57d9 100644 --- a/internal/domain/main-entities/mcu-src-category/dto.go +++ b/internal/domain/main-entities/mcu-src-category/dto.go @@ -1,4 +1,4 @@ -package division +package mcusrccategory import ( ecore "simrs-vx/internal/domain/base-entities/core" @@ -20,10 +20,10 @@ type ReadListDto struct { } type FilterDto struct { - Code string `json:"code"` - Name string `json:"name"` - Scope_Code *erc.McuScopeCode `json:"scope-code"` - Search string `json:"search" gormhelper:"searchColumns=Code,Name"` + Code *string `json:"code"` + Name *string `json:"name"` + Scope_Code *string `json:"scope-code"` + Search string `json:"search" gormhelper:"searchColumns=Code,Name"` } type ReadDetailDto struct { diff --git a/internal/domain/main-entities/mcu-src-category/entity.go b/internal/domain/main-entities/mcu-src-category/entity.go index 8fc801b9..2175552c 100644 --- a/internal/domain/main-entities/mcu-src-category/entity.go +++ b/internal/domain/main-entities/mcu-src-category/entity.go @@ -1,4 +1,4 @@ -package division +package mcusrccategory import ( ecore "simrs-vx/internal/domain/base-entities/core" diff --git a/internal/domain/references/clinical/clinical.go b/internal/domain/references/clinical/clinical.go index 7a3a2ec1..43305a99 100644 --- a/internal/domain/references/clinical/clinical.go +++ b/internal/domain/references/clinical/clinical.go @@ -196,8 +196,12 @@ const ( TSCTeam TranslatorSrcCode = "team" // Tim Penerjemah TSCFamily TranslatorSrcCode = "family" // Keluarga - SFTCA ScreeningFormTypeCode = "form-a" // Formu A - SFTCB ScreeningFormTypeCode = "form-b" // Formu B + SFTCA ScreeningFormTypeCode = "form-a" // Formu A + SFTCB ScreeningFormTypeCode = "form-b" // Formu B + MSCRadiology McuScopeCode = "radiology" + MSCCpLab McuScopeCode = "cp-lab" + MSCMicroLab McuScopeCode = "micro-lab" + MSCApLab McuScopeCode = "ap-lab" SSCSmall SurgerySizeCode = "" SSCMedium SurgerySizeCode = "" From 29d11c0e0089214cc8acbb5b184f0f3250b9a9e0 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Tue, 2 Dec 2025 10:07:31 +0700 Subject: [PATCH 5/8] (screening): add file-url and status --- cmd/main-migration/migrations/20251202030445.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 5 +++-- internal/domain/main-entities/screening/entity.go | 3 +++ internal/domain/references/organization/organization.go | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 cmd/main-migration/migrations/20251202030445.sql diff --git a/cmd/main-migration/migrations/20251202030445.sql b/cmd/main-migration/migrations/20251202030445.sql new file mode 100644 index 00000000..6026dd58 --- /dev/null +++ b/cmd/main-migration/migrations/20251202030445.sql @@ -0,0 +1,2 @@ +-- Modify "Screening" table +ALTER TABLE "public"."Screening" ADD COLUMN "Status" text NULL, ADD COLUMN "FileUrl" character varying(1024) NULL; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 5753c626..806ee054 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:6lWgIJo0vUBd7Bo4B3YMvyDpJsOTVzVfqRQ03ad9r1s= +h1:XoKMjGA4FCg2pZKaGZmX61liDEkRUDnYo+NyFKmtikw= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -131,4 +131,5 @@ h1:6lWgIJo0vUBd7Bo4B3YMvyDpJsOTVzVfqRQ03ad9r1s= 20251124071457.sql h1:qg2dhCL9YwD13xnfJ175lW/p6MGfzFKaBqd908FByRc= 20251125125303.sql h1:4JSFv1Pmhbe9tqpLXgO63OwYnGsalStgUXKVWPyc1YE= 20251126064057.sql h1:vAdhz5Nn/gGJy0UKZAEldeXv8HpHtJU/t8ygDVIbTsU= -20251201081333.sql h1:1946fD7iMnf18FjYzVNoHu6suWSDMfjaF2R7jx5gjo0= +20251201081333.sql h1:PoC8ADRdwDuohDTB74yW/DaB42igdYa4B6humbrEJBk= +20251202030445.sql h1:9VbV03AMtKKPagtLKl4+hZrE6mMFV6DG78Gn7QOsFXI= diff --git a/internal/domain/main-entities/screening/entity.go b/internal/domain/main-entities/screening/entity.go index ebdb735b..a6284c16 100644 --- a/internal/domain/main-entities/screening/entity.go +++ b/internal/domain/main-entities/screening/entity.go @@ -5,6 +5,7 @@ import ( eem "simrs-vx/internal/domain/main-entities/employee" erc "simrs-vx/internal/domain/references/clinical" + erco "simrs-vx/internal/domain/references/common" ) type Screening struct { @@ -13,5 +14,7 @@ type Screening struct { Employee_Id *uint `json:"employee_id"` Employee *eem.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` Type erc.ScreeningFormTypeCode `json:"type"` + Status erco.DataVerifiedCode `json:"status"` Value *string `json:"value"` + FileUrl *string `json:"fileUrl" gorm:"size:1024"` } diff --git a/internal/domain/references/organization/organization.go b/internal/domain/references/organization/organization.go index e12531cd..e522a35e 100644 --- a/internal/domain/references/organization/organization.go +++ b/internal/domain/references/organization/organization.go @@ -24,6 +24,7 @@ const ( EPCLab EmployeePositionCode = "lab" // Laboran EPCPha EmployeePositionCode = "pha" // Farmasi EPCNom EmployeePositionCode = "nom" // Non Medic + EPCScr EmployeePositionCode = "scr" // Screening MPP // EPCPay EmployeePositionCode = "pay" // Pembayaran // EPCHur EmployeePositionCode = "hue" // Sumber Daya Manusia // EPCGea EmployeePositionCode = "gea" // Bagian Umum From f4f47118824bf1b6fbb3a21ec78d204c3b509404 Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Tue, 2 Dec 2025 11:46:02 +0700 Subject: [PATCH 6/8] feat/mcu-order: adjust entity --- cmd/main-migration/migrations/20251202044430.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 8 +++++--- internal/domain/main-entities/item/dto.go | 4 ++++ internal/domain/main-entities/item/entity.go | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 cmd/main-migration/migrations/20251202044430.sql diff --git a/cmd/main-migration/migrations/20251202044430.sql b/cmd/main-migration/migrations/20251202044430.sql new file mode 100644 index 00000000..308b72a7 --- /dev/null +++ b/cmd/main-migration/migrations/20251202044430.sql @@ -0,0 +1,2 @@ +-- Modify "Item" table +ALTER TABLE "public"."Item" ADD COLUMN "BuyingPrice" numeric NULL, ADD COLUMN "SellingPrice" numeric NULL; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 51161909..871cc312 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:bYhAmgY4p8jgE8JpZ6YeJyS1iYCH2LEvDXW2PE+iZpc= +h1:Ha8JZHXBp6W+fzzWOIT8TuDGwBAPu7d/JQa4hxKMCRw= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -135,5 +135,7 @@ h1:bYhAmgY4p8jgE8JpZ6YeJyS1iYCH2LEvDXW2PE+iZpc= 20251201104439.sql h1:tpqdrOf9d2aGwZshqm62nG6SXnfVaO/g6A7z0efPS14= 20251201113804.sql h1:kIEmVoETJXBkab2Q+b3y/pP84eF8W2BdQ47amHCnc+c= 20251201113858.sql h1:KLXKZO5XTQPoEU0YLHE8Fhg9WPKpSN3wNgYPJ+RGFcg= -20251201114751.sql h1:QMcFLz4vr6lwQ03k0Wthhosce743DW9A3w6WJzfqjoU= -20251201114913.sql h1:GvRLyn62Z5CIckonFhtHOZKbJK43yyoCXUfFiADLiAo= +20251201114751.sql h1:HM17diiPknfSHAmP+kJGP6GzToaPU9/NT+KQBpf3Jq0= +20251201114913.sql h1:gqucFgHFFLA6n/Rdz486cZH5xkaJuwefESLJMJLDue8= +20251202030445.sql h1:QWBVfTepT7DaXP5E0BYoxNM0JwKIQ2qIMXzI4kbz/qE= +20251202044430.sql h1:OC5NTh0Jf8NNLVTRIvNImPiaMqJfDWkksxWcKq3UjDE= diff --git a/internal/domain/main-entities/item/dto.go b/internal/domain/main-entities/item/dto.go index f20ce217..686a5c17 100644 --- a/internal/domain/main-entities/item/dto.go +++ b/internal/domain/main-entities/item/dto.go @@ -62,6 +62,8 @@ type ResponseDto struct { Uom *eu.Uom `json:"uom,omitempty"` Infra_Code *string `json:"infra_code"` Stock *int `json:"stock"` + BuyingPrice *float64 `json:"buyingPrice"` + SellingPrice *float64 `json:"sellingPrice"` } func (d Item) ToResponse() ResponseDto { @@ -73,6 +75,8 @@ func (d Item) ToResponse() ResponseDto { Uom: d.Uom, Infra_Code: d.Infra_Code, Stock: d.Stock, + BuyingPrice: d.BuyingPrice, + SellingPrice: d.SellingPrice, } resp.Main = d.Main return resp diff --git a/internal/domain/main-entities/item/entity.go b/internal/domain/main-entities/item/entity.go index fc721713..55ca2d18 100644 --- a/internal/domain/main-entities/item/entity.go +++ b/internal/domain/main-entities/item/entity.go @@ -16,4 +16,6 @@ type Item struct { Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"` Infra_Code *string `json:"infra_code" gorm:"size:10"` Stock *int `json:"stock"` + BuyingPrice *float64 `json:"buyingPrice"` + SellingPrice *float64 `json:"settlingPrice"` } From 050ba953e1df7fcedc3f1b352b5a3c3f31d579d7 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Tue, 2 Dec 2025 13:42:55 +0700 Subject: [PATCH 7/8] update size type soapi --- cmd/main-migration/migrations/20251202064000.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 5 +++-- internal/domain/main-entities/soapi/entity.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 cmd/main-migration/migrations/20251202064000.sql diff --git a/cmd/main-migration/migrations/20251202064000.sql b/cmd/main-migration/migrations/20251202064000.sql new file mode 100644 index 00000000..7fed5f08 --- /dev/null +++ b/cmd/main-migration/migrations/20251202064000.sql @@ -0,0 +1,2 @@ +-- Modify "Soapi" table +ALTER TABLE "public"."Soapi" ALTER COLUMN "TypeCode" TYPE character varying(15); diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 871cc312..8db69226 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:Ha8JZHXBp6W+fzzWOIT8TuDGwBAPu7d/JQa4hxKMCRw= +h1:uY633gN3JQVVq1z4wKVtoTt3D/bOrBmBqSgjzNxIY7U= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -138,4 +138,5 @@ h1:Ha8JZHXBp6W+fzzWOIT8TuDGwBAPu7d/JQa4hxKMCRw= 20251201114751.sql h1:HM17diiPknfSHAmP+kJGP6GzToaPU9/NT+KQBpf3Jq0= 20251201114913.sql h1:gqucFgHFFLA6n/Rdz486cZH5xkaJuwefESLJMJLDue8= 20251202030445.sql h1:QWBVfTepT7DaXP5E0BYoxNM0JwKIQ2qIMXzI4kbz/qE= -20251202044430.sql h1:OC5NTh0Jf8NNLVTRIvNImPiaMqJfDWkksxWcKq3UjDE= +20251202044430.sql h1:4QZH9lz0GrQ9rzP1AJ+hJgGalNpp+8FCRckNK7xaTbU= +20251202064000.sql h1:CcrTalr9bg48srSwCzcswS/erCTD93y72+cINyrHp2o= diff --git a/internal/domain/main-entities/soapi/entity.go b/internal/domain/main-entities/soapi/entity.go index 7e457ca9..d67f692a 100644 --- a/internal/domain/main-entities/soapi/entity.go +++ b/internal/domain/main-entities/soapi/entity.go @@ -17,6 +17,6 @@ type Soapi struct { Employee_Id *uint `json:"employee_id"` Employee *eem.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` Time *time.Time `json:"time"` - TypeCode erc.SoapiTypeCode `json:"type_code" gorm:"size:11"` + TypeCode erc.SoapiTypeCode `json:"type_code" gorm:"size:15"` Value *string `json:"value"` } From fd7609b080ee2e687f3da9145898627b546d06c6 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Tue, 2 Dec 2025 14:14:05 +0700 Subject: [PATCH 8/8] add amb-resume into soapitypecode --- internal/domain/references/clinical/clinical.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/domain/references/clinical/clinical.go b/internal/domain/references/clinical/clinical.go index 43305a99..91642b1e 100644 --- a/internal/domain/references/clinical/clinical.go +++ b/internal/domain/references/clinical/clinical.go @@ -133,6 +133,7 @@ const ( STCDevRecord SoapiTypeCode = "dev-record" // Catatan Perkembangan STCKfrAdm SoapiTypeCode = "kfr-adm" // soapi untuk kfr STCKfrSeries SoapiTypeCode = "kfr-series" // soapi untuk kfr + STCAmbResume SoapiTypeCode = "amb-resume" // Rajal resume MATCChemo MedicalActionTypeCode = "chemo" MATCHemo MedicalActionTypeCode = "hemo"