Added support for notifications
This commit is contained in:
@@ -8,17 +8,23 @@ public class GetOrdersQuery : IRequest<Result<Order[]>>
|
||||
|
||||
public DateOnly To { get; set; }
|
||||
|
||||
private GetOrdersQuery(DateOnly from, DateOnly to)
|
||||
public int MaxRecords { get; set; }
|
||||
|
||||
private GetOrdersQuery(DateOnly from, DateOnly to, int maxRecords = 1000)
|
||||
{
|
||||
From = from;
|
||||
To = to;
|
||||
MaxRecords = maxRecords;
|
||||
}
|
||||
|
||||
public static GetOrdersQuery Create(DateOnly from, DateOnly to)
|
||||
public static GetOrdersQuery Create(DateOnly from, DateOnly to, int maxRecords = 1000)
|
||||
{
|
||||
if (from > to)
|
||||
throw new ArgumentException("From date cannot be greater than To date.");
|
||||
|
||||
return new(from, to);
|
||||
if(maxRecords <= 0)
|
||||
throw new ArgumentException("MaxRecords must be a positive integer.");
|
||||
|
||||
return new(from, to, maxRecords);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user