Contest opening hours validation rules for days, times, formats, and operational constraints
note
Additional preconditions for all listed validations:
$.contestDetails.value.openingHoursByDayis present- The value of
$.contestDetails.value.openingHoursByDayis notnull
Opening Hours by Day
OpeningHoursByDayListMustNotIncludeNulls
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that a list does not include null | Link |
Day
OpeningHoursDayMustBePresent
| Preconditions |
|---|
openingHoursByDay is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that day is present | Link |
OpeningHoursDayMustNotBeEmpty
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that day is not an empty string |
OpeningHoursDayMustBeValid
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that day value is valid | Link |
OpeningHoursDayMustBeDistinct
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that each day value is distinct |
Times
HoursAreWithin06:00To11:00Range
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that all hours are not within the range of 06:00 and 11:00 |
InsufficientOpeningHoursByDayForCategory
| Preconditions |
|---|
categories is any of: restaurants, food, shopping |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that at least four (4) days are present |
MajorityOfHoursNotWithin08:00To20:00Range
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that the majority of hours fall within the range of 08:00 and 20:00 |
OpeningHoursByDayTimesListMustNotIncludeNulls
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that a list does not include null | Link |
OpeningHoursTimesMustBePresent
| Preconditions |
|---|
openingHoursByDay is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that times is present | Link |
OpeningHoursStartTimeMustBePresent
| Preconditions |
|---|
times is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that startTime is present |
OpeningHoursStartTimeMustNotBeEmpty
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that startTime is not an empty string |
OpeningHoursEndTimeMustBePresent
| Preconditions |
|---|
times is present |
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that endTime is present |
OpeningHoursEndTimeMustNotBeEmpty
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that endTime is not an empty string |
OpeningHoursStartTimeMustNotMatchEndTime
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that startTime does not match endTime | Link |
OpeningHoursDaysTimesMustNotMatch
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that listed times do not match | Link |
OpeningHoursDaysTimesMustNotOverlap
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that listed times do not overlap | Link |
OpeningHoursStartTimeMustHaveValidFormat
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that startTime formatting is valid | Link |
OpeningHoursEndTimeMustHaveValidFormat
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that endTime formatting is valid | Link |
ShouldBeOpenMoreThanTwoHours
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that listed times during a day total at least two (2) hours |
ShouldBeOpenMoreThanOneHour
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that listed times during a day total at least one (1) hour |
SuspiciousWeekendRestriction
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that days are not restricted to only SATURDAY or SUNDAY, or just those days | Link |
SuspiciouslyShortClosureBetweenTimesInDay
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
Validate that minutes interval between times in a day is greater than threshold (15 minutes) | Link |
SuspiciousWeekdayTimeVariance
| Definition | Severity | API | Sample | Mode |
|---|---|---|---|---|
| Validate that a comparison of times between days Monday through Friday, inclusive, does not render a difference of four (4) hours | Link |