add checkin

This commit is contained in:
vanilia
2025-10-27 14:34:52 +07:00
parent b0fe5cc416
commit 0aa2ed730c
5 changed files with 119 additions and 28 deletions
@@ -2,6 +2,7 @@ package encounter
import (
"net/http"
"time"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
@@ -124,6 +125,13 @@ func (obj myBase) CheckIn(w http.ResponseWriter, r *http.Request) {
}
dto.Id = uint(id)
// validate startedAt
if dto.StartedAt == nil {
now := time.Now()
dto.StartedAt = &now
}
res, err := u.CheckIn(dto)
rw.DataResponse(w, res, err)
}