even more refactoring
All checks were successful
Build and Publish / Metadata (push) Successful in 6s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 46s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m8s

This commit is contained in:
2025-10-11 18:17:31 +02:00
parent 9df2f3362a
commit 0ba7410162
5 changed files with 343 additions and 264 deletions

View File

@@ -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)
}