Skip to main content

Location status validation rules for closure dates, reopen dates, and operational status values

Location Status

LocationStatusMustBePresent

DefinitionSeverityAPISampleMode
Validate that locationStatus is present
VIOLATION
POST_AND_PUT
S

NewLocationIsClosed

DefinitionSeverityAPISampleMode
Validate that locationStatus is not CLOSED
WARNING
POST
Link
S
Example Validation Report
{
"code": "VALIDATION__NewLocationIsClosed",
"severity": "WARNING",
"message": "New Location's locationStatus is CLOSED",
"details": {
"createdDate": "2026-02-10T11:36:02.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.status",
"value": "CLOSED"
}
],
"compared": [],
"expected": []
}
}

UpdatedLocationIsStillClosed

Preconditions
Current stored record's locationStatus is "CLOSED"
DefinitionSeverityAPISampleMode
Validate that locationStatus is not "CLOSED"
VIOLATION
PUT
S
Example Validation Report
{
"code": "VALIDATION__UpdatedLocationIsStillClosed",
"severity": "VIOLATION",
"message": "A `CLOSED` location should not be updated if still `CLOSED`"
}

Closed Date

ClosedDateMustBeBeforeReopenDate

Preconditions
status is "TEMPORARILY_CLOSED"
DefinitionSeverityAPISampleMode
Validate that the closedDate is before reopenDate
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__ClosedDateMustBeBeforeReopenDate",
"severity": "VIOLATION",
"message": "`closedDate` value is `{{value}}` which is after `reopenDate`",
"context": {
"value": "2026-06-23"
}
}

ClosedDateMustNotBePresentWhenStatusIsOpeningSoon

DefinitionSeverityAPISampleMode
Validate that closedDate is not present when status is OPENING_SOON
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__ClosedDateMustNotBePresentWhenStatusIsOpeningSoon",
"severity": "VIOLATION",
"message": "'{{field}}' must not be present when `status` is `OPENING_SOON`",
"context": {
"field": "$.locationDetails.locationStatus.closedDate"
}
}

ClosedDateMustNotBeFutureTimestamp

DefinitionSeverityAPISampleMode
Validate that closedDate is not a future timestamp
VIOLATION
POST_AND_PUT
Link
S

ClosedDateMustBePresentWhenStatusIsClosed

DefinitionSeverityAPISampleMode
Validate that closedDate is present when status is "CLOSED"
VIOLATION
POST_AND_PUT
Link
S

ClosedDateMustBePresentWhenStatusIsTemporarilyClosed

DefinitionSeverityAPISampleMode
Validate that closedDate is present when status is "TEMPORARILY_CLOSED"
VIOLATION
POST_AND_PUT
Link
S

OnlyClosedDateMustBePresent

DefinitionSeverityAPISampleMode
Validate that reopenDate is not present when status is "CLOSED"
VIOLATION
POST_AND_PUT
Link
S
Example Validation Report
{
"code": "VALIDATION__OnlyClosedDateMustBePresent",
"severity": "VIOLATION",
"message": "Field '{{field}}' must not be present when `CLOSED`",
"context": {
"field": "reopenDate"
}
}

LocationStatusClosedDateMustHaveValidFormat

DefinitionSeverityAPISampleMode
Validate that formatting of closedDate is valid
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__LocationStatusClosedDateMustHaveValidFormat",
"severity": "VIOLATION",
"message": "Value '{{value}}' in field 'closedDate' is not valid",
"context": {
"value": "01-10-2025"
},
"details": {
"createdDate": "2026-08-01T21:00:00.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.closedDate",
"value": "01-10-2025"
}
],
"compared": [],
"expected": []
}
}

Opening Date

LocationStatusOpeningDateMustHaveValidFormat

DefinitionSeverityAPISampleMode
Validate that formatting of openingDate is valid
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__LocationStatusOpeningDateMustHaveValidFormat",
"severity": "VIOLATION",
"message": "Value '{{value}}' in field 'openingDate' is not valid",
"context": {
"value": "01-10-2025"
},
"details": {
"createdDate": "2026-08-01T21:00:00.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.openingDate",
"value": "01-10-2025"
}
],
"compared": [],
"expected": []
}
}

OpeningDateMustBeFutureTimestamp

