Table of Contents

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

DayOfWeek

HourEnd

Represents the ending hour of the duty period.

int HourEnd { get; set; }

Property Value

int

HourStart

Represents the starting hour of the duty period.

int HourStart { get; set; }

Property Value

int

Id

long Id { get; set; }

Property Value

long

MinuteEnd

Represents the ending minute of the duty period.

int MinuteEnd { get; set; }

Property Value

int

MinuteStart

Represents the starting minute of the duty period.

int MinuteStart { get; set; }

Property Value

int

Methods

EndToTimeOnly()

TimeOnly EndToTimeOnly()

Returns

TimeOnly

IsDutyPeriodApplicable(DateTime)

Determines if the duty period is applicable at the specified date and time.

bool IsDutyPeriodApplicable(DateTime dateTime)

Parameters

dateTime DateTime

The 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

TimeOnly

TimeUntilShiftEnd(DateTime)

Calculates the time until the end of the duty shift.

TimeSpan TimeUntilShiftEnd(DateTime currentTime)

Parameters

currentTime DateTime

The 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.