Files
components/LiteCharms.Features/Orders/Commands/CreateOrderCommand.cs
T
2026-05-03 16:10:27 +02:00

26 lines
764 B
C#

namespace LiteCharms.Features.Orders.Commands;
public class CreateOrderCommand : IRequest<Result<Guid>>
{
public Guid CustomerId { get; set; }
public Guid ProductPriceId { get; set; }
private CreateOrderCommand(Guid customerId, Guid productPriceId)
{
CustomerId = customerId;
ProductPriceId = productPriceId;
}
public static CreateOrderCommand Create(Guid customerId, Guid productPriceId)
{
if (customerId == Guid.Empty)
throw new ArgumentException("CustomerId is required.", nameof(customerId));
if (productPriceId == Guid.Empty)
throw new ArgumentException("ProductPriceId is required.", nameof(productPriceId));
return new(customerId, productPriceId);
}
}