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

This commit is contained in:
dpurbosakti
2025-09-04 11:53:40 +07:00
7 changed files with 101 additions and 3 deletions
@@ -0,0 +1,68 @@
package laborant
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
Parent_Id *int16 `json:"parent_id"`
}
type ReadListDto struct {
Code string `json:"code"`
Name string `json:"name"`
Parent_Id *int16 `json:"parent_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Parent_Id *int16 `json:"parent_id"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
}
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"`
Parent_Id *int16 `json:"parent_id"`
}
func (d Laborant) ToResponse() ResponseDto {
resp := ResponseDto{
Code: d.Code,
Name: d.Name,
Parent_Id: d.Parent_Id,
}
resp.SmallMain = d.SmallMain
return resp
}
func ToResponseList(data []Laborant) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,12 @@
package laborant
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type Laborant 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 *int16 `json:"parent_id"`
}
@@ -13,5 +13,5 @@ type Patient struct {
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
RegisteredAt *time.Time `json:"registeredAt"`
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
Number *string `json:"number" gorm:"size:15"`
Number *string `json:"number" gorm:"unique;size:15"`
}
@@ -21,6 +21,7 @@ import (
insurancecompany "simrs-vx/internal/domain/main-entities/insurance-company"
item "simrs-vx/internal/domain/main-entities/item"
itemprice "simrs-vx/internal/domain/main-entities/item-price"
laborant "simrs-vx/internal/domain/main-entities/laborant"
language "simrs-vx/internal/domain/main-entities/language"
material "simrs-vx/internal/domain/main-entities/material"
mcusrc "simrs-vx/internal/domain/main-entities/mcu-src"
@@ -127,6 +128,7 @@ func GetEntities() []any {
&personrelative.PersonRelative{},
&patient.Patient{},
&encounter.Encounter{},
&laborant.Laborant{},
}
}