From e91433eda73118f6e2ac89939e65e2a12f4ed08b Mon Sep 17 00:00:00 2001 From: matst80 Date: Mon, 20 Oct 2025 21:43:41 +0200 Subject: [PATCH] process --- cmd/cart/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cart/main.go b/cmd/cart/main.go index 0e48304..1f9ee8d 100644 --- a/cmd/cart/main.go +++ b/cmd/cart/main.go @@ -114,12 +114,14 @@ func main() { log.Printf("Error loading promotions: %v\n", err) } + log.Printf("loaded %d promotions", len(promotionData.State.Promotions)) + promotionService := promotions.NewPromotionService(nil) reg := cart.NewCartMultationRegistry() reg.RegisterProcessor( actor.NewMutationProcessor(func(g *cart.CartGrain) error { - ctx := promotions.NewContextFromCart(g) + ctx := promotions.NewContextFromCart(g, promotions.WithNow(time.Now()), promotions.WithCustomerSegment("vip")) _, actions := promotionService.EvaluateAll(promotionData.State.Promotions, ctx) for _, action := range actions { log.Printf("apply: %V", action)