Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { gorm.Model Customer Customer Address string `json:"address" gorm:"column:address"` CustomerID uint `json:"customer_id" gorm:"column:customer_id"` IsMain bool `json:"main_address" gorm:"column:is_main"` }
Address customer address
type Cart ¶
type Cart struct { gorm.Model Customer Customer Status CartStatus `json:"cart-status" gorm:"column:cart_status"` CustomerID uint `json:"customer_id" gorm:"column:customer_id"` ExpirationDate time.Time `json:"expiration" gorm:"column:expiration"` }
Cart shopping cart
type CartItem ¶
type CartItem struct { gorm.Model Product Product Cart Cart CartID uint `json:"cart_id" gorm:"column:cart_id"` ProductID uint `json:"product_id" gorm:"column:product_id"` Quantity int `json:"quantity" gorm:"column:quantity"` UnitPrice float64 `gorm:"column:price" json:"unit_price"` }
CartItem link between cart and a product
type CartStatus ¶
type CartStatus int64
CartStatus enumeration
const ( Cart_Status_Active CartStatus = iota Cart_Status_Complete Cart_Status_Closed )
func (*CartStatus) Scan ¶
func (u *CartStatus) Scan(value interface{}) error
func (CartStatus) String ¶
func (cartStatus CartStatus) String() string
type ChargeRequest ¶
type ChargeRequest struct { OrderID int `json:"order_id"` UseExisting bool `json:"use_existing"` SaveCard bool `json:"save_card"` Token string `json:"token"` }
ChargeRequest charge request
type CreateOrderRequest ¶
CreateOrderRequest create order
type Customer ¶
type Customer struct { gorm.Model Name string `json:"name" sql:"-"` FirstName string `gorm:"column:firstname" json:"firstname" validate:"required"` LastName string `gorm:"column:lastname" json:"lastname" validate:"required"` Email string `gorm:"column:email" json:"email" validate:"required,email"` Password string `gorm:"column:password" json:"password" validate:"required"` LoggedIn bool `gorm:"column:loggedin" json:"loggedin"` Orders []Order `json:"orders"` }
Customer customer data
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
LoginResponse login response
type Order ¶
type Order struct { gorm.Model Cart Cart DeliveryAddress Address CartID int `json:"cart_id" gorm:"column:cart_id"` DeliveryAddressID int `json:"address_id" gorm:"column:address_id"` PurchaseDate time.Time `gorm:"column:purchase_date" json:"purchase_date"` PaymentID int `json:"payment_id" gorm:"column:payment_id"` Status OrderStatus `json:"status" gorm:"column:status"` TotalPrice float64 `gorm:"column:total_price" json:"total_price"` }
Order order data
type OrderStatus ¶
type OrderStatus int64
OrderStatus enumeration
const ( Order_Status_Init OrderStatus = iota Order_Status_Pending Order_Status_Complete Order_Status_Failed )
func (*OrderStatus) Scan ¶
func (u *OrderStatus) Scan(value interface{}) error
func (OrderStatus) String ¶
func (orderStatus OrderStatus) String() string
type Payment ¶
type Payment struct { gorm.Model Order Order Status string `gorm:"column:status;type:varchar(128)"` StripeID string `gorm:"column:stripe_id;type:varchar(250)"` }
Payment payment data
type Product ¶
type Product struct { gorm.Model Image string `json:"img"` SmallImage string `gorm:"column:smallimg" json:"small_img"` ImagAlt string `json:"imgalt" gorm:"column:imgalt"` Price float64 `json:"price"` Promotion float64 `json:"promotion"` //sql.NullFloat64 PoructName string `gorm:"column:productname" json:"productname"` Description string }
Product product data
Click to show internal directories.
Click to hide internal directories.