Documentation ¶
Index ¶
- func CreateRoster(w http.ResponseWriter, r *http.Request)
- func Ctx(next http.Handler) http.Handler
- func DeleteRoster(w http.ResponseWriter, r *http.Request)
- func GetRosterByFacility(w http.ResponseWriter, r *http.Request)
- func GetUserRosters(w http.ResponseWriter, r *http.Request)
- func NewRosterListResponse(rosters []models.Roster) []render.Renderer
- func Router(r chi.Router)
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRoster ¶
func CreateRoster(w http.ResponseWriter, r *http.Request)
CreateRoster godoc @Summary Add user to roster @Description Adds a user to a roster @Tags roster @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param roster body Request true "Roster" @Success 201 {object} Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/roster [post]
func DeleteRoster ¶
func DeleteRoster(w http.ResponseWriter, r *http.Request)
DeleteRoster godoc @Summary Delete a roster @Description Delete a roster @Tags roster @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param id path int true "Roster ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/roster/{id} [delete]
func GetRosterByFacility ¶
func GetRosterByFacility(w http.ResponseWriter, r *http.Request)
GetRosterByFacility godoc @Summary Get rosters by facility @Description Get rosters by facility @Tags roster @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param type query string false "Type" Enums(home,visiting) @Success 200 {object} []Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/roster [get] @Security ApiKeyAuth
func GetUserRosters ¶
func GetUserRosters(w http.ResponseWriter, r *http.Request)
GetUserRosters godoc @Summary Get rosters by user @Description Get rosters by user @Tags roster @Accept json @Produce json @Param cid path int true "CID" @Success 200 {object} []Response @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /user/{cid}/roster [get]
Types ¶
type Request ¶
type Request struct { CID uint `json:"cid" example:"123456" validate:"required"` OIs string `json:"operating_initials" example:"RP" validate:"required"` Home bool `json:"home" example:"true"` Visiting bool `json:"visiting" example:"false"` Status string `json:"status" example:"Active" validate:"required,oneof=active loa"` // Active, LOA }