report.schema.json
schemas/report.schema.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Monday report",
"type": "object",
"required": ["business_date", "property_id", "threshold", "rows", "last_7_days", "warnings"],
"properties": {
"business_date": { "type": "string", "format": "date" },
"property_id": { "type": "string" },
"threshold": { "type": "number", "minimum": 0, "maximum": 1 },
"rows": {
"type": "array",
"minItems": 7,
"maxItems": 7,
"items": {
"type": "object",
"required": ["date", "occupancy_on_books", "rooms_available", "below_threshold", "group_rooms_allocated", "group_rooms_picked_up", "rooms_with_open_maintenance", "source_file", "source_row"],
"properties": {
"date": { "type": "string", "format": "date" },
"occupancy_on_books": { "type": "number", "minimum": 0, "maximum": 1 },
"rooms_available": { "type": "integer", "minimum": 0 },
"below_threshold": { "type": "boolean" },
"group_rooms_allocated": { "type": "integer", "minimum": 0 },
"group_rooms_picked_up": { "type": "integer", "minimum": 0 },
"rooms_with_open_maintenance": { "type": "integer", "minimum": 0 },
"source_file": { "type": "string" },
"source_row": { "type": "string" }
},
"additionalProperties": false
}
},
"last_7_days": {
"type": "object",
"required": ["start_date", "end_date", "days", "occupancy_avg", "next_7_days_occupancy_avg", "change_vs_last_7_days"],
"properties": {
"start_date": { "type": "string", "format": "date" },
"end_date": { "type": "string", "format": "date" },
"days": { "type": "integer", "minimum": 1, "maximum": 7 },
"occupancy_avg": { "type": "number", "minimum": 0, "maximum": 1 },
"next_7_days_occupancy_avg": { "type": "number", "minimum": 0, "maximum": 1 },
"change_vs_last_7_days": { "type": "number", "minimum": -1, "maximum": 1 }
},
"additionalProperties": false
},
"warnings": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": false
}