add encounter-checkin

This commit is contained in:
vanilia
2025-10-27 06:25:12 +07:00
parent a7ce13c76e
commit a2ce9d9357
9 changed files with 192 additions and 66 deletions
@@ -102,6 +102,27 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
rw.DataResponse(w, res, err)
}
func (obj myBase) CheckIn(w http.ResponseWriter, r *http.Request) {
dto := e.CheckinDto{}
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
// validate request body
if valid := validateRequestCheckIn(w, dto); !valid {
return
}
dto.Id = uint(id)
res, err := u.CheckIn(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Process(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {