feat (prescription): add approve + create medication

This commit is contained in:
dpurbosakti
2025-09-22 13:21:29 +07:00
parent 02c86a9ec0
commit 202bb32e9c
6 changed files with 196 additions and 59 deletions
@@ -116,7 +116,6 @@ func SetRoutes() http.Handler {
hc.RegCrud(r, "/v1/soapi", auth.GuardMW, soapi.O)
hc.RegCrud(r, "/v1/adime", auth.GuardMW, adime.O)
hc.RegCrud(r, "/v1/sbar", auth.GuardMW, sbar.O)
hc.RegCrud(r, "/v1/prescription", prescription.O)
hc.RegCrud(r, "/v1/prescription-item", prescriptionitem.O)
hc.RegCrud(r, "/v1/device-order-item", deviceorderitem.O)
hc.RegCrud(r, "/v1/material-order-item", materialorderitem.O)
@@ -138,6 +137,14 @@ func SetRoutes() http.Handler {
"PATCH /{id}/complete": mcuorderitem.O.Complete,
"PATCH /{id}/set-schedule": mcuorderitem.O.SetSchedule,
})
hk.GroupRoutes("/v1/prescription", r, hk.MapHandlerFunc{
"GET /": prescription.O.GetList,
"GET /{id}": prescription.O.GetDetail,
"POST /": prescription.O.Create,
"PATCH /{id}": prescription.O.Update,
"DELETE /{id}": prescription.O.Delete,
"PATCH /{id}/approve": prescription.O.Approve,
})
hk.GroupRoutes("/v1/mcu-order-sub-item", r, hk.MapHandlerFunc{
"GET /": mcuordersubitem.O.GetList,
"GET /{id}": mcuordersubitem.O.GetDetail,