83f51c6a23
Added shopping cart and items Added quotes Refactored relatinoships Migrated changes Refactored cqrs commands and queries Refactored mappings
29 lines
884 B
C#
29 lines
884 B
C#
namespace LiteCharms.Features.Orders.Commands;
|
|
|
|
public class CreateOrderCommand : IRequest<Result<Guid>>
|
|
{
|
|
public Guid CustomerId { get; set; }
|
|
|
|
public Guid ShoppingCartId { get; set; }
|
|
|
|
public Guid? QuoteId { get; set; }
|
|
|
|
private CreateOrderCommand(Guid customerId, Guid shoppingCartId, Guid? quoteId = null)
|
|
{
|
|
CustomerId = customerId;
|
|
ShoppingCartId = shoppingCartId;
|
|
QuoteId = quoteId;
|
|
}
|
|
|
|
public static CreateOrderCommand Create(Guid customerId, Guid shoppingCartId, Guid? quoteId = null)
|
|
{
|
|
if (customerId == Guid.Empty)
|
|
throw new ArgumentException("CustomerId is required.", nameof(customerId));
|
|
|
|
if (shoppingCartId == Guid.Empty)
|
|
throw new ArgumentException("ShoppingCartId is required.", nameof(shoppingCartId));
|
|
|
|
return new(customerId, shoppingCartId, quoteId);
|
|
}
|
|
}
|