DefinitionSeverityAPISampleMode
Validate that openingDate is a future timestamp
WARNING
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__OpeningDateMustBeFutureTimestamp",
"severity": "WARNING",
"message": "Value '{{value}}' in field 'openingDate' is not a future opening date",
"context": {
"value": "2026-11-05"
},
"details": {
"createdDate": "2026-07-01T21:00:00.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.openingDate",
"value": "2026-11-05"
}
],
"compared": [],
"expected": []
}
}

OpeningDateTooFarIntoFuture

DefinitionSeverityAPISampleMode
Validate that openingDate is not more than one hundred and eighty (180) days in advance of the current (system) timestamp
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__OpeningDateTooFarIntoFuture",
"severity": "VIOLATION",
"message": "'openingDate' '{{value}}' is more than 180 days into future",
"context": {
"value": "2030-11-05"
},
"details": {
"createdDate": "2026-10-01T21:00:00.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.openingDate",
"value": "2030-11-05"
}
],
"compared": [],
"expected": []
}
}

OpeningDateMustBePresentWhenStatusIsOpeningSoon

DefinitionSeverityAPISampleMode
Validate that openingDate is present when status is OPENING_SOON
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__OpeningDateMustBePresentWhenStatusIsOpeningSoon",
"severity": "VIOLATION",
"message": "'{{field}}' must be present when `status` is `OPENING_SOON`",
"context": {
"field": "$.locationDetails.locationStatus.openingDate"
}
}

OpeningDateMustNotBePresentWhenStatusIsClosed

DefinitionSeverityAPISampleMode
Validate that openingDate is not present when status is CLOSED
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__OpeningDateMustNotBePresentWhenStatusIsClosed",
"severity": "VIOLATION",
"message": "'{{field}}' must not be present when `status` is `CLOSED`",
"context": {
"field": "$.locationDetails.locationStatus.openingDate"
}
}

OpeningDateMustNotBePresentWhenStatusIsTemporarilyClosed

DefinitionSeverityAPISampleMode
Validate that openingDate is not present when status is TEMPORARILY_CLOSED
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__OpeningDateMustNotBePresentWhenStatusIsTemporarilyClosed",
"severity": "VIOLATION",
"message": "'{{field}}' must not be present when `status` is `TEMPORARILY_CLOSED`",
"context": {
"field": "$.locationDetails.locationStatus.openingDate"
}
}

Reopen Date

LocationStatusReopenDateMustHaveValidFormat

DefinitionSeverityAPISampleMode
Validate that formatting of reopenDate is valid
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__LocationStatusReopenDateMustHaveValidFormat",
"severity": "VIOLATION",
"message": "Value '{{value}}' in field 'reopenDate' is not valid",
"context": {
"value": "01-10-2025"
},
"details": {
"createdDate": "2026-08-01T21:00:00.00Z",
"submitted": [
{
"field": "$.locationDetails.locationStatus.reopenDate",
"value": "01-10-2025"
}
],
"compared": [],
"expected": []
}
}

ReopenDateMustBePresentWhenStatusIsTempClosed

DefinitionSeverityAPISampleMode
Validate that reopenDate is present when status is "TEMPORARILY_CLOSED"
VIOLATION
POST_AND_PUT
Link
S

ReopenDateMustNotBePresentWhenStatusIsOpeningSoon

DefinitionSeverityAPISampleMode
Validate that reopenDate is not present when status is OPENING_SOON
VIOLATION
POST_AND_PUT
S
Example Validation Report
{
"code": "VALIDATION__ReopenDateMustNotBePresentWhenStatusIsOpeningSoon",
"severity": "VIOLATION",
"message": "'{{field}}' must not be present when `status` is `OPENING_SOON`",
"context": {
"field": "$.locationDetails.locationStatus.reopenDate"
}
}

Status

LocationStatusStatusMustBeValid

DefinitionSeverityAPISampleMode
Validate that status value is valid
VIOLATION
POST_AND_PUT
Link
S

NewLocationIsTemporarilyClosed

DefinitionSeverityAPISampleMode
Validate that locationStatus is not TEMPORARILY_CLOSED
WARNING
POST
Link
S

LocationStatusStatusMustBePresent

DefinitionSeverityAPISampleMode
Validate that status is present
VIOLATION
POST_AND_PUT
S

LocationStatusStatusMustNotBeEmpty

DefinitionSeverityAPISampleMode
Validate that status is not an empty string
VIOLATION
POST_AND_PUT
S