Implemented shopping carts functionality elements
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
namespace LiteCharms.Features.ShoppingCarts.Commands;
|
||||
|
||||
public class RemoveShoppingCartItemCommand : IRequest<Result>
|
||||
{
|
||||
public Guid ShoppingCartId { get; set; }
|
||||
|
||||
public Guid ShoppingCartItemId { get; set; }
|
||||
|
||||
private RemoveShoppingCartItemCommand(Guid shoppingCartId, Guid shoppingCartItemId)
|
||||
{
|
||||
ShoppingCartId = shoppingCartId;
|
||||
ShoppingCartItemId = shoppingCartItemId;
|
||||
}
|
||||
|
||||
public static RemoveShoppingCartItemCommand Create(Guid shoppingCartId, Guid shoppingCartItemId)
|
||||
{
|
||||
if (shoppingCartId == Guid.Empty)
|
||||
throw new ArgumentException($"Shopping cart ID is required", nameof(shoppingCartId));
|
||||
|
||||
if (shoppingCartItemId == Guid.Empty)
|
||||
throw new ArgumentException($"Shopping cart item required", nameof(shoppingCartItemId));
|
||||
|
||||
return new(shoppingCartId, shoppingCartItemId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user