Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 78 additions & 19 deletions static/openapi/room-management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ info:
API for managing buildings and rooms in the Provadis complex.
Supports CRUD operations for buildings and rooms, room bookings, and availability inquiries.
servers:
- url: https://api.provadis.com/v1
- url: https://sau-portal.de/ase-1/room-mgmt
description: Production server
paths:
/buildings:
Expand Down Expand Up @@ -160,6 +160,14 @@ paths:
tags:
- Rooms
operationId: getRooms
parameters:
- name: composable
in: query
required: false
schema:
default: false
type: boolean
description: If true, only returns rooms that can be used to compose a new room.
responses:
'200':
description: Success. Returns a list of all known rooms.
Expand Down Expand Up @@ -281,13 +289,48 @@ paths:
schema:
type: string
format: uuid
- name: force
in: query
required: false
description: Whether to force deletion even if the room has bookings assigned.
schema:
type: boolean
default: false
responses:
'204':
description: Room deleted successfully.
'400':
description: The room has bookings assigned and cannot be deleted.
'404':
description: Room not found.
/rooms/{roomId}/deletable:
get:
summary: Checks whether a room can be deleted without force deleting.
tags:
- Rooms
operationId: isRoomDeletable
parameters:
- name: roomId
in: path
required: true
schema:
type: string
format: uuid
description: The unique identifier of the room (UUID v7).
responses:
'200':
description: Response whether the room can be deleted without forcing (no bookings assigned).
content:
application/json:
schema:
type: object
properties:
deletable:
type: boolean
required:
- deletable
'404':
description: Room not found.
/rooms/{roomId}/bookings:
get:
summary: Get all bookings for a specific room on a specific date
Expand Down Expand Up @@ -448,6 +491,7 @@ components:
description: Unique identifier for a building
name:
type: string
pattern: '^[A-Za-z0-9\-\.:]+$'
description: Name of the building
example: "Main Campus"
address:
Expand All @@ -457,31 +501,28 @@ components:
description:
type: string
description: Description of the building
state:
$ref: '#/components/schemas/BuildingState'
required:
- id
- name
- address
- state
BuildingCreateRequest:
type: object
properties:
name:
type: string
description: Name of the building
pattern: '^[A-Za-z0-9\-\.:]+$'
minLength: 1
maxLength: 16
address:
type: string
description: Street address of the building
description:
type: string
description: Description of the building
state:
$ref: '#/components/schemas/BuildingState'
required:
- name
- address
- state
Room:
type: object
properties:
Expand All @@ -490,6 +531,9 @@ components:
format: uuid
name:
type: string
chemSymbol:
type: string
pattern: '^[A-Za-z0-9\-\.:]+$'
buildingId:
type: string
format: uuid
Expand All @@ -498,27 +542,50 @@ components:
type: array
items:
$ref: '#/components/schemas/Characteristic'
composedOf:
type: array
items:
$ref: '#/components/schemas/Room'
description: List of rooms this room is made of.
required:
- id
- name
- buildingId
- characteristics
- chemSymbol
- composedOf
RoomCreateRequest:
type: object
properties:
name:
type: string
pattern: '^[A-Za-z0-9\-\.:]+$'
minLength: 1
maxLength: 16
chemSymbol:
type: string
pattern: '^[A-Za-z0-9\-\.:]+$'
minLength: 1
maxLength: 16
buildingId:
type: string
format: uuid
characteristics:
type: array
items:
$ref: '#/components/schemas/Characteristic'
composedOf:
type: array
items:
type: string
format: uuid
description: List of room IDs that this room is made of.
required:
- name
- chemSymbol
- buildingId
- characteristics
- composedOf
Characteristic:
type: object
properties:
Expand Down Expand Up @@ -584,12 +651,11 @@ components:
items:
type: string
format: uuid
studentGroupIds:
studentGroupNames:
type: array
uniqueItems: true
items:
type: string
format: uuid
groupSize:
type: integer
minimum: 1
Expand All @@ -604,7 +670,7 @@ components:
- startTime
- endTime
- lecturerIds
- studentGroupIds
- studentGroupNames
GetAllRoomsResponse:
type: object
properties:
Expand All @@ -623,12 +689,6 @@ components:
$ref: '#/components/schemas/Booking'
required:
- bookings
BuildingState:
type: string
description: Describes the operational state of a building.
enum:
- open
- closed
Booking:
type: object
properties:
Expand All @@ -644,12 +704,11 @@ components:
items:
type: string
format: uuid
studentGroupIds:
studentGroupNames:
type: array
uniqueItems: true
items:
type: string
format: uuid
startTime:
type: string
format: date-time
Expand All @@ -661,5 +720,5 @@ components:
- roomId
- startTime
- endTime
- studentGroupIds
- studentGroupNames
- lecturerIds