Documentation
¶
Index ¶
- type Aisle
- type Category
- type Client
- type Database
- func (db *Database) CheckRevokedToken(token string) error
- func (db *Database) CheckUser(email, password string) error
- func (db Database) Delete(obj interface{}, condition string, args ...interface{}) error
- func (db Database) Insert(rows ...interface{}) error
- func (db *Database) InsertUser(user User) error
- func (db *Database) RevokeToken(token string) error
- func (db *Database) SelectAisleById(id string) (Aisle, error)
- func (db *Database) SelectAisles(condition string, args ...interface{}) ([]Aisle, error)
- func (db *Database) SelectAislesByZone(id string) ([]Aisle, error)
- func (db *Database) SelectCategories(condition string, args ...interface{}) ([]Category, error)
- func (db *Database) SelectCategoryById(id string) (Category, error)
- func (db *Database) SelectClients(condition string, args ...interface{}) ([]Client, error)
- func (db *Database) SelectDefaultVariant(item string) (Variant, error)
- func (db *Database) SelectItemById(id string) (Item, error)
- func (db Database) SelectItemImageById(id string) (Item_image, error)
- func (db *Database) SelectItemImages(condition string, args ...interface{}) ([]Item_image, error)
- func (db Database) SelectItemImagesByItemId(id string) ([]Item_image, error)
- func (db *Database) SelectItemVariants(item string) ([]Variant, error)
- func (db *Database) SelectItems(condition string, args ...interface{}) ([]Item, error)
- func (db *Database) SelectItemsByCategoryId(id string) ([]Item, error)
- func (db *Database) SelectItemsBySubcategoryId(id string) ([]Item, error)
- func (db *Database) SelectOperations(condition string, args ...interface{}) ([]Operation, error)
- func (db *Database) SelectProductImages(condition string, args ...interface{}) ([]ProductImage, error)
- func (db *Database) SelectProducts(condition string, args ...interface{}) ([]Product, error)
- func (db *Database) SelectRackById(id string) (Rack, error)
- func (db *Database) SelectRacks(condition string, args ...interface{}) ([]Rack, error)
- func (db *Database) SelectRacksByAisle(id string) ([]Rack, error)
- func (db *Database) SelectSettings() (Settings, error)
- func (db *Database) SelectShelfById(id string) (Shelf, error)
- func (db *Database) SelectShelfs(condition string, args ...interface{}) ([]Shelf, error)
- func (db *Database) SelectShelfsByRack(id string) ([]Shelf, error)
- func (db *Database) SelectSubcategories(condition string, args ...interface{}) ([]Subcategory, error)
- func (db *Database) SelectSubcategoryById(id string) (Subcategory, error)
- func (db *Database) SelectSupplierById(id string) (Supplier, error)
- func (db *Database) SelectSupplierCodes(condition string, args ...interface{}) ([]SupplierCode, error)
- func (db *Database) SelectSupplierCodesByItemId(id string) ([]SupplierCode, error)
- func (db *Database) SelectSuppliers(condition string, args ...interface{}) ([]Supplier, error)
- func (db *Database) SelectTicketStates(condition string, args ...interface{}) ([]TicketState, error)
- func (db *Database) SelectTicketTypes(condition string, args ...interface{}) ([]TicketType, error)
- func (db *Database) SelectTickets(condition string, args ...interface{}) ([]Ticket, error)
- func (db *Database) SelectUnitById(id string) (Unit, error)
- func (db *Database) SelectUnits(condition string, args ...interface{}) ([]Unit, error)
- func (db *Database) SelectUser(condition string, args ...interface{}) ([]User, error)
- func (db *Database) SelectUserById(id string) (User, error)
- func (db *Database) SelectVariantById(id string) (Variant, error)
- func (db *Database) SelectVariants(condition string, args ...interface{}) ([]Variant, error)
- func (db *Database) SelectZoneById(id string) (Zone, error)
- func (db *Database) SelectZones(condition string, args ...interface{}) ([]Zone, error)
- func (db Database) Update(obj interface{}, condition string, args ...interface{}) error
- func (db *Database) UpdateSettings(new Settings) error
- type Identifiable
- type Item
- type Item_image
- type Metadata
- type NewUser
- type Operation
- type Position
- type Product
- type ProductImage
- type Rack
- type RefreshToken
- type Settings
- type Shelf
- type Subcategory
- type Supplier
- type SupplierCode
- type Ticket
- type TicketState
- type TicketType
- type Unit
- type UnitSystem
- type User
- type Variant
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Client ¶
type Database ¶
func (*Database) CheckRevokedToken ¶
func (*Database) InsertUser ¶
func (*Database) RevokeToken ¶
func (*Database) SelectAisles ¶
func (*Database) SelectAislesByZone ¶
func (*Database) SelectCategories ¶
func (*Database) SelectCategoryById ¶
func (*Database) SelectClients ¶
func (*Database) SelectDefaultVariant ¶
func (*Database) SelectItemById ¶
Select a single item based on the id
func (Database) SelectItemImageById ¶
func (db Database) SelectItemImageById(id string) (Item_image, error)
func (*Database) SelectItemImages ¶
func (db *Database) SelectItemImages(condition string, args ...interface{}) ([]Item_image, error)
func (Database) SelectItemImagesByItemId ¶
func (db Database) SelectItemImagesByItemId(id string) ([]Item_image, error)
From a given id gets all the images
func (*Database) SelectItemVariants ¶
func (*Database) SelectItems ¶
Select an item based on the condition and the args
func (*Database) SelectItemsByCategoryId ¶
func (*Database) SelectItemsBySubcategoryId ¶
func (*Database) SelectOperations ¶
func (*Database) SelectProductImages ¶
func (db *Database) SelectProductImages(condition string, args ...interface{}) ([]ProductImage, error)
func (*Database) SelectProducts ¶
func (*Database) SelectRacks ¶
func (*Database) SelectRacksByAisle ¶
func (*Database) SelectSettings ¶
func (*Database) SelectShelfs ¶
func (*Database) SelectShelfsByRack ¶
func (*Database) SelectSubcategories ¶
func (db *Database) SelectSubcategories(condition string, args ...interface{}) ([]Subcategory, error)
func (*Database) SelectSubcategoryById ¶
func (db *Database) SelectSubcategoryById(id string) (Subcategory, error)
func (*Database) SelectSupplierById ¶
func (*Database) SelectSupplierCodes ¶
func (db *Database) SelectSupplierCodes(condition string, args ...interface{}) ([]SupplierCode, error)
func (*Database) SelectSupplierCodesByItemId ¶
func (db *Database) SelectSupplierCodesByItemId(id string) ([]SupplierCode, error)
func (*Database) SelectSuppliers ¶
func (*Database) SelectTicketStates ¶
func (db *Database) SelectTicketStates(condition string, args ...interface{}) ([]TicketState, error)
func (*Database) SelectTicketTypes ¶
func (db *Database) SelectTicketTypes(condition string, args ...interface{}) ([]TicketType, error)
func (*Database) SelectTickets ¶
func (*Database) SelectUnits ¶
func (*Database) SelectUser ¶
func (*Database) SelectUserById ¶
Select a single item based on the id
func (*Database) SelectVariantById ¶
func (*Database) SelectVariants ¶
func (*Database) SelectZones ¶
func (*Database) UpdateSettings ¶
type Identifiable ¶
type Identifiable interface {
GetId() string
}
Interface used to get the id in the server package. Used to delete the nil item
type Item ¶
type Item struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
IsArchive bool `json:"isArchive"`
Zone_id string `json:"zone"`
Aisle_id string `json:"aisle"`
Rack_id string `json:"rack"`
Shelf_id string `json:"shelf"`
Category_id string `json:"category"`
Subcategory_id string `json:"subcategory"`
}
type Item_image ¶
type Item_image struct {
Id string `json:"id"`
Uri string `json:"uri"`
Item_id string `json:"item"`
}
func (Item_image) GetId ¶
func (i Item_image) GetId() string
type NewUser ¶
type NewUser struct {
Id string `json:"id"`
Name string `json:"name"`
Surname string `json:"surname"`
Email string `json:"email"`
Password string `json:"password"`
}
This struct is used to handle incoming POST requests for new users
type Operation ¶
type Product ¶
type ProductImage ¶
type ProductImage struct {
Id string `json:"id"`
Url string `json:"url"`
Product_id string `json:"product"`
}
func (ProductImage) GetId ¶
func (i ProductImage) GetId() string
type Rack ¶
type Rack struct {
Id string `json:"id"`
Name string `json:"name"`
Zone_id string `json:"zone"`
Aisle_id string `json:"aisle"`
}
A Rack is a collection of Shelfs
type RefreshToken ¶
type Settings ¶
type Settings struct {
Id string `json:"id"`
UnitSystem UnitSystem `json:"system"`
Unit_Length_id string `json:"defaultLengthUnit"`
Unit_Weight_id string `json:"defaultWeightUnit"`
// WIP: Used to show the wizard
Wizard bool `json:"wizard"`
}
type Shelf ¶
type Shelf struct {
Id string `json:"id"`
Name string `json:"name"`
Zone_id string `json:"zone"`
Aisle_id string `json:"aisle"`
Rack_id string `json:"rack"`
}
A Shelf is the lowest one
type Subcategory ¶
type Subcategory struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category_id string `json:"category"`
}
func (Subcategory) GetId ¶
func (i Subcategory) GetId() string
type Supplier ¶
type SupplierCode ¶
type SupplierCode struct {
Id string `json:"id"`
Code string `json:"code"`
Supplier_id string `json:"supplier"`
Item_id string `json:"item"`
Variant_id string `json:"variant"`
}
func (SupplierCode) GetId ¶
func (i SupplierCode) GetId() string
type Ticket ¶
type Ticket struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Open string `json:"open"`
Close string `json:"close"`
Client_id string `json:"client"`
Product_id string `json:"product"`
TicketType_id string `json:"type"`
TicketState_id string `json:"state"`
}
type TicketState ¶
type TicketState struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
func (TicketState) GetId ¶
func (i TicketState) GetId() string
type TicketType ¶
type TicketType struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
func (TicketType) GetId ¶
func (i TicketType) GetId() string
type Unit ¶
type Unit struct {
Id string `json:"id"`
Type string `json:"type"`
// The ratio from smallest unit to current unit (grams or millimiters)
Ratio float64 `json:"ratio"`
UnitSystem UnitSystem `json:"system"`
}
type UnitSystem ¶
type UnitSystem string
const ( MetricSystem UnitSystem = "metric" ImperialSystem UnitSystem = "imperial" )
type User ¶
type Variant ¶
type Variant struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Quantity int64 `json:"quanity"`
Identifier string `json:"identifier"`
Length float64 `json:"length"`
Width float64 `json:"width"`
Height float64 `json:"height"`
Weight float64 `json:"weight"`
DefaultVariant bool `json:"defaultVariant"`
Item_id string `json:"item"`
// The definition is with underscores because sorm needs the first splitted item to be the
// table name and the last the relationship, so in this case a foreign key. Do not change them
// If you changed it change it back to Unit_x_id
Unit_Length_id string `json:"lengthUnit"`
Unit_Weight_id string `json:"weightUnit"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.