Interface IUnitDutyPeriod
- Namespace
- XENBIT.ResQueServe.Abstractions.Interfaces
- Assembly
- RQS.Abstractions.dll
Represents a duty period for a unit. Duty periods are required if the DutyOptions property is set to OnlyOnPeriods.
public interface IUnitDutyPeriod
Properties
Day
Represents the day of the week for the duty period.
DayOfWeek Day { get; set; }
Property Value
HourEnd
Represents the ending hour of the duty period.
int HourEnd { get; set; }
Property Value
HourStart
Represents the starting hour of the duty period.
int HourStart { get; set; }
Property Value
Id
long Id { get; set; }
Property Value
MinuteEnd
Represents the ending minute of the duty period.
int MinuteEnd { get; set; }
Property Value
MinuteStart
Represents the starting minute of the duty period.
int MinuteStart { get; set; }
Property Value
Methods
EndToTimeOnly()
TimeOnly EndToTimeOnly()
Returns
IsDutyPeriodApplicable(DateTime)
Determines if the duty period is applicable at the specified date and time.
bool IsDutyPeriodApplicable(DateTime dateTime)
Parameters
dateTimeDateTimeThe date and time to check.
Returns
- bool
True if the duty period is applicable at the specified date and time; otherwise, false.
IsValid()
Checks if the duty period has valid start and end times.
bool IsValid()
Returns
- bool
True if the duty period has valid start and end times; otherwise, false.
StartToTimeOnly()
TimeOnly StartToTimeOnly()
Returns
TimeUntilShiftEnd(DateTime)
Calculates the time until the end of the duty shift.
TimeSpan TimeUntilShiftEnd(DateTime currentTime)
Parameters
currentTimeDateTimeThe current time.
Returns
- TimeSpan
The time until the end of the duty shift.
Exceptions
- InvalidOperationException
Thrown if the duty period is not applicable at the given time.