diff --git a/static_common/common/schemas/ak.schema.json b/static_common/common/schemas/ak.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..c9865d012dd629b4eeba96909693166d668a2543 --- /dev/null +++ b/static_common/common/schemas/ak.schema.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/ak.schema.json", + "title": "AK", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of a room", + "type": "integer", + "minimum": 0 + }, + "duration": { + "description": "The number of consecutive slot units", + "type": "integer", + "exclusiveMinimum": 0 + }, + "room_constraints": { + "description": "Room constraints required by this AK", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "time_constraints": { + "description": "Time constraints required by this AK", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "properties": { + "type": "object", + "properties": { + "conflicts": { + "description": "IDs of all AKs that are in conflict with this AK", + "type": "array", + "items": {"type": "integer"}, + "uniqueItems": true + }, + "dependencies": { + "description": "IDs of all AKs that should be scheduled before this AK", + "type": "array", + "items": {"type": "integer"}, + "uniqueItems": true + } + }, + "required": ["conflicts", "dependencies"] + }, + "info": { + "type": "object", + "properties": { + "name": {"description": "Name of the AK", "type": "string"}, + "head": {"description": "Name of the head of the AK", "type": "string"}, + "description": {"description": "Short description of the AK", "type": "string"}, + "reso": {"description": "Whether this AK intends to introduce a resolution", "type": "boolean"} + }, + "required": ["name", "head", "description", "reso"] + } + }, + "required": ["id", "duration", "room_constraints", "time_constraints", "properties", "info"] +} diff --git a/static_common/common/schemas/participant.schema.json b/static_common/common/schemas/participant.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..66425c995ffe8bf8edbb29943306cbeec58df761 --- /dev/null +++ b/static_common/common/schemas/participant.schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/participant.schema.json", + "title": "Participant", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of a participant", + "type": "integer", + "minimum": 0 + }, + "preferences": { + "description": "AK preferences of the participant", + "type": "array", + "items": { + "type": "object", + "properties": { + "ak_id": { + "type": "integer", + "description": "The unique identifier of the AK", + "minimum": 0 + }, + "required": { + "type": "boolean", + "description": "whether this participant is required for the AK" + }, + "preference_score": { + "type": "integer", + "description": "The prefeference score for this AK", + "default": 0, + "minimum": -1, + "maximum": 2, + "anyOf": [ + {"const": -1}, {"const": 1}, {"const": 2} + ] + } + }, + "required": ["ak_id", "required", "preference_score"] + }, + "uniqueItems": true + }, + "room_constraints": { + "description": "Room constraints required by this participant", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "time_constraints": { + "description": "Time constraints required by this participant", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "info": { + "type": "object", + "properties": {"name": {"description": "Name of the person", "type": "string"}}, + "required": ["name"] + } + }, + "required": ["id", "room_constraints", "time_constraints", "info"] +} diff --git a/static_common/common/schemas/room.schema.json b/static_common/common/schemas/room.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..53f8b5a948434f7f65acec6fee4e46f765b40152 --- /dev/null +++ b/static_common/common/schemas/room.schema.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/room.schema.json", + "title": "Room", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of a room", + "type": "integer", + "minimum": 0 + }, + "capacity": { + "description": "The maximum number of total participants. Unbounded capacity is represented by -1", + "type": "integer", + "minimum": -1 + }, + "fulfilled_room_constraints": { + "description": "Constraints fulfilled by this room", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "time_constraints": { + "description": "Time constraints required by this room", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "info": { + "type": "object", + "properties": { + "name": { + "description": "Name of the room", + "type": "string" + } + }, + "required": ["name"] + } + }, + "required": ["id", "capacity", "fulfilled_room_constraints", "time_constraints", "info"] +} \ No newline at end of file diff --git a/static_common/common/schemas/solver-input.json b/static_common/common/schemas/solver-input.json new file mode 100644 index 0000000000000000000000000000000000000000..f57eb92864f8b2a6a1512b0e3c736c89a0e4e2dc --- /dev/null +++ b/static_common/common/schemas/solver-input.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/solver-input.schema.json", + "type": "object", + "properties": { + "aks": {"$ref": "schema/ak.schema.json"}, + "rooms": {"$ref": "schema/room.schema.json"}, + "participants": {"$ref": "schema/participant.schema.json"}, + "timeslots": {"$ref": "schema/timeslot.schema.json"}, + "info": { + "type": "object", + "properties": { + "title": {"type": "string"}, + "slug": {"type": "string"}, + "place": {"type": "string"}, + "contact_email": {"type": "string"} + } + } + } +} diff --git a/static_common/common/schemas/solver-output.json b/static_common/common/schemas/solver-output.json new file mode 100644 index 0000000000000000000000000000000000000000..10d341e860aa1155dd66b02015a8faaa6dc2b015 --- /dev/null +++ b/static_common/common/schemas/solver-output.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/solver-output.schema.json", + "type": "object", + "properties": { + "input": {"$ref": "schema/solver-input.schema.json"}, + "scheduled_aks": { + "type": "array", + "items": { + "description": "An object representing the scheduling information for one AK", + "type": "object", + "properties": { + "ak_id": { + "description": "The unique identifier of the scheduled AK", + "type": "integer", + "minimum": 0 + }, + "room_id": { + "description": "The unique identifier of the room the AK takes place in", + "type": "integer", + "minimum": 0 + }, + "timeslot_ids": { + "description": "The unique identifiers of all timeslots the AK takes place in", + "type": "array", + "items": { + "description": "The unique identifier of the referenced timeslot", + "type": "integer", + "minimum": 0 + }, + "uniqueItems": true + }, + "participant_ids": { + "description": "The unique identifiers of all participants assigned to the AK", + "type": "array", + "items": { + "description": "The unique identifier of the referenced participant", + "type": "integer", + "minimum": 0 + }, + "uniqueItems": true + } + }, + "required": ["ak_id", "room_id", "timeslot_ids", "participant_ids"] + }, + "uniqueItems": true + } + } +} diff --git a/static_common/common/schemas/timeslot.schema.json b/static_common/common/schemas/timeslot.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..8693ecdd832310d485d96c6144269dc94c887b95 --- /dev/null +++ b/static_common/common/schemas/timeslot.schema.json @@ -0,0 +1,60 @@ + { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/schema/timeslot.schema.json", + "title": "Timeslot", + "type": "object", + "required": ["info", "blocks"], + "properties": { + "info": { + "type": "object", + "properties": { + "duration": {"description": "Duration in hours of a slot unit", "type": "number"}, + "blocknames": { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"}, + "minItems": 2, + "maxItems": 2 + } + } + }, + "required": ["duration"] + }, + "blocks": { + "type": "array", + "description": "Blocks of consecutive timeslots", + "items": { + "type": "array", + "description": "A single block of consecutive timeslots", + "items": { + "type": "object", + "description": "A single timeslot", + "properties": { + "id": { + "description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically.", + "type": "integer", + "minimum": 0 + }, + "info": { + "type": "object", + "properties": { + "start": {"description": "Start datetime of the timeslot", "type": "string"}, + "end": {"description": "End datetime of the timeslot", "type": "string"} + }, + "required": ["start", "end"] + }, + "fulfilled_time_constraints": { + "description": "Time constraints fulfilled by this timeslot", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + } + }, + "required": ["id", "info", "fulfilled_time_constraints"] + } + } + } + } +} + \ No newline at end of file