Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateReference ¶
func GenerateReference() string
GenerateReference generates a random reference using UUID
Types ¶
type AddItemsRequest ¶
type AddItemsRequest struct {
Items []*Item `json:"items"`
}
type HealthResponse ¶
type HealthResponse struct {
Version string `json:"version,omitempty"`
Service string `json:"service,omitempty"`
Failures []string `json:"failures"`
}
HealthResponse contains health probe response fields.
type Item ¶
type Item struct {
ID int `json:"id,omitempty" gorm:"primaryKey;type:integer"`
SKU string `json:"sku" gorm:"column:sku;type:string;unique"`
Name string `json:"name" gorm:"column:name;type:string;unique"`
Price float64 `json:"price" gorm:"column:price;type:double"`
InventoryQuantity int `json:"inventory_quantity" gorm:"column:inventory_quantity;type:integer"`
}
type ItemsPriceRequest ¶
type ItemsPriceRequest struct {
SKUs []string `json:"skus"`
}
type Order ¶
type Order struct {
ID int `json:"id,omitempty" gorm:"primaryKey;type:integer"`
Reference string `json:"reference" gorm:"column:reference;type:string;uniqueIndex"` // Unique random reference
SKUList string `json:"sku_list" gorm:"column:sku_list;type:text"`
Price float64 `json:"cost" gorm:"column:price;type:double"`
}
func (*Order) GetSKUList ¶
GetSKUList returns the SKU list as a slice of strings
func (*Order) SetSKUList ¶
SetSKUList sets the SKU list from a slice of strings
type PriceResponse ¶
type PriceResponse struct {
Items []*Item `json:"items"`
Promotions *Promotions `json:"promotions,omitempty"`
TotalGross float64 `json:"total_gross"`
TotalWithDiscount float64 `json:"total_with_discount"`
}
type Promotions ¶
type PurchaseItemsRequest ¶
type PurchaseItemsRequest struct {
SKUs []string `json:"skus"`
}
type PurchaseItemsResponse ¶
type StatusResponse ¶
type StatusResponse struct {
Message string `json:"message,omitempty"`
Version string `json:"version,omitempty"`
Service string `json:"service,omitempty"`
}
StatusResponse contains status response fields.
Click to show internal directories.
Click to hide internal directories.