add infragroup, employee, itemgroup, doctor, nurse, nutritionist, pharmacist, counter, practiceschedule

This commit is contained in:
dpurbosakti
2025-08-27 09:20:16 +07:00
parent d76c5de6df
commit 3d22e8b720
38 changed files with 1022 additions and 94 deletions

No files matched your search

+10 -10
View File
@@ -51,22 +51,22 @@ type ResponseDto struct {
Name string `json:"name"`
}
func (u Unit) ToResponse() ResponseDto {
func (d Unit) ToResponse() ResponseDto {
resp := ResponseDto{
Installation_Id: u.Installation_Id,
Code: u.Code,
Name: u.Name,
Installation_Id: d.Installation_Id,
Code: d.Code,
Name: d.Name,
}
resp.SmallMain = u.SmallMain
if u.Installation != nil {
resp.Installation = u.Installation
resp.SmallMain = d.SmallMain
if d.Installation != nil {
resp.Installation = d.Installation
}
return resp
}
func ToResponseList(users []Unit) []ResponseDto {
resp := make([]ResponseDto, len(users))
for i, u := range users {
func ToResponseList(data []Unit) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp