Documentation
¶
Index ¶
- Variables
- func DeleteInventoryByID(c *gin.Context)
- func DeleteMyInventoryByID(c *gin.Context)
- func GetInventories(c *gin.Context)
- func GetInventoryByID(c *gin.Context)
- func GetMyInventory(c *gin.Context)
- func GetMyInventoryByID(c *gin.Context)
- func InsertInventory(i *dataset.Inventory) error
- func PostInventory(c *gin.Context)
- func PostMyInventory(c *gin.Context)
- func PutInventoryByID(c *gin.Context)
- func PutMyInventoryByID(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
var ErrNoItemFound = errors.New("no item found")
ErrNoItemFound is returned when no item is found for a given request.
Functions ¶
func DeleteInventoryByID ¶
DeleteInventoryByID deletes an inventory by ID @Summary [ADMIN] Delete an inventory by ID @Description Deletes an inventory by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Inventory ID" @Success 200 {object} dataset.OkResponse "Inventory deleted" @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/inventories/{id} [delete]
func DeleteMyInventoryByID ¶
func GetInventories ¶
GetInventories gets all inventories @Summary [ADMIN] Get all inventories @Description Retrieves a list of all inventories - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.Inventory "List of Inventories" @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/inventories [get]
func GetInventoryByID ¶
GetInventoryByID gets an inventory by ID @Summary [ADMIN] Get an inventory by ID @Description Retrieves an inventory by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Inventory ID" @Success 200 {object} dataset.Inventory @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/inventories/{id} [get]
func GetMyInventory ¶
GetMyInventories gets all inventories of the user @Summary Get all inventories of the user @Description Retrieves a list of all inventories of the user @Security Bearer @Tags Inventories @Produce json @Success 200 {object} dataset.Inventories @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 404 {object} dataset.ErrorResponse "No Inventory Found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/myinventory [get]
func GetMyInventoryByID ¶
GetMyInventoryByID gets an inventory by ID @Summary Get an inventory by ID @Description Retrieves an inventory by ID @Security Bearer @Tags Inventories @Produce json @Param id path int true "Inventory ID" @Success 200 {object} dataset.Inventory "Inventory" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This item does not belong to you" @Failure 404 {object} dataset.ErrorResponse "Inventory not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/myinventory/{id} [get]
func InsertInventory ¶
func PostInventory ¶
PostInventory creates an inventory @Summary [ADMIN] Create an inventory @Description Creates an inventory - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param inventory body dataset.Inventory true "Inventory" @Success 201 {object} dataset.Inventory @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/inventories [post]
func PostMyInventory ¶
PostMyInventory creates an inventory @Summary Create an inventory @Description Creates an inventory @Security Bearer @Tags Inventories @Accept json @Produce json @Param inventory body dataset.Inventory true "Inventory" @Success 201 {object} dataset.Inventory "Inventory Updated" @Failure 400 {object} dataset.ErrorResponse "Invalid payload" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/myinventory [post]
func PutInventoryByID ¶
PutInventoryByID updates an inventory by ID @Summary [ADMIN] Update an inventory by ID @Description Updates an inventory by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Inventory ID" @Param inventory body dataset.Inventory true "Inventory" @Success 200 {object} dataset.Inventory @Failure 400 {object} dataset.ErrorResponse @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/inventories/{id} [put]
func PutMyInventoryByID ¶
PutMyInventoryByID updates an inventory by ID @Summary Update an inventory by ID @Description Updates an inventory by ID @Security Bearer @Tags Inventories @Accept json @Produce json @Param id path int true "Inventory ID" @Param inventory body dataset.Inventory true "Inventory" @Success 200 {object} dataset.Inventory "Inventory Updated" @Failure 400 {object} map[string]interface{} "Invalid ID format" @Failure 400 {object} map[string]interface{} "Invalid payload" @Failure 401 {object} map[string]interface{} "Unauthorized" @Failure 403 {object} map[string]interface{} "This item does not belong to you" @Failure 500 {object} map[string]interface{} "Internal Server Error" @Router /v1/myinventory/{id} [put]
Types ¶
This section is empty.