25 lines
535 B
C#
25 lines
535 B
C#
using LiteCharms.Models;
|
|
|
|
namespace LiteCharms.Features.Leads.Queries;
|
|
|
|
public class GetLeadsQuery : IRequest<Result<Lead[]>>
|
|
{
|
|
public DateOnly From { get; set; }
|
|
|
|
public DateOnly To { get; set; }
|
|
|
|
private GetLeadsQuery(DateOnly from, DateOnly to)
|
|
{
|
|
From = from;
|
|
To = to;
|
|
}
|
|
|
|
public static GetLeadsQuery Create(DateOnly from, DateOnly to)
|
|
{
|
|
if (from > to)
|
|
throw new ArgumentException("From date cannot be greater than To date.");
|
|
|
|
return new(from, to);
|
|
}
|
|
}
|