qor / qor-example

An example application showcasing the QOR SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is here a bug in order_item.go?

goodforever opened this issue · comments

commented

No State field
type OrderItem struct {
gorm.Model
OrderID uint
SizeVariationID uint cartitem:"SizeVariationID"
SizeVariation *products.SizeVariation
Quantity uint cartitem:"Quantity"
Price float32
DiscountRate uint
transition.Transition
}

// IsCart order item's state is cart
func (item OrderItem) IsCart() bool {
return item.State == DraftState || item.State == ""
}

commented

The State field is embedded by the Transition.