update more
Some checks failed
Build and Publish / BuildAndDeployArm64 (push) Failing after 4s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 54s

This commit is contained in:
matst80
2025-11-19 07:46:07 +01:00
parent cdece4e0d2
commit ac8b870eb5
3 changed files with 12 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ type CartGrain struct {
lastAccess time.Time lastAccess time.Time
lastChange time.Time // unix seconds of last successful mutation (replay sets from event ts) lastChange time.Time // unix seconds of last successful mutation (replay sets from event ts)
userId string userId string
InventoryReserved bool `json:"inventoryReserved"`
Id CartId `json:"id"` Id CartId `json:"id"`
Items []*CartItem `json:"items"` Items []*CartItem `json:"items"`
TotalPrice *Price `json:"totalPrice"` TotalPrice *Price `json:"totalPrice"`

View File

@@ -45,6 +45,9 @@ func NewCartMultationRegistry() actor.MutationRegistry {
actor.NewMutation(UpsertSubscriptionDetails, func() *messages.UpsertSubscriptionDetails { actor.NewMutation(UpsertSubscriptionDetails, func() *messages.UpsertSubscriptionDetails {
return &messages.UpsertSubscriptionDetails{} return &messages.UpsertSubscriptionDetails{}
}), }),
actor.NewMutation(InventoryReserved, func() *messages.InventoryReserved {
return &messages.InventoryReserved{}
}),
actor.NewMutation(PreConditionFailed, func() *messages.PreConditionFailed { actor.NewMutation(PreConditionFailed, func() *messages.PreConditionFailed {
return &messages.PreConditionFailed{} return &messages.PreConditionFailed{}
}), }),

View File

@@ -0,0 +1,8 @@
package cart
import "git.tornberg.me/go-cart-actor/pkg/messages"
func InventoryReserved(g *CartGrain, m *messages.InventoryReserved) error {
g.InventoryReserved = true
return nil
}