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:
@@ -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>
|
||||||
@@ -7,5 +7,6 @@
|
|||||||
|
|
||||||
<include file="db/changelog/000-baseline.xml"/>
|
<include file="db/changelog/000-baseline.xml"/>
|
||||||
<include file="db/changelog/001-create-events-table.xml"/>
|
<include file="db/changelog/001-create-events-table.xml"/>
|
||||||
|
<include file="db/changelog/002-add-timezone-column.xml"/>
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
@@ -37,6 +37,34 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/ValidationProblemDetail"
|
$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:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
CreateEventRequest:
|
CreateEventRequest:
|
||||||
@@ -44,6 +72,7 @@ components:
|
|||||||
required:
|
required:
|
||||||
- title
|
- title
|
||||||
- dateTime
|
- dateTime
|
||||||
|
- timezone
|
||||||
- expiryDate
|
- expiryDate
|
||||||
properties:
|
properties:
|
||||||
title:
|
title:
|
||||||
@@ -58,6 +87,10 @@ components:
|
|||||||
format: date-time
|
format: date-time
|
||||||
description: Event date and time with UTC offset (ISO 8601)
|
description: Event date and time with UTC offset (ISO 8601)
|
||||||
example: "2026-03-15T20:00:00+01:00"
|
example: "2026-03-15T20:00:00+01:00"
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: IANA timezone of the organizer
|
||||||
|
example: "Europe/Berlin"
|
||||||
location:
|
location:
|
||||||
type: string
|
type: string
|
||||||
maxLength: 500
|
maxLength: 500
|
||||||
@@ -74,6 +107,7 @@ components:
|
|||||||
- organizerToken
|
- organizerToken
|
||||||
- title
|
- title
|
||||||
- dateTime
|
- dateTime
|
||||||
|
- timezone
|
||||||
- expiryDate
|
- expiryDate
|
||||||
properties:
|
properties:
|
||||||
eventToken:
|
eventToken:
|
||||||
@@ -93,11 +127,61 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
example: "2026-03-15T20:00:00+01:00"
|
example: "2026-03-15T20:00:00+01:00"
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: IANA timezone of the organizer
|
||||||
|
example: "Europe/Berlin"
|
||||||
expiryDate:
|
expiryDate:
|
||||||
type: string
|
type: string
|
||||||
format: date
|
format: date
|
||||||
example: "2026-06-15"
|
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:
|
ProblemDetail:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
Reference in New Issue
Block a user