Merge branch 'migration' of https://github.com/dikstub-rssa/simrs-be into feat/sync-installation

# Conflicts:
#	cmd/main-migration/migrations/atlas.sum
This commit is contained in:
vanilia
2025-11-14 09:58:04 +07:00
98 changed files with 2078 additions and 324 deletions

No files matched your search

@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
}
type ReadListDto struct {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
Regency_Code string `json:"regency_code" validate:"numeric;maxLength=4"`
Code string `json:"code" validate:"numeric;maxLength=6"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
Regency_Code string `json:"regency_code" validate:"numeric;maxLength=4"`
Code *string `json:"code" validate:"numeric;maxLength=6"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -6,7 +6,7 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Code *string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
Regency_Code *string `json:"regency_code" validate:"maxLength=4"`
Address string `json:"address" validate:"maxLength=100"`
@@ -30,18 +30,19 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
PhoneNumber *string `json:"phoneNumber"`
}
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 {
@@ -7,7 +7,7 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Code *string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
Scope_Code erc.McuScopeCode `json:"scope_code" validate:"maxLength=10"`
}
@@ -27,17 +27,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
@@ -0,0 +1,67 @@
package medicineform
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Code *string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Code string `json:"code"`
Name string `json:"name"`
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
}
type ReadDetailDto struct {
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.SmallMain
Code string `json:"code"`
Name string `json:"name"`
}
func (d MedicineForm) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
}
resp.SmallMain = d.SmallMain
return resp
}
func ToResponseList(data []MedicineForm) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,11 @@
package medicineform
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type MedicineForm struct {
ecore.SmallMain // adjust this according to the needs
Code string `json:"code" gorm:"unique;size:20"`
Name string `json:"name" gorm:"size:50"`
}
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,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 {
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
@@ -4,6 +4,7 @@ import (
ecore "simrs-vx/internal/domain/base-entities/core"
ein "simrs-vx/internal/domain/main-entities/infra"
eit "simrs-vx/internal/domain/main-entities/item"
emf "simrs-vx/internal/domain/main-entities/medicine-form"
emg "simrs-vx/internal/domain/main-entities/medicine-group"
emm "simrs-vx/internal/domain/main-entities/medicine-method"
eu "simrs-vx/internal/domain/main-entities/uom"
@@ -71,6 +72,8 @@ type ResponseDto struct {
MedicineGroup *emg.MedicineGroup `json:"medicineGroup"`
MedicineMethod_Code *string `json:"medicineMethod_code"`
MedicineMethod *emm.MedicineMethod `json:"medicineMethod"`
MedicineForm_Code *string `json:"medicineForm_code"`
MedicineForm *emf.MedicineForm `json:"medicineForm"`
Uom_Code *string `json:"uom_code"`
Uom *eu.Uom `json:"uom"`
Dose uint8 `json:"dose"`
@@ -89,6 +92,8 @@ func (d Medicine) ToResponse() ResponseDto {
MedicineGroup: d.MedicineGroup,
MedicineMethod_Code: d.MedicineMethod_Code,
MedicineMethod: d.MedicineMethod,
MedicineForm_Code: d.MedicineForm_Code,
MedicineForm: d.MedicineForm,
Uom_Code: d.Uom_Code,
Uom: d.Uom,
Dose: d.Dose,
@@ -4,6 +4,7 @@ import (
ecore "simrs-vx/internal/domain/base-entities/core"
ein "simrs-vx/internal/domain/main-entities/infra"
eit "simrs-vx/internal/domain/main-entities/item"
emf "simrs-vx/internal/domain/main-entities/medicine-form"
emg "simrs-vx/internal/domain/main-entities/medicine-group"
emm "simrs-vx/internal/domain/main-entities/medicine-method"
eu "simrs-vx/internal/domain/main-entities/uom"
@@ -17,6 +18,8 @@ type Medicine struct {
MedicineGroup *emg.MedicineGroup `json:"medicineGroup,omitempty" gorm:"foreignKey:MedicineGroup_Code;references:Code"`
MedicineMethod_Code *string `json:"medicineMethod_code" gorm:"size:10"`
MedicineMethod *emm.MedicineMethod `json:"medicineMethod,omitempty" gorm:"foreignKey:MedicineMethod_Code;references:Code"`
MedicineForm_Code *string `json:"medicineForm_code" gorm:"size:20"`
MedicineForm *emf.MedicineForm `json:"medicineForm,omitempty" gorm:"foreignKey:MedicineForm_Code;references:Code"`
Uom_Code *string `json:"uom_code" gorm:"size:10"`
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
Dose uint8 `json:"dose"`
@@ -24,19 +24,20 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
}
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 {
@@ -24,19 +24,20 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
}
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 {
@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=100"`
Regency_Code string `json:"regency_code" validate:"maxLength=4"`
Code *string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=100"`
Regency_Code string `json:"regency_code" validate:"maxLength=4"`
}
type ReadListDto struct {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
@@ -6,8 +6,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"numeric;maxLength=5"`
Village_Code string `json:"village_code" validate:"numeric;maxLength=10"`
Code *string `json:"code" validate:"numeric;maxLength=5"`
Village_Code string `json:"village_code" validate:"numeric;maxLength=10"`
}
type ReadListDto struct {
@@ -24,17 +24,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -19,7 +19,7 @@ type CreateDto struct {
Usage string `json:"usage"`
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
IntervalMultiplier *uint16 `json:"intervalMultiplier" validate:"required"`
IntervalMultiplier *uint16 `json:"intervalMultiplier"`
Quantity float64 `json:"quantity"`
}
@@ -20,6 +20,10 @@ type Prescription struct {
Status_Code erc.DataStatusCode `json:"status_code"`
}
func (d Prescription) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
func (d Prescription) IsApproved() bool {
return d.Status_Code == erc.DSCDone
}
@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
}
type ReadListDto struct {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
@@ -6,8 +6,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"required;minLength=2;maxLength=2"`
Name string `json:"name" validate:"required;maxLength=10"`
Code *string `json:"code" validate:"required;minLength=2;maxLength=2"`
Name string `json:"name" validate:"required;maxLength=10"`
}
type ReadListDto struct {
@@ -24,17 +24,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
+7 -6
View File
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
Province_Code string `json:"province_code" validate:"numeric;maxLength=2"`
Code string `json:"code" validate:"numeric;maxLength=4"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
Province_Code string `json:"province_code" validate:"numeric;maxLength=2"`
Code *string `json:"code" validate:"numeric;maxLength=4"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
+6 -5
View File
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"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 {
+7 -6
View File
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
District_Code string `json:"district_code" validate:"numeric;maxLength=6"`
Code string `json:"code" validate:"numeric;maxLength=10"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
District_Code string `json:"district_code" validate:"numeric;maxLength=6"`
Code *string `json:"code" validate:"numeric;maxLength=10"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -59,6 +59,7 @@ const (
SCInactive ActiveStatusCode = "inactive" // Tidak aktif
DSCNew DataStatusCode = "new" // Baru
DSCSubmited DataStatusCode = "submited" // Submited
DSCReview DataStatusCode = "review" // Review
DSCProcess DataStatusCode = "process" // Proses
DSCDone DataStatusCode = "done" // Selesai