package district import ev "simrs-vx/internal/domain/main-entities/village" 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"` } type ReadListDto struct { Regency_Code string `json:"regency_code"` Code string `json:"code"` Name string `json:"name"` Page int `json:"page"` PageSize int `json:"page_size"` NoPagination int `json:"no_pagination"` } type ReadDetailDto struct { Id uint32 `json:"id"` Code *string `json:"code"` } type UpdateDto struct { Id uint32 `json:"id"` CreateDto } type DeleteDto struct { Id uint32 `json:"id"` } type MetaDto struct { PageNumber int `json:"page_number"` PageSize int `json:"page_size"` Count int `json:"count"` } type ResponseDto struct { Id uint32 `json:"id"` Regency_Code string `json:"regency_code"` Code string `json:"code"` Name string `json:"name"` Villages []*ev.Village `json:"villages,omitempty"` } func (d District) ToResponse() ResponseDto { resp := ResponseDto(d) return resp } func ToResponseList(data []District) []ResponseDto { resp := make([]ResponseDto, len(data)) for i, u := range data { resp[i] = u.ToResponse() } return resp }