Retructured solution

This commit is contained in:
Khwezi Mngoma
2026-05-13 20:06:24 +02:00
parent 26075cd9a7
commit a42c51d7b2
231 changed files with 1618 additions and 1408 deletions
@@ -0,0 +1,30 @@
namespace LiteCharms.Features.ShoppingCarts.Commands;
public class UpdateShoppingCartItemCommand : IRequest<Result>
{
public Guid ShoppingCartId { get; set; }
public Guid ShoppingCartItemId { get; set; }
public int Quantity { get; set; }
private UpdateShoppingCartItemCommand(Guid shoppingCartId, Guid shoppingCartItemId, int quantity = 1)
{
ShoppingCartId = shoppingCartId;
ShoppingCartItemId = shoppingCartItemId;
Quantity = quantity;
}
public static UpdateShoppingCartItemCommand Create(Guid shoppingCartId, Guid shoppingCartItemId, int quantity = 1)
{
if (shoppingCartId == Guid.Empty)
throw new ArgumentException($"Shopping cart ID is required", nameof(shoppingCartId));
if (shoppingCartItemId == Guid.Empty)
throw new ArgumentException($"Shopping cart item is required", nameof(shoppingCartItemId));
if (quantity <= 0) throw new ArgumentException($"Quantity must be at least 1", nameof(quantity));
return new(shoppingCartId, shoppingCartItemId, quantity);
}
}