feat (vclaim/bpjs/jkn): add several endpoint

This commit is contained in:
dpurbosakti
2025-12-01 12:43:23 +07:00
parent 2a39301563
commit 2a979f60a6
24 changed files with 561 additions and 27 deletions
@@ -14,11 +14,11 @@ func GetListVisit(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
pValue1 := rw.ValidateString(w, "date", r.PathValue("date"))
if pValue1 == "" {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": "date is required"}, nil)
rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "date is required"}, nil)
}
pValue2 := rw.ValidateString(w, "serviceType", r.PathValue("serviceType"))
if pValue2 == "" {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": "serviceType is required"}, nil)
rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "serviceType is required"}, nil)
}
dto.ReferenceType = e.RTVisit
dto.PathValue1 = pValue1
@@ -31,15 +31,15 @@ func GetListHist(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
pValue1 := rw.ValidateString(w, "cardNumber", r.PathValue("cardNumber"))
if pValue1 == "" {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": "cardNumber is required"}, nil)
rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "cardNumber is required"}, nil)
}
pValue2 := rw.ValidateString(w, "startDate", r.PathValue("startDate"))
if pValue2 == "" {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": "startDate is required"}, nil)
rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "startDate is required"}, nil)
}
pValue3 := rw.ValidateString(w, "endDate", r.PathValue("endDate"))
if pValue3 == "" {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": "endDate is required"}, nil)
rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "endDate is required"}, nil)
}
dto.ReferenceType = e.RTHist
dto.PathValue1 = pValue1