update
This commit is contained in:
@@ -41,18 +41,18 @@ type CartItem struct {
|
||||
OrgPrice *Price `json:"orgPrice,omitempty"`
|
||||
Cgm string `json:"cgm,omitempty"`
|
||||
Tax int
|
||||
Stock StockStatus `json:"stock"`
|
||||
Quantity int `json:"qty"`
|
||||
Discount *Price `json:"discount,omitempty"`
|
||||
Disclaimer string `json:"disclaimer,omitempty"`
|
||||
ArticleType string `json:"type,omitempty"`
|
||||
StoreId *string `json:"storeId,omitempty"`
|
||||
Meta *ItemMeta `json:"meta,omitempty"`
|
||||
SaleStatus string `json:"saleStatus"`
|
||||
Marking *Marking `json:"marking,omitempty"`
|
||||
SubscriptionDetailsId string `json:"subscriptionDetailsId,omitempty"`
|
||||
OrderReference string `json:"orderReference,omitempty"`
|
||||
IsSubscribed bool `json:"isSubscribed,omitempty"`
|
||||
Stock uint16 `json:"stock"`
|
||||
Quantity int `json:"qty"`
|
||||
Discount *Price `json:"discount,omitempty"`
|
||||
Disclaimer string `json:"disclaimer,omitempty"`
|
||||
ArticleType string `json:"type,omitempty"`
|
||||
StoreId *string `json:"storeId,omitempty"`
|
||||
Meta *ItemMeta `json:"meta,omitempty"`
|
||||
SaleStatus string `json:"saleStatus"`
|
||||
Marking *Marking `json:"marking,omitempty"`
|
||||
SubscriptionDetailsId string `json:"subscriptionDetailsId,omitempty"`
|
||||
OrderReference string `json:"orderReference,omitempty"`
|
||||
IsSubscribed bool `json:"isSubscribed,omitempty"`
|
||||
}
|
||||
|
||||
type CartDelivery struct {
|
||||
@@ -240,9 +240,9 @@ func (c *CartGrain) Notify(event actor.Event) {
|
||||
// Update stock status based on payload, e.g., if payload is bool available
|
||||
if available, ok := event.Payload.(bool); ok {
|
||||
if available {
|
||||
item.Stock = StockStatus(1) // assuming 1 is in stock
|
||||
item.Stock = 1 // assuming 1 is in stock
|
||||
} else {
|
||||
item.Stock = StockStatus(0) // out of stock
|
||||
item.Stock = 0 // out of stock
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user