ScheduleRuleModule

PackageFCQRS.Workflows
Due-time calculation for a `ScheduleRule`. Every `DateTime` it takes or returns is UTC.

Summary

NameSignatureSynopsis
nextnext rule anchor afterThe first due time strictly after `after`.
MaxMissedMaxMissed The most due times `missed` returns under `CatchUp.All`.
missedmissed rule anchor lastDue now policyThe due times in `(lastDue, now]` that the policy runs, oldest first.
MaxIntervalMaxInterval The longest `Every` interval: 366 days, which keeps every due time far from the largest `DateTime`.
validatevalidate ruleChecks that a rule can produce due times: a time zone this system can read, at least one day that exists, and an interval from one second to `MaxInterval` (366 days).

next

next rule anchor after
Member
The first due time strictly after `after`. `anchor` is the schedule's creation or last change time, which `Every` counts from. All times are UTC.

Parameters

NameTypeDescription
ruleScheduleRule
anchorDateTime
afterDateTime

Returns

DateTime

MaxMissed

MaxMissed
Member
The most due times `missed` returns under `CatchUp.All`.

Returns

int

missed

missed rule anchor lastDue now policy
Member
The due times in `(lastDue, now]` that the policy runs, oldest first. All times are UTC. `CatchUp.All` returns at most the `MaxMissed` (1000) most recent of them. `CatchUp.Latest` returns at most one.

Parameters

NameTypeDescription
ruleScheduleRule
anchorDateTime
lastDueDateTime
nowDateTime
policyCatchUp

Returns

DateTime list

MaxInterval

MaxInterval
Member
The longest `Every` interval: 366 days, which keeps every due time far from the largest `DateTime`.

Returns

TimeSpan

validate

validate rule
Member
Checks that a rule can produce due times: a time zone this system can read, at least one day that exists, and an interval from one second to `MaxInterval` (366 days). Returns an error, never an exception, whatever the rule holds.

Parameters

NameTypeDescription
ruleScheduleRule

Returns

Result<unit, string>