models

package
v0.0.0-...-7abf632 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalServerError will throw if any the Internal Server Error happen
	ErrInternalServerError = errors.New("Internal Server Error")
	// ErrNotFound will throw if the requested item is not exists
	ErrNotFound = errors.New("Your requested Item is not found")
	// ErrConflict will throw if the current action already exists
	ErrConflict = errors.New("Your Item already exist")
	// ErrBadParamInput will throw if the given request-body or params is not valid
	ErrBadParamInput = errors.New("Given Param is not valid")
)

Functions

This section is empty.

Types

type Cart

type Cart struct {
	ID        int64     `json:"id"`
	ItemsID   int64     `json:"items_id" validate:"required"`
	Quantity  int64     `json:"quantity" validate:"required"`
	UpdatedAt time.Time `json:"updated_at"`
	CreatedAt time.Time `json:"created_at"`
}

type Items

type Items struct {
	ID                int64     `json:"id"`
	SKU               string    `json:"sku" validate:"required"`
	Name              string    `json:"name" validate:"required"`
	Price             float64   `json:"price" validate:"required"`
	InventoryQuantity int64     `json:"inventory_quantity" validate:"required"`
	UpdatedAt         time.Time `json:"updated_at"`
	CreatedAt         time.Time `json:"created_at"`
}

type Order

type Order struct {
	ID         int64     `json:"id"`
	TotalPrice float64   `json:"total_price" validate:"required"`
	UpdatedAt  time.Time `json:"updated_at"`
	CreatedAt  time.Time `json:"created_at"`
}

Order represent the order model

type OrderDetails

type OrderDetails struct {
	ID        int64     `json:"id"`
	OrderID   int64     `json:"order_id" validate:"required"`
	SKU       string    `json:"sku" validate:"required"`
	Name      string    `json:"name" validate:"required"`
	Price     float64   `json:"price" validate:"required"`
	Quantity  int64     `json:"quantity" validate:"required"`
	PromoType string    `json:"promo_type"`
	UpdatedAt time.Time `json:"updated_at"`
	CreatedAt time.Time `json:"created_at"`
}

Order represent the order model

type Promotions

type Promotions struct {
	ID                  int64  `json:"id"`
	ItemsID             int64  `json:"items_id" validate:"required"`
	PromoType           string `json:"promo_type" validate:"required"`
	Promo               string `json:"promo" validate:"required"`
	QuantityRequirement int64  `json:"quantity_requirement" validate:"required"`
}

Promotions represent the promotion model

Jump to

Keyboard shortcuts

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