roster

package
v0.0.0-...-48f5382 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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 Ctx

func Ctx(next http.Handler) http.Handler

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]

func NewRosterListResponse

func NewRosterListResponse(rosters []models.Roster) []render.Renderer

func Router

func Router(r chi.Router)

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
}

func (*Request) Bind

func (req *Request) Bind(r *http.Request) error

func (*Request) Validate

func (req *Request) Validate() error

type Response

type Response struct {
	*models.Roster
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

func NewRosterResponse

func NewRosterResponse(r *models.Roster) *Response

func (*Response) Render

func (res *Response) Render(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL