split cart and checkout and checkout vs payments

This commit is contained in:
matst80
2025-12-02 20:40:07 +01:00
parent ebd1508294
commit 08327854b7
71 changed files with 4555 additions and 5432 deletions

View File

@@ -5,7 +5,7 @@ import (
"time"
"git.k6n.net/go-cart-actor/pkg/actor"
messages "git.k6n.net/go-cart-actor/pkg/messages"
messages "git.k6n.net/go-cart-actor/proto/cart"
"github.com/matst80/go-redis-inventory/pkg/inventory"
)
@@ -70,21 +70,6 @@ func NewCartMultationRegistry(context *CartMutationContext) actor.MutationRegist
actor.NewMutation(context.RemoveItem, func() *messages.RemoveItem {
return &messages.RemoveItem{}
}),
actor.NewMutation(context.InitializeCheckout, func() *messages.InitializeCheckout {
return &messages.InitializeCheckout{}
}),
actor.NewMutation(OrderCreated, func() *messages.OrderCreated {
return &messages.OrderCreated{}
}),
actor.NewMutation(RemoveDelivery, func() *messages.RemoveDelivery {
return &messages.RemoveDelivery{}
}),
actor.NewMutation(SetDelivery, func() *messages.SetDelivery {
return &messages.SetDelivery{}
}),
actor.NewMutation(SetPickupPoint, func() *messages.SetPickupPoint {
return &messages.SetPickupPoint{}
}),
actor.NewMutation(ClearCart, func() *messages.ClearCartRequest {
return &messages.ClearCartRequest{}
}),
@@ -97,12 +82,6 @@ func NewCartMultationRegistry(context *CartMutationContext) actor.MutationRegist
actor.NewMutation(UpsertSubscriptionDetails, func() *messages.UpsertSubscriptionDetails {
return &messages.UpsertSubscriptionDetails{}
}),
actor.NewMutation(context.InventoryReserved, func() *messages.InventoryReserved {
return &messages.InventoryReserved{}
}),
actor.NewMutation(PreConditionFailed, func() *messages.PreConditionFailed {
return &messages.PreConditionFailed{}
}),
actor.NewMutation(SetUserId, func() *messages.SetUserId {
return &messages.SetUserId{}
}),
@@ -115,30 +94,6 @@ func NewCartMultationRegistry(context *CartMutationContext) actor.MutationRegist
actor.NewMutation(SubscriptionAdded, func() *messages.SubscriptionAdded {
return &messages.SubscriptionAdded{}
}),
actor.NewMutation(PaymentStarted, func() *messages.PaymentStarted {
return &messages.PaymentStarted{}
}),
actor.NewMutation(PaymentCompleted, func() *messages.PaymentCompleted {
return &messages.PaymentCompleted{}
}),
actor.NewMutation(PaymentDeclined, func() *messages.PaymentDeclined {
return &messages.PaymentDeclined{}
}),
actor.NewMutation(PaymentEventHandler, func() *messages.PaymentEvent {
return &messages.PaymentEvent{}
}),
actor.NewMutation(ConfirmationViewed, func() *messages.ConfirmationViewed {
return &messages.ConfirmationViewed{}
}),
actor.NewMutation(CreateCheckoutOrder, func() *messages.CreateCheckoutOrder {
return &messages.CreateCheckoutOrder{}
}),
actor.NewMutation(AddGiftcard, func() *messages.AddGiftcard {
return &messages.AddGiftcard{}
}),
actor.NewMutation(RemoveGiftcard, func() *messages.RemoveGiftcard {
return &messages.RemoveGiftcard{}
}),
)
return reg