Documentation ¶
Index ¶
- Variables
- type DeliveryMethod
- type Order
- type OrderItem
- func (item OrderItem) Amount() float32
- func (item *OrderItem) ColorName() string
- func (item OrderItem) IsCart() bool
- func (item *OrderItem) ProductImageURL() string
- func (item *OrderItem) ProductName() string
- func (item *OrderItem) ProductPath() string
- func (item *OrderItem) SellingPrice() float32
- func (item *OrderItem) SizeName() string
- type PaymentMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // OrderState order's state machine OrderState = transition.New(&Order{}) // ItemState order item's state machine ItemState = transition.New(&OrderItem{}) )
View Source
var (
// DraftState draft state
DraftState = "draft"
)
Functions ¶
This section is empty.
Types ¶
type Order ¶
type Order struct { gorm.Model UserID *uint User users.User PaymentAmount float32 PaymentTotal float32 AbandonedReason string DiscountValue uint DeliveryMethodID uint `form:"delivery-method"` DeliveryMethod DeliveryMethod PaymentMethod string TrackingNumber *string ShippedAt *time.Time ReturnedAt *time.Time CancelledAt *time.Time ShippingAddressID uint `form:"shippingaddress"` ShippingAddress users.Address BillingAddressID uint `form:"billingaddress"` BillingAddress users.Address OrderItems []OrderItem AmazonAddressAccessToken string AmazonOrderReferenceID string AmazonAuthorizationID string AmazonCaptureID string AmazonRefundID string PaymentLog string `gorm:"size:655250"` transition.Transition }
func (Order) DeliveryFee ¶
DeliveryFee delivery fee
func (Order) ExternalID ¶
func (Order) UniqueExternalID ¶
type OrderItem ¶
type OrderItem struct { gorm.Model OrderID uint SizeVariationID uint `cartitem:"SizeVariationID"` SizeVariation *products.SizeVariation Quantity uint `cartitem:"Quantity"` Price float32 DiscountRate uint transition.Transition }
func (*OrderItem) ProductImageURL ¶
ProductImageURL get product image
func (*OrderItem) ProductName ¶
ProductName order item's color name
func (*OrderItem) ProductPath ¶
ProductPath order item's product name
func (*OrderItem) SellingPrice ¶
SellingPrice order item's selling price
type PaymentMethod ¶
type PaymentMethod = string
const ( COD PaymentMethod = "COD" AmazonPay PaymentMethod = "AmazonPay" CreditCard PaymentMethod = "CreditCard" )
Click to show internal directories.
Click to hide internal directories.