Class UnitDutyPeriod
- Namespace
- XENBIT.ResQueServe.Core.Models
- Assembly
- RQS.Core.dll
public record UnitDutyPeriod : IUnitDutyPeriod, IEquatable<UnitDutyPeriod>
- Inheritance
-
UnitDutyPeriod
- Implements
- Inherited Members
Properties
Day
Represents the day of the week for the duty period.
public DayOfWeek Day { get; set; }
Property Value
HourEnd
Represents the ending hour of the duty period.
public int HourEnd { get; set; }
Property Value
HourStart
Represents the starting hour of the duty period.
public int HourStart { get; set; }
Property Value
Id
public long Id { get; set; }
Property Value
MinuteEnd
Represents the ending minute of the duty period.
public int MinuteEnd { get; set; }
Property Value
MinuteStart
Represents the starting minute of the duty period.
public int MinuteStart { get; set; }
Property Value
Methods
EndToTimeOnly()
public TimeOnly EndToTimeOnly()
Returns
IsDutyPeriodApplicable(DateTime)
Determines if the duty period is applicable at the specified date and time.
public 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.
public bool IsValid()
Returns
- bool
True if the duty period has valid start and end times; otherwise, false.
StartToTimeOnly()
public TimeOnly StartToTimeOnly()
Returns
TimeUntilShiftEnd(DateTime)
Calculates the time until the end of the duty shift.
public 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.