Table of Contents

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

DayOfWeek

HourEnd

Represents the ending hour of the duty period.

public int HourEnd { get; set; }

Property Value

int

HourStart

Represents the starting hour of the duty period.

public int HourStart { get; set; }

Property Value

int

Id

public long Id { get; set; }

Property Value

long

MinuteEnd

Represents the ending minute of the duty period.

public int MinuteEnd { get; set; }

Property Value

int

MinuteStart

Represents the starting minute of the duty period.

public int MinuteStart { get; set; }

Property Value

int

Methods

EndToTimeOnly()

public TimeOnly EndToTimeOnly()

Returns

TimeOnly

IsDutyPeriodApplicable(DateTime)

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

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

public bool IsValid()

Returns

bool

True if the duty period has valid start and end times; otherwise, false.

StartToTimeOnly()

public TimeOnly StartToTimeOnly()

Returns

TimeOnly

TimeUntilShiftEnd(DateTime)

Calculates the time until the end of the duty shift.

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