even more refactoring
This commit is contained in:
@@ -113,12 +113,16 @@ func getItemData(sku string, qty int, country string) (*messages.AddItem, error)
|
||||
}
|
||||
|
||||
stock := InStock
|
||||
/*item.t
|
||||
if item.StockLevel == "0" || item.StockLevel == "" {
|
||||
item.HasStock()
|
||||
stockValue, ok := item.GetNumberFieldValue(3)
|
||||
if !ok || stockValue == 0 {
|
||||
stock = OutOfStock
|
||||
} else if item.StockLevel == "5+" {
|
||||
stock = LowStock
|
||||
}*/
|
||||
} else {
|
||||
if stockValue < 5 {
|
||||
stock = LowStock
|
||||
}
|
||||
}
|
||||
|
||||
articleType, _ := item.GetStringFieldValue(1) //.Fields[1].(string)
|
||||
outletGrade, ok := item.GetStringFieldValue(20) //.Fields[20].(string)
|
||||
var outlet *string
|
||||
@@ -169,15 +173,6 @@ func (c *CartGrain) AddItem(sku string, qty int, country string, storeId *string
|
||||
return c.Apply(cartItem, false)
|
||||
}
|
||||
|
||||
/*
|
||||
Legacy storage (event sourcing) removed in oneof refactor.
|
||||
Kept stub (commented) for potential future reintroduction using proto envelopes.
|
||||
|
||||
func (c *CartGrain) GetStorageMessage(since int64) []interface{} {
|
||||
return nil
|
||||
}
|
||||
*/
|
||||
|
||||
func (c *CartGrain) GetState() ([]byte, error) {
|
||||
return json.Marshal(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user