You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
917 B
28 lines
917 B
package quartermaster
|
|
|
|
type Item struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Size float32 `json:"size"`
|
|
Unit Unit `json:"unit"`
|
|
Barcode string `json:"barcode"`
|
|
Nutrition *Nutrition `json:"nutrition,omitempty"`
|
|
}
|
|
|
|
type ItemService interface {
|
|
Item(int, *User) (*Item, error)
|
|
AddItem(*Item, *Location, *User) (*Item, error)
|
|
UpdateItem(*Item, *User) error
|
|
MoveItem(item *Item, old *Location, new *Location, user *User) error
|
|
RemoveItem(*Item, *Location, *User) error
|
|
DeleteItem(*Item, *User) error
|
|
GetItemByBarcode(barcode string, user *User) (*Item, error)
|
|
AddGroup(*Item, *Group) error
|
|
AddCategory(*Item, *Category) error
|
|
RemoveGroup(*Item, *Group) error
|
|
RemoveCategory(*Item, *Category) error
|
|
GetItemLocations(*Item, *User) (map[int]int, error)
|
|
IsOwner(*Item, *User) (bool, error)
|
|
}
|