From f0c487b5e1c071a371e5be56cb6161fc041452d7 Mon Sep 17 00:00:00 2001 From: matst80 Date: Mon, 1 Dec 2025 09:36:59 +0100 Subject: [PATCH] test a version --- cmd/cart/main.go | 2 +- pkg/cart/cart-grain.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cart/main.go b/cmd/cart/main.go index 8f0b1f4..7f5b0d6 100644 --- a/cmd/cart/main.go +++ b/cmd/cart/main.go @@ -106,7 +106,7 @@ func main() { _, span := tracer.Start(ctx, "Totals and promotions") defer span.End() g.UpdateTotals() - + g.Version++ // promotionCtx := promotions.NewContextFromCart(g, promotions.WithNow(time.Now()), promotions.WithCustomerSegment("vip")) // _, actions := promotionService.EvaluateAll(promotionData.State.Promotions, promotionCtx) // for _, action := range actions { diff --git a/pkg/cart/cart-grain.go b/pkg/cart/cart-grain.go index c0555ee..7633af3 100644 --- a/pkg/cart/cart-grain.go +++ b/pkg/cart/cart-grain.go @@ -108,6 +108,7 @@ type CartGrain struct { lastAccess time.Time lastChange time.Time // unix seconds of last successful mutation (replay sets from event ts) userId string + Version uint InventoryReserved bool `json:"inventoryReserved"` Id CartId `json:"id"` Items []*CartItem `json:"items"`