26 lines
798 B
C#
26 lines
798 B
C#
namespace LiteCharms.Features.ShoppingCarts.Commands;
|
|
|
|
public class AddPackageToShoppingCartCommand : IRequest<Result>
|
|
{
|
|
public Guid ShoppingCartId { get; set; }
|
|
|
|
public Guid PackageId { get; set; }
|
|
|
|
private AddPackageToShoppingCartCommand(Guid shoppingCartId, Guid packageId)
|
|
{
|
|
ShoppingCartId = shoppingCartId;
|
|
PackageId = packageId;
|
|
}
|
|
|
|
public static AddPackageToShoppingCartCommand Create(Guid shoppingCartId, Guid packageId)
|
|
{
|
|
if (shoppingCartId == Guid.Empty)
|
|
throw new ArgumentException($"Shopping cart ID is required", nameof(shoppingCartId));
|
|
|
|
if (packageId == Guid.Empty)
|
|
throw new ArgumentException($"Package ID is required", nameof(packageId));
|
|
|
|
return new(shoppingCartId, packageId);
|
|
}
|
|
}
|