From e77e479e2a7ff52c0972b907c0e375a8c64fd462 Mon Sep 17 00:00:00 2001 From: nitrix Date: Fri, 6 Mar 2026 22:33:18 +0100 Subject: [PATCH] Add GET /events/{token} endpoint and timezone field to OpenAPI spec OpenAPI: new GetEventResponse schema, timezone on Create request/response. Liquibase: add timezone VARCHAR(64) NOT NULL DEFAULT 'UTC' column. Co-Authored-By: Claude Opus 4.6 --- .../db/changelog/002-add-timezone-column.xml | 16 ++++ .../db/changelog/db.changelog-master.xml | 1 + backend/src/main/resources/openapi/api.yaml | 84 +++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 backend/src/main/resources/db/changelog/002-add-timezone-column.xml diff --git a/backend/src/main/resources/db/changelog/002-add-timezone-column.xml b/backend/src/main/resources/db/changelog/002-add-timezone-column.xml new file mode 100644 index 0000000..950e554 --- /dev/null +++ b/backend/src/main/resources/db/changelog/002-add-timezone-column.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/backend/src/main/resources/db/changelog/db.changelog-master.xml b/backend/src/main/resources/db/changelog/db.changelog-master.xml index 5e156aa..fdd403c 100644 --- a/backend/src/main/resources/db/changelog/db.changelog-master.xml +++ b/backend/src/main/resources/db/changelog/db.changelog-master.xml @@ -7,5 +7,6 @@ + diff --git a/backend/src/main/resources/openapi/api.yaml b/backend/src/main/resources/openapi/api.yaml index 9cf46bf..7108b4c 100644 --- a/backend/src/main/resources/openapi/api.yaml +++ b/backend/src/main/resources/openapi/api.yaml @@ -37,6 +37,34 @@ paths: schema: $ref: "#/components/schemas/ValidationProblemDetail" + /events/{token}: + get: + operationId: getEvent + summary: Get public event details by token + tags: + - events + parameters: + - name: token + in: path + required: true + schema: + type: string + format: uuid + description: Public event token + responses: + "200": + description: Event found + content: + application/json: + schema: + $ref: "#/components/schemas/GetEventResponse" + "404": + description: Event not found + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ProblemDetail" + components: schemas: CreateEventRequest: @@ -44,6 +72,7 @@ components: required: - title - dateTime + - timezone - expiryDate properties: title: @@ -58,6 +87,10 @@ components: format: date-time description: Event date and time with UTC offset (ISO 8601) example: "2026-03-15T20:00:00+01:00" + timezone: + type: string + description: IANA timezone of the organizer + example: "Europe/Berlin" location: type: string maxLength: 500 @@ -74,6 +107,7 @@ components: - organizerToken - title - dateTime + - timezone - expiryDate properties: eventToken: @@ -93,11 +127,61 @@ components: type: string format: date-time example: "2026-03-15T20:00:00+01:00" + timezone: + type: string + description: IANA timezone of the organizer + example: "Europe/Berlin" expiryDate: type: string format: date example: "2026-06-15" + GetEventResponse: + type: object + required: + - eventToken + - title + - dateTime + - timezone + - attendeeCount + - expired + properties: + eventToken: + type: string + format: uuid + description: Public event token + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + title: + type: string + description: Event title + example: "Summer BBQ" + description: + type: string + description: Event description (absent if not set) + example: "Bring your own drinks!" + dateTime: + type: string + format: date-time + description: Event date/time with organizer's UTC offset + example: "2026-03-15T20:00:00+01:00" + timezone: + type: string + description: IANA timezone name of the organizer + example: "Europe/Berlin" + location: + type: string + description: Event location (absent if not set) + example: "Central Park, NYC" + attendeeCount: + type: integer + minimum: 0 + description: Number of confirmed attendees (attending=true) + example: 12 + expired: + type: boolean + description: Whether the event's expiry date has passed + example: false + ProblemDetail: type: object properties: