Added shared projects
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using LiteCharms.Models;
|
||||
|
||||
namespace LiteCharms.Features.Leads.Queries;
|
||||
|
||||
public class GetCustomerLeadsQuery : IRequest<Result<Lead[]>>
|
||||
{
|
||||
public Guid CustomerId { get; }
|
||||
|
||||
public DateOnly From { get; set; }
|
||||
|
||||
public DateOnly To { get; set; }
|
||||
|
||||
private GetCustomerLeadsQuery(Guid customerId, DateOnly from, DateOnly to)
|
||||
{
|
||||
CustomerId = customerId;
|
||||
From = from;
|
||||
To = to;
|
||||
}
|
||||
|
||||
public static GetCustomerLeadsQuery Create(Guid customerId, DateOnly from, DateOnly to)
|
||||
{
|
||||
if(customerId == Guid.Empty)
|
||||
throw new ArgumentException("Customer ID cannot be empty.", nameof(customerId));
|
||||
|
||||
if(from > to)
|
||||
throw new ArgumentException("The 'From' date cannot be later than the 'To' date.");
|
||||
|
||||
return new(customerId, from, to);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user