Creating Compliance Rule / Rule Data Model

Prev Next

Compliance Rules can be written against the below properties on the C# class.

The ShiftModel object will be referenced by a variable name of input1.

For example, here is a rule expression checking a shift has a clock on value input1.ClockOn.HasValue && input1.ClockOn.Value != DateTime.MinValue.

    public class ShiftModel
    {
        public Guid Id { get; set; }
        public string ShiftType { get; set; }
        public Guid ResourceId { get; set; }
        
        public string ResourceName { get; set; }

        public DateTime? Start { get; set; }
        public DateTime? End { get; set; }

        public DateTime? ClockOn { get; set; }
        public DateTime? ClockOff { get; set; }

        public List<ShiftModel> PreviousShifts { get; set; } = new List<ShiftModel>();

        public List<ShiftModel> FutureShifts { get; set; } = new List<ShiftModel>();
    }