package consultation import ( // std "time" // internal - lib pa "simrs-vx/internal/lib/auth" // internal - domain - base-entities ecore "simrs-vx/internal/domain/base-entities/core" // internal - domain - main-entities ed "simrs-vx/internal/domain/main-entities/doctor" ee "simrs-vx/internal/domain/main-entities/encounter" eu "simrs-vx/internal/domain/main-entities/unit" ) type CreateDto struct { Encounter_Id *uint `json:"encounter_id"` Date *time.Time `json:"date"` Problem *string `json:"problem" validate:"maxLength=10240"` DstUnit_Code *string `json:"dstUnit_code"` } type ReadListDto struct { FilterDto Includes string `json:"includes"` Pagination ecore.Pagination } type FilterDto struct { Encounter_Id *uint `json:"encounter-id"` DstUnit_Code *string `json:"dstUnit-code"` DstDoctor_Code *string `json:"dstDoctor-code"` } type ReadDetailDto struct { Id uint16 `json:"id"` } type UpdateDto struct { Id uint `json:"id"` CreateDto } type DeleteDto struct { Id uint `json:"id"` } type ReplyDto struct { Id uint `json:"id"` Solution *string `json:"solution"` pa.AuthInfo } type MetaDto struct { PageNumber int `json:"page_number"` PageSize int `json:"page_size"` Count int `json:"count"` } type ResponseDto struct { ecore.Main Encounter_Id *uint `json:"encounter_id"` Encounter *ee.Encounter `json:"encounter,omitempty"` Date *time.Time `json:"date"` Problem *string `json:"problem"` Solution *string `json:"solution"` DstUnit_Code *string `json:"dstUnit_code"` DstUnit *eu.Unit `json:"dstUnit,omitempty"` DstDoctor_Code *string `json:"dstDoctor_code"` DstDoctor *ed.Doctor `json:"dstDoctor,omitempty"` RepliedAt *time.Time `json:"repliedAt"` } func (d Consultation) ToResponse() ResponseDto { resp := ResponseDto{ Encounter_Id: d.Encounter_Id, Encounter: d.Encounter, Date: d.Date, Problem: d.Problem, Solution: d.Solution, DstUnit_Code: d.DstUnit_Code, DstUnit: d.DstUnit, DstDoctor_Code: d.DstDoctor_Code, DstDoctor: d.DstDoctor, } resp.Main = d.Main return resp } func ToResponseList(data []Consultation) []ResponseDto { resp := make([]ResponseDto, len(data)) for i, u := range data { resp[i] = u.ToResponse() } return resp }