Files
components/LiteCharms.Features/Orders/Commands/CreateOrderCommand.cs
T
Khwezi Mngoma 83f51c6a23 Added notifications
Added shopping cart and items
Added quotes
Refactored relatinoships
Migrated changes
Refactored cqrs commands and queries
Refactored mappings
2026-05-05 23:59:31 +02:00

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);
}
}