From df46ba33356d578dfa1735519a610d705d1967d8 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Mon, 29 Sep 2025 10:47:28 +0700 Subject: [PATCH 1/2] fix (soapi): add type code --- internal/domain/main-entities/soapi/dto.go | 37 +++++++++++-------- .../use-case/main-use-case/soapi/helper.go | 1 + 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/internal/domain/main-entities/soapi/dto.go b/internal/domain/main-entities/soapi/dto.go index 6aac522e..172b38b2 100644 --- a/internal/domain/main-entities/soapi/dto.go +++ b/internal/domain/main-entities/soapi/dto.go @@ -1,19 +1,23 @@ package soapi import ( + "time" + ecore "simrs-vx/internal/domain/base-entities/core" eem "simrs-vx/internal/domain/main-entities/employee" ee "simrs-vx/internal/domain/main-entities/encounter" + erc "simrs-vx/internal/domain/references/clinical" + pa "simrs-vx/pkg/auth-helper" - "time" ) type CreateDto struct { - Encounter_Id *uint `json:"encounter_id"` - Employee_Id *uint `json:"-"` - Time *time.Time `json:"time"` - Value *string `json:"value"` + Encounter_Id *uint `json:"encounter_id"` + Employee_Id *uint `json:"-"` + Time *time.Time `json:"time"` + TypeCode erc.SoapiTypeCode `json:"typeCode"` + Value *string `json:"value"` pa.AuthInfo } @@ -25,10 +29,11 @@ type ReadListDto struct { } type FilterDto struct { - Encounter_Id *uint `json:"encounter_id"` - Employee_Id *uint `json:"employee_id"` - Time *time.Time `json:"time"` - Value *string `json:"value"` + Encounter_Id *uint `json:"encounter_id"` + Employee_Id *uint `json:"employee_id"` + Time *time.Time `json:"time"` + TypeCode erc.SoapiTypeCode `json:"typeCode"` + Value *string `json:"value"` Page int `json:"page"` PageSize int `json:"page_size"` @@ -56,12 +61,13 @@ type MetaDto struct { type ResponseDto struct { ecore.Main - Encounter_Id *uint `json:"encounter_id"` - Encounter *ee.Encounter `json:"encounter,omitempty"` - Employee_Id *uint `json:"employee_id"` - Employee *eem.Employee `json:"employee,omitempty"` - Time *time.Time `json:"time"` - Value *string `json:"value"` + Encounter_Id *uint `json:"encounter_id"` + Encounter *ee.Encounter `json:"encounter,omitempty"` + Employee_Id *uint `json:"employee_id"` + Employee *eem.Employee `json:"employee,omitempty"` + Time *time.Time `json:"time"` + TypeCode erc.SoapiTypeCode `json:"typeCode"` + Value *string `json:"value"` } func (d Soapi) ToResponse() ResponseDto { @@ -71,6 +77,7 @@ func (d Soapi) ToResponse() ResponseDto { Employee_Id: d.Employee_Id, Employee: d.Employee, Time: d.Time, + TypeCode: d.TypeCode, Value: d.Value, } resp.Main = d.Main diff --git a/internal/use-case/main-use-case/soapi/helper.go b/internal/use-case/main-use-case/soapi/helper.go index 504acff6..5a94848a 100644 --- a/internal/use-case/main-use-case/soapi/helper.go +++ b/internal/use-case/main-use-case/soapi/helper.go @@ -20,5 +20,6 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Soapi) { data.Encounter_Id = inputSrc.Encounter_Id data.Employee_Id = inputSrc.Employee_Id data.Time = inputSrc.Time + data.TypeCode = inputSrc.TypeCode data.Value = inputSrc.Value } From ff026914c4863041ca799b5f80956a051a60f700 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Tue, 30 Sep 2025 09:39:51 +0700 Subject: [PATCH 2/2] rerun atlas migration --- cmd/main-migration/migrations/atlas.sum | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 9bdd6275..7d3543b4 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:xkdKsHk/4s72juNsRgWubyMR4XEXjEQ38+XI4m/e/jM= +h1:UQi1THfG0QI80rmHgbXNK/vgQv+5eUA5VRy3zqfWdbI= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -17,5 +17,5 @@ h1:xkdKsHk/4s72juNsRgWubyMR4XEXjEQ38+XI4m/e/jM= 20250918074745.sql h1:2hNVQCXF/dVYXAh+T/7oBFgERGWxzVb2FXJjwkFWGCI= 20250923025134.sql h1:Ykz/qpHiGDXPsCsWTjydQFVSibZP2D+h2fIeb2h2JGA= 20250924051317.sql h1:yQuW6SwJxIOM5fcxeAaie5lSm1oLysU/C2hH2xNCVoQ= -20250929034321.sql h1:Pjs8W2zK7Q6Nwta/xpYE7YdfT+JfIMHjgWfDK2hnaEI= -20250929034428.sql h1:w3JomY0HxQJIdHA6Pq7mixJNi1YcO8NpQMjIfhNw+oA= +20250929034321.sql h1:101FJ8VH12mrZWlt/X1gvKUGOhoiF8tFbjiapAjnHzg= +20250929034428.sql h1:i+pROD9p+g5dOmmZma6WF/0Hw5g3Ha28NN85iTo1K34=