major changes
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 43s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m43s

This commit is contained in:
matst80
2025-12-04 20:56:54 +01:00
parent 6d5358b53b
commit f67eeb3c49
21 changed files with 572 additions and 242 deletions

View File

@@ -23,9 +23,7 @@ func (c *CartMutationContext) ReserveItem(ctx context.Context, cartId CartId, sk
if quantity <= 0 || c.reservationService == nil {
return nil, nil
}
if sku != "919641" {
return nil, nil
}
l := inventory.LocationID("se")
if locationId != nil {
l = inventory.LocationID(*locationId)
@@ -49,6 +47,13 @@ func (c *CartMutationContext) ReserveItem(ctx context.Context, cartId CartId, sk
}
func (c *CartMutationContext) UseReservations(item *CartItem) bool {
if item.ReservationEndTime != nil {
return true
}
return item.Cgm == "55010"
}
func (c *CartMutationContext) ReleaseItem(ctx context.Context, cartId CartId, sku string, locationId *string) error {
if c.reservationService == nil {
return nil
@@ -60,12 +65,6 @@ func (c *CartMutationContext) ReleaseItem(ctx context.Context, cartId CartId, sk
return c.reservationService.ReleaseForCart(ctx, inventory.SKU(sku), l, inventory.CartID(cartId.String()))
}
func Create[T any]() func() *T {
return func() *T {
return new(T)
}
}
func NewCartMultationRegistry(context *CartMutationContext) actor.MutationRegistry {
reg := actor.NewMutationRegistry()