only after mutations
All checks were successful
Build and Publish / Metadata (push) Successful in 10s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m15s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m31s

This commit is contained in:
matst80
2025-10-20 21:09:45 +02:00
parent 9ecd91c163
commit 7eb000fd17
2 changed files with 19 additions and 15 deletions

View File

@@ -117,17 +117,19 @@ func main() {
promotionService := promotions.NewPromotionService(nil)
reg := cart.NewCartMultationRegistry()
reg.RegisterProcessor(actor.NewMutationProcessor(func(g *cart.CartGrain) error {
ctx := promotions.NewContextFromCart(g)
_, actions := promotionService.EvaluateAll(promotionData.State.Promotions, ctx)
for _, action := range actions {
log.Printf("apply: %V", action)
}
return nil
}), actor.NewMutationProcessor(func(g *cart.CartGrain) error {
g.UpdateTotals()
return nil
}))
reg.RegisterProcessor(
actor.NewMutationProcessor(func(g *cart.CartGrain) error {
ctx := promotions.NewContextFromCart(g)
_, actions := promotionService.EvaluateAll(promotionData.State.Promotions, ctx)
for _, action := range actions {
log.Printf("apply: %V", action)
}
return nil
}),
actor.NewMutationProcessor(func(g *cart.CartGrain) error {
g.UpdateTotals()
return nil
}))
diskStorage := actor.NewDiskStorage[cart.CartGrain]("data", reg)
poolConfig := actor.GrainPoolConfig[cart.CartGrain]{
MutationRegistry: reg,