feature/pubsub #7

Merged
mats merged 67 commits from feature/pubsub into main 2025-11-28 17:45:22 +01:00
Showing only changes of commit c2873ebfc0 - Show all commits

View File

@@ -230,7 +230,11 @@ func (c *CartGrain) GetCurrentState() (*CartGrain, error) {
func (c *CartGrain) HandleInventoryChange(change inventory.InventoryChange) { func (c *CartGrain) HandleInventoryChange(change inventory.InventoryChange) {
for _, item := range c.Items { for _, item := range c.Items {
if item.Sku == change.SKU && change.StockLocationID == *item.StoreId { l := "se"
if item.StoreId != nil {
l = *item.StoreId
}
if item.Sku == change.SKU && change.StockLocationID == l {
item.Stock = uint16(change.Value) item.Stock = uint16(change.Value)
break break
} }