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 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 22:33:18 +01:00
parent 80d79c3596
commit e77e479e2a
3 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="002-add-timezone-column" author="fete">
<addColumn tableName="events">
<column name="timezone" type="varchar(64)" defaultValue="UTC">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View File

@@ -7,5 +7,6 @@
<include file="db/changelog/000-baseline.xml"/>
<include file="db/changelog/001-create-events-table.xml"/>
<include file="db/changelog/002-add-timezone-column.xml"/>
</databaseChangeLog>

View File

@@ -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: