inventories

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoItemFound = errors.New("no item found")

ErrNoItemFound is returned when no item is found for a given request.

Functions

func DeleteInventoryByID

func DeleteInventoryByID(c *gin.Context)

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 DeleteMyInventoryByID(c *gin.Context)

func GetInventories

func GetInventories(c *gin.Context)

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

func GetInventoryByID(c *gin.Context)

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

func GetMyInventory(c *gin.Context)

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

func GetMyInventoryByID(c *gin.Context)

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 InsertInventory(i *dataset.Inventory) error

func PostInventory

func PostInventory(c *gin.Context)

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

func PostMyInventory(c *gin.Context)

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

func PutInventoryByID(c *gin.Context)

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

func PutMyInventoryByID(c *gin.Context)

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.

Jump to

Keyboard shortcuts

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