contract

package
v0.0.0-...-2039734 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCategoryBody

type AddCategoryBody struct {
	// required: true
	Name string `json:"Name" db:"name" validate:"nonzero"`
	// required: false
	IsVisible types.BitBool `json:"isVisible" db:"is_visible"`
	// required: false
	IsActive types.BitBool `json:"isActive" db:"is_active"`
	// required: false
	IsRoot types.BitBool `json:"isRoot" db:"is_root"`
}

swagger:model

type AddProductRequestBody

type AddProductRequestBody struct {
	// required: true
	Name string `json:"name" db:"name" validate:"nonzero"`
	// required: false
	GTIN string `json:"GTIN" db:"GTIN"`
	// required: true
	Price decimal.Decimal `json:"price" db:"price" validate:"nonzero"`
	// required: false
	Visibility types.BitBool `json:"visibility" db:"is_visible"`
	// required: false
	Category []int64 `json:"category"`
	// required: false
	Quantity decimal.Decimal `json:"quantity" db:"quantity"`
	// required: false
	QuantityUnit string `json:"quantityUnit" db:"quantity_unit"`
}

swagger:model

type AddUserRequestBody

type AddUserRequestBody struct {
	// required: true
	// example: some name
	Name string `json:"name"`
	// required: true
	// example: user@example.com
	// type: email
	Email string `json:"email"`
	// required: true
	Password string `json:"password"`
}

swagger:model

type AddUserResponseBody

type AddUserResponseBody struct {
	UserID int `json:"userID"`
}

type AuthType

type AuthType string
const (
	AuthTypeLDAP   AuthType = "ldap"
	AuthTypePasswd          = "passwd"
)

type ChangeBalanceRequestBody

type ChangeBalanceRequestBody struct {
	UserID    int             `json:"userID" db:"user_id" validate:"nonzero"`
	ProductID int             `json:"productID" db:"product_id"`
	Value     decimal.Decimal `json:"value" db:"value" validate:"nonzero"`
	Tag       string          `json:"tag" db:"tag"`
}

type ChangeStockRequestBody

type ChangeStockRequestBody struct {
	UserID    int `json:"userID" db:"user_id"`
	ProductID int `json:"productID" db:"product_id"`
	Quantity  int `json:"quantity" db:"quantity" validate:"nonzero"`
}

type EditUserRequestBody

type EditUserRequestBody struct {
	// required: true
	Name string `json:"name" validate:"nonzero"`
	// required: true
	Email string `json:"email"`
	// required: true
	IsBlocked types.BitBool `json:"isBlocked"`
	// required: true
	IsAdmin types.BitBool `json:"isAdmin"`
}

swagger:model

type LoginRequestBody

type LoginRequestBody struct {
	Name     string `json:"name" validate:"nonzero"`
	Password string `json:"password" validate:"nonzero"`
}

swagger:model a b in:body

type LoginResponse

type LoginResponse struct {
	UserID int    `json:"userID"`
	JWT    string `json:"jwt"`
}

type Product

type Product struct {
	ProductID    int             `json:"productID" db:"product_id"`
	Name         string          `json:"Name" db:"name"`
	GTIN         string          `json:"GTIN" db:"GTIN"`
	Price        decimal.Decimal `json:"price" db:"price"`
	Visibility   types.BitBool   `json:"visibility" db:"is_visible"`
	Category     []int64         `json:"category"`
	Quantity     decimal.Decimal `json:"quantity" db:"quantity"`
	QuantityUnit string          `json:"quantityUnit" db:"quantity_unit"`
	Stock        int             `json:"stock" db:"stock"`
}

type User

type User struct {
	UserID    int             `json:"userID" db:"user_id"`
	Name      string          `json:"name" db:"name"`
	Email     string          `json:"email" db:"email"`
	IsBlocked types.BitBool   `json:"isBlocked" db:"is_blocked"`
	IsAdmin   types.BitBool   `json:"isAdmin" db:"is_admin"`
	Balance   decimal.Decimal `json:"balance" db:"balance"`
}

swagger:model

type UserSlice

type UserSlice []User

swagger:model

Jump to

Keyboard shortcuts

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