Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InventoryItem ¶
type Order ¶
type Order struct { OrderId uuid.UUID `json:"order_id" validate:"omitempty"` Status OrderStatus `json:"status"` StatusMessage string `json:"status_message"` Sum int `json:"sum" validate:"omitempty"` OrderList []*OrderItem `json:"order_list"` }
func (*Order) CalculateSum ¶
func (o *Order) CalculateSum()
type OrderItem ¶
type OrderItem struct { ItemId uuid.UUID `json:"item_id" validate:"omitempty"` Cost int `json:"cost" validate:"min=1"` Qty int `json:"qty" validate:"min=1"` Sum int `json:"sum" validate:"omitempty"` }
func (*OrderItem) CalculateSum ¶
func (o *OrderItem) CalculateSum()
type OrderStatus ¶
type OrderStatus int64
const ( OrderStatusUndefined OrderStatus = iota OrderStatusCreated OrderStatusConfirmed OrderStatusPackaged OrderStatusInDelivery OrderStatusCompleted OrderStatusCancelled )
func (OrderStatus) ToString ¶
func (s OrderStatus) ToString() string
type OrderStatusNotify ¶
type OrderStatusNotify struct { OrderId uuid.UUID `json:"order_id"` Status OrderStatus `json:"status"` StatusMessage string `json:"status_message"` }
type Product ¶
type Product struct { ProductID uuid.UUID `json:"product_id" db:"product_id" validate:"omitempty"` Name string `json:"product_name" db:"product_name" validate:"required,lte=30"` Color string `json:"color" db:"color" validate:"required,lte=30"` Factory string `json:"factory" db:"factory" validate:"required,lte=30"` Description string `json:"description" db:"description" validate:"required,lte=126"` Cost int `json:"cost" db:"cost" validate:"required"` CreatedAt time.Time `json:"created_at,omitempty" db:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty" db:"updated_at"` }
Product full model
type ProductList ¶
type Session ¶
type Session struct { SessionID string `json:"session_id" redis:"session_id"` UserID uuid.UUID `json:"user_id" redis:"user_id"` }
Session model
type User ¶
type User struct { UserID uuid.UUID `json:"user_id" db:"user_id" redis:"user_id" validate:"omitempty"` FirstName string `json:"first_name" db:"first_name" redis:"first_name" validate:"required,lte=30"` LastName string `json:"last_name" db:"last_name" redis:"last_name" validate:"required,lte=30"` Email string `json:"email,omitempty" db:"email" redis:"email" validate:"omitempty,lte=60,email"` Password string `json:"password,omitempty" db:"password" redis:"password" validate:"omitempty,required,gte=6"` Role *string `json:"role,omitempty" db:"role" redis:"role" validate:"omitempty,lte=10"` CreatedAt time.Time `json:"created_at,omitempty" db:"created_at" redis:"created_at"` UpdatedAt time.Time `json:"updated_at,omitempty" db:"updated_at" redis:"updated_at"` LoginDate time.Time `json:"login_date" db:"login_date" redis:"login_date"` }
User full model
func (*User) ComparePasswords ¶
Compare user password and payload
type UserWithToken ¶
Find user query
Click to show internal directories.
Click to hide internal directories.