Files
fete/specs/007-view-event/data-model.md
nitrix 80d79c3596 Add design artifacts for view event feature (007)
Spec, research, data model, API contract, implementation plan, and
task breakdown for the public event detail page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:34:51 +01:00

57 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Data Model: View Event Landing Page (007)
**Date**: 2026-03-06
## Entities
### Event (modified — adds `timezone` field)
| Field | Type | Required | Constraints | Notes |
|-----------------|------------------|----------|--------------------------|----------------------------------|
| id | Long | yes | BIGSERIAL, PK | Internal only, never exposed |
| eventToken | UUID | yes | UNIQUE, NOT NULL | Public identifier in URLs |
| organizerToken | UUID | yes | UNIQUE, NOT NULL | Secret, never in public API |
| title | String | yes | 1200 chars | |
| description | String | no | max 2000 chars | |
| dateTime | OffsetDateTime | yes | | Organizer's original offset |
| timezone | String | yes | IANA zone ID, max 64 | **NEW** — e.g. "Europe/Berlin" |
| location | String | no | max 500 chars | |
| expiryDate | LocalDate | yes | Must be future at create | Auto-deletion trigger |
| createdAt | OffsetDateTime | yes | Server-generated | |
**Validation rules**:
- `timezone` must be a valid IANA zone ID (`ZoneId.getAvailableZoneIds()`).
- `expiryDate` must be in the future at creation time (existing rule).
**State transitions**:
- Active → Expired: when `expiryDate < today` (computed, not stored).
- Active → Cancelled: future (US-18), adds `cancelledAt` + `cancellationMessage`.
### RSVP (future — not created in this feature)
Documented here for context only. Created when the RSVP feature (US-8+) is implemented.
| Field | Type | Required | Constraints |
|------------|---------|----------|------------------------------|
| id | Long | yes | BIGSERIAL, PK |
| eventId | Long | yes | FK → events.id |
| guestName | String | yes | 1100 chars |
| attending | Boolean | yes | true = attending |
| createdAt | OffsetDateTime | yes | Server-generated |
## Relationships
```
Event 1 ←── * RSVP (future)
```
## Type Mapping (full stack)
| Concept | Java | PostgreSQL | OpenAPI | TypeScript |
|--------------|-------------------|---------------|---------------------|------------|
| Event time | `OffsetDateTime` | `timestamptz` | `string` `date-time`| `string` |
| Timezone | `String` | `varchar(64)` | `string` | `string` |
| Expiry date | `LocalDate` | `date` | `string` `date` | `string` |
| Token | `UUID` | `uuid` | `string` `uuid` | `string` |
| Count | `int` | `integer` | `integer` | `number` |