feat: add cron skipping date
This commit is contained in:
@ -31,9 +31,33 @@ public class ScheduleSettings : IIsConfigured
|
||||
public PairPeriodTime(Dto.Common.PairPeriodTime time) : this(time.Start, time.End) { }
|
||||
}
|
||||
|
||||
public record struct CronUpdateSkip
|
||||
{
|
||||
public DateOnly? Start { get; set; }
|
||||
public DateOnly? End { get; set; }
|
||||
public DateOnly? Date { get; set; }
|
||||
|
||||
public CronUpdateSkip(DateOnly d1, DateOnly d2)
|
||||
{
|
||||
if (d1 > d2)
|
||||
{
|
||||
Start = d2;
|
||||
End = d1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Start = d1;
|
||||
End = d2;
|
||||
}
|
||||
}
|
||||
|
||||
public CronUpdateSkip(DateOnly d1) => Date = d1;
|
||||
}
|
||||
|
||||
public required string CronUpdateSchedule { get; set; }
|
||||
public DateOnly StartTerm { get; set; }
|
||||
public required IDictionary<int, PairPeriodTime> PairPeriod { get; set; }
|
||||
public List<CronUpdateSkip> CronUpdateSkipDateList { get; set; } = [];
|
||||
|
||||
public bool IsConfigured()
|
||||
{
|
||||
|
Reference in New Issue
Block a user