125 Commits

Author SHA1 Message Date
Renovate Bot
22b5648dae Update dependency @msw/playwright to v0.6.6
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m40s
CI / build-and-publish (push) Has been skipped
2026-03-17 12:02:41 +00:00
b12106d3bf Merge pull request 'Add iCal download for calendar integration' (#43) from 019-ical-download into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 28s
CI / frontend-e2e (push) Successful in 1m37s
CI / build-and-publish (push) Successful in 1m0s
2026-03-14 11:40:42 +01:00
d0ed6790ef Update E2E tests for kebab menu and add iCal download tests
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m38s
CI / build-and-publish (push) Has been skipped
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:40:51 +01:00
92372b6a59 Add organizer kebab menu, bottom bar, and iCal download integration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:40:40 +01:00
7817ad182b Unify header as fixed top bar with action slot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:40:22 +01:00
9483e9b1f7 Extract shared bar component CSS and add calendar button to RsvpBar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:40:12 +01:00
75e6548403 Add iCal download composable with RFC 5545 VEVENT generation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:39:54 +01:00
d4a1f0dc23 Add slugify utility for filename sanitization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:39:41 +01:00
3d7efb14f7 Add iCal download feature spec and clean up implemented ideas
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:39:31 +01:00
2f8b911af8 Fix datetime-local input overflow and invisible text on iOS Safari
All checks were successful
CI / backend-test (push) Successful in 1m2s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m36s
CI / build-and-publish (push) Successful in 1m16s
The native datetime-local picker on iOS Safari has an intrinsic min-width
that exceeds the form container, and its webkit pseudo-elements don't
inherit the glass text color, making the selected value invisible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:28:13 +01:00
e9791de4e2 Remove manual -webkit-backdrop-filter prefixes
LightningCSS (Vite 8) was stripping the unprefixed backdrop-filter when
it saw the manual -webkit- prefix, breaking blur effects in Firefox and
on production. Let LightningCSS handle prefixing automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:03:33 +01:00
3b4cc7fbb9 Add explicit browserslist to frontend package.json
Ensures deterministic CSS output across build environments (local vs
Docker/Alpine) by pinning browser targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:03:15 +01:00
9c0e9249ce Upgrade Docker frontend stage from Node 24 to Node 25
Aligns the Docker build environment with the local development setup
which already uses Node 25.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:03:04 +01:00
5082ec1333 Merge pull request 'Add organizer cancel-event flow to EventList' (#41) from 018-cancel-event-list into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m36s
CI / build-and-publish (push) Has been skipped
2026-03-13 16:27:50 +01:00
35b488a8be Merge pull request 'Update dependency vite-plugin-vue-devtools to v8.1.0' (#40) from renovate/vite-plugin-vue-devtools-8.x-lockfile into master
Some checks failed
CI / backend-test (push) Successful in 59s
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
Reviewed-on: #40
2026-03-13 16:24:25 +01:00
b067c0ef1e Add organizer cancel-event flow to EventList
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m35s
CI / build-and-publish (push) Has been skipped
Organizers can now cancel events directly from the event list via the
existing PATCH /events/{eventToken} API. The confirmation dialog shows
role-differentiated messaging: "Cancel event?" with a severity warning
for organizers vs. "Remove event?" for attendees. Responses 204, 409,
and 404 all result in successful removal from the local list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:23:04 +01:00
Renovate Bot
42686502d8 Update dependency vite-plugin-vue-devtools to v8.1.0
All checks were successful
CI / backend-test (push) Successful in 53s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m31s
CI / build-and-publish (push) Has been skipped
2026-03-13 02:02:01 +00:00
51ab99fc61 Introduce --color-danger-solid-* CSS variables and replace hardcoded values
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m30s
CI / build-and-publish (push) Successful in 58s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:24:58 +01:00
d52f51d6e1 Match cancel-event confirm button color with ConfirmDialog style
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:22:06 +01:00
c1760ae376 Apply consistent label color to cancel-event bottom sheet
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:19:26 +01:00
6d51327e56 Add touch drag-to-dismiss gesture to BottomSheet
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:15:30 +01:00
96044ae1ed Change create-event page title to "Great, a Party!"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:08:45 +01:00
f972a41e45 Extract BackLink component into App layout
Move back navigation (chevron + "fete" brand) from per-view
definitions into a shared BackLink component rendered in App.vue.
Shown on all pages except home. Hero overlay gets pointer-events:
none so the link stays clickable on the event detail page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:06:03 +01:00
13b01dfba8 Add exclamation mark to RSVP CTA button ("I'm attending!")
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:36:44 +01:00
fd8724db8f Rename role badges to present participle (Organizing, Attending)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:34:36 +01:00
8885dbd722 Soften RSVP cancellation dialog wording
Replace harsh "permanently cancelled" language with friendlier
"The organizer will no longer see you as attending" and rename
buttons from "Cancel attendance" to "Cancel RSVP".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:32:19 +01:00
c51eacb261 Merge pull request 'Implement watch-event feature (017)' (#39) from 017-watch-event into master
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m30s
CI / build-and-publish (push) Has been skipped
2026-03-12 22:25:21 +01:00
c450849e4d Implement watch-event feature (017) with bookmark in RsvpBar
All checks were successful
CI / backend-test (push) Successful in 1m0s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m30s
CI / build-and-publish (push) Has been skipped
Add client-side watch/bookmark functionality: users can save events to
localStorage without RSVPing via a bookmark button next to the "I'm attending"
CTA. Watched events appear in the event list with a "Watching" label.
Bookmark is only visible for visitors (not attendees or organizers).

Includes spec, plan, research, tasks, unit tests, and E2E tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:20:57 +01:00
e01d5ee642 Merge pull request 'Implement cancel-event feature (016)' (#38) from 016-cancel-event into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 38s
CI / frontend-e2e (push) Successful in 1m25s
CI / build-and-publish (push) Successful in 1m31s
2026-03-12 20:42:38 +01:00
d333ab3d39 Refactor domain models to records and move exceptions to sub-package
All checks were successful
CI / backend-test (push) Successful in 1m1s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m25s
CI / build-and-publish (push) Has been skipped
- Convert Event and Rsvp from mutable POJOs to Java records
- Move all 8 exception classes to application.service.exception sub-package
- Add ArchUnit rule enforcing domain models must be records

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:09:27 +01:00
541017965f Implement cancel-event feature (016)
Add PATCH /events/{eventToken} endpoint for organizers to cancel events,
cancellation banner for visitors, and RSVP rejection on cancelled events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:52:22 +01:00
981920f004 Merge pull request 'Update dependency eslint-plugin-oxlint to ~1.55.0' (#36) from renovate/oxlint-monorepo into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m22s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #36
2026-03-12 19:07:29 +01:00
3908c89998 Add spec, plan, and tasks for 016-cancel-event feature
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:03:57 +01:00
bf0f4ffb7f Merge pull request 'Rename path parameter {token} to {eventToken}' (#37) from 015-rename-token-to-eventToken into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m23s
CI / build-and-publish (push) Successful in 1m12s
2026-03-12 18:11:09 +01:00
58043d1507 Rename path parameter {token} to {eventToken} in OpenAPI spec
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m18s
CI / build-and-publish (push) Has been skipped
Aligns the path parameter naming with the value object convention
used throughout the codebase (eventToken, rsvpToken, organizerToken).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:07:44 +01:00
Renovate Bot
264c4ec21f Update dependency eslint-plugin-oxlint to ~1.55.0
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 26s
CI / frontend-e2e (push) Successful in 1m21s
CI / build-and-publish (push) Has been skipped
2026-03-12 17:02:27 +00:00
6d7a55fdb3 Merge pull request 'Update dependency vite to v8' (#31) from renovate/vite-8.x into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m21s
CI / build-and-publish (push) Has been skipped
Merge pull request 'Update dependency vite to v8' (#31)
2026-03-12 17:55:13 +01:00
a8aacf4ee9 Merge pull request 'Update dependency vitest to v4.1.0' (#33) from renovate/vitest-monorepo into master
Some checks failed
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / backend-test (push) Has been cancelled
Merge pull request 'Update dependency vitest to v4.1.0' (#33)
2026-03-12 17:55:02 +01:00
0a404ecde3 Merge pull request 'Update dependency @vitejs/plugin-vue to v6.0.5' (#32) from renovate/vitejs-plugin-vue-6.x-lockfile into master
Some checks failed
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / backend-test (push) Has been cancelled
Merge pull request 'Update dependency @vitejs/plugin-vue to v6.0.5' (#32)
2026-03-12 17:54:54 +01:00
01f9e3dac1 Merge pull request 'Update dependency @vitest/eslint-plugin to v1.6.11' (#34) from renovate/vitest-eslint-plugin-1.x-lockfile into master
Some checks failed
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / backend-test (push) Has been cancelled
Merge pull request 'Update dependency @vitest/eslint-plugin to v1.6.11' (#34)
2026-03-12 17:54:47 +01:00
ad607afe83 Merge pull request 'Update oxlint monorepo' (#29) from renovate/oxlint-monorepo into master
Some checks failed
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / backend-test (push) Has been cancelled
Merge pull request 'Update oxlint monorepo' (#29)
2026-03-12 17:54:40 +01:00
f0424223de Merge pull request 'Update dependency maven to v3.9.14' (#30) from renovate/maven-3.x into master
Some checks failed
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / backend-test (push) Has been cancelled
Merge pull request 'Update dependency maven to v3.9.14' (#30)
2026-03-12 17:54:33 +01:00
7ab9068c14 Merge pull request 'Add cancel RSVP feature' (#35) from 014-cancel-rsvp into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m17s
CI / build-and-publish (push) Has been skipped
2026-03-12 17:49:34 +01:00
41bb17d5c9 Add cancel RSVP feature (backend DELETE endpoint + frontend UI)
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 24s
CI / frontend-e2e (push) Successful in 1m18s
CI / build-and-publish (push) Has been skipped
Allows guests to cancel their RSVP via a DELETE endpoint using their
guestToken. Frontend shows cancel button in RsvpBar and clears local
storage on success. Includes unit tests, integration tests, and E2E spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 17:45:37 +01:00
Renovate Bot
a44b938f08 Update oxlint monorepo
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m12s
CI / build-and-publish (push) Has been skipped
2026-03-12 16:03:22 +00:00
Renovate Bot
7477a953c5 Update dependency @vitest/eslint-plugin to v1.6.11
All checks were successful
CI / backend-test (push) Successful in 1m1s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m9s
CI / build-and-publish (push) Has been skipped
2026-03-12 16:02:57 +00:00
Renovate Bot
7fb296b47f Update dependency vitest to v4.1.0
All checks were successful
CI / backend-test (push) Successful in 1m0s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
2026-03-12 15:02:35 +00:00
Renovate Bot
8ab7d345c8 Update dependency @vitejs/plugin-vue to v6.0.5
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
2026-03-12 15:02:20 +00:00
Renovate Bot
cf2139f229 Update dependency vite to v8
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 27s
CI / frontend-e2e (push) Successful in 1m14s
CI / build-and-publish (push) Has been skipped
2026-03-12 14:02:26 +00:00
Renovate Bot
79f33d659c Update dependency maven to v3.9.14
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
2026-03-12 12:02:00 +00:00
e5b71f8fb8 Merge pull request 'Update oxlint monorepo' (#28) from renovate/oxlint-monorepo into master
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m9s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #28
2026-03-12 10:10:22 +01:00
Renovate Bot
60649ae4de Update oxlint monorepo
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
2026-03-12 07:01:59 +00:00
e90aefae15 Merge pull request 'Update dependency oxlint to ~1.53.0' (#27) from renovate/oxlint-monorepo into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m12s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #27
2026-03-11 14:02:07 +01:00
Renovate Bot
622932418d Update dependency oxlint to ~1.53.0
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 24s
CI / frontend-e2e (push) Successful in 1m11s
CI / build-and-publish (push) Has been skipped
2026-03-11 06:02:47 +00:00
a1855ff8d6 Merge pull request 'Auto-delete expired events via daily scheduled job' (#26) from 013-auto-delete-expired into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m11s
CI / build-and-publish (push) Successful in 1m8s
2026-03-09 22:01:29 +01:00
4bfaee685c Auto-delete expired events via daily scheduled cleanup job
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
Adds a Spring @Scheduled job (daily at 03:00) that deletes all events
whose expiry_date is before CURRENT_DATE using a native SQL DELETE.
RSVPs are cascade-deleted via the existing FK constraint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:58:35 +01:00
2a6a658df9 Merge pull request 'Make expiryDate an internal concern, auto-set to event date + 7 days' (#25) from auto-expiry-date into master
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m9s
CI / build-and-publish (push) Has been skipped
2026-03-09 21:33:43 +01:00
37d378ca59 Merge pull request 'Update dependency @vitest/eslint-plugin to v1.6.10' (#22) from renovate/vitest-eslint-plugin-1.x-lockfile into master
Some checks failed
CI / backend-test (push) Successful in 58s
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
Reviewed-on: #22
2026-03-09 21:30:28 +01:00
0441ca0c33 Make expiryDate an internal concern, auto-set to event date + 7 days
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m12s
CI / build-and-publish (push) Has been skipped
The expiry date is no longer user-facing: it is removed from the API
(request and response) and the frontend. The backend now automatically
calculates it as the event date plus 7 days. The expired banner and
RSVP-bar filtering by expired status are also removed from the UI,
since expiry is purely an internal data-retention mechanism.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:29:12 +01:00
Renovate Bot
e6711b33d4 Update dependency @vitest/eslint-plugin to v1.6.10
All checks were successful
CI / backend-test (push) Successful in 1m0s
CI / frontend-test (push) Successful in 30s
CI / frontend-e2e (push) Successful in 1m11s
CI / build-and-publish (push) Has been skipped
2026-03-09 20:02:48 +00:00
6b3a06a72c Add OG banner and mobile screenshots to README
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 36s
CI / frontend-e2e (push) Successful in 1m28s
CI / build-and-publish (push) Has been skipped
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:00:41 +01:00
448e801ca3 Merge pull request 'Add Open Graph and Twitter Card meta-tags for link previews' (#24) from 012-link-preview into master
All checks were successful
CI / backend-test (push) Successful in 1m0s
CI / frontend-test (push) Successful in 34s
CI / frontend-e2e (push) Successful in 1m13s
CI / build-and-publish (push) Successful in 1m0s
2026-03-09 20:30:10 +01:00
751201617d Add Open Graph and Twitter Card meta-tags for link previews
All checks were successful
CI / backend-test (push) Successful in 1m9s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m12s
CI / build-and-publish (push) Has been skipped
Replace PathResourceResolver SPA fallback with SpaController that
injects OG/Twitter meta-tags into cached index.html template.
Event pages get event-specific tags (title, date, location),
all other pages get generic fete branding. Includes og-image.png
brand asset and forward-headers-strategy for proxy support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:25:39 +01:00
fa34223c10 Add tada emoji as SVG favicon
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 24s
CI / frontend-e2e (push) Successful in 1m12s
CI / build-and-publish (push) Successful in 1m2s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:26:38 +01:00
e6ea9405a6 Merge pull request 'Apply glassmorphism design system across all UI surfaces' (#23) from glassmorphism-event-cards into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 24s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Successful in 1m9s
2026-03-09 19:11:52 +01:00
32f96e4c6f Replace hardcoded color values with glass design tokens
All checks were successful
CI / backend-test (push) Successful in 1m0s
CI / frontend-test (push) Successful in 25s
CI / frontend-e2e (push) Successful in 1m13s
CI / build-and-publish (push) Has been skipped
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:07:43 +01:00
e6c4a21f65 Apply glassmorphism to ConfirmDialog overlay and surface
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:00:39 +01:00
831ffc071a Apply glassmorphism to BottomSheet and RSVP bar status
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:57:30 +01:00
5dd7cb3fb8 Add animated glow border to RSVP CTA button
Wrap the "I'm attending" button with animated glow-border and
glass-inner styling. Update test selectors for new structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:51:21 +01:00
64816558c1 Apply glass utility class to form fields and buttons
Use .glass class on form fields and buttons on gradient backgrounds.
Buttons get gradient glow border via background-clip trick. Solid
white fallback preserved for BottomSheet context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:47:57 +01:00
019ead7be3 Extract glass system into shared CSS utilities and design tokens
Centralize all hardcoded rgba color values into CSS custom properties
and extract glass/glow styles into reusable utility classes (.glass,
.glass-inner, .glow-border, .glow-border--animated) in main.css.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:35:36 +01:00
29974704d0 Apply glassmorphism to meta icon boxes on event detail view
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:22:39 +01:00
877c869a22 Restyle FAB with glass effect and static glow border
Replace solid orange FAB with glassmorphism inner and a conic
gradient border (pink-purple-indigo) with subtle glow halo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:20:50 +01:00
a9743025a7 Fix hero image transition on event detail page
Replace hard-edged color overlay with CSS mask-image fade-out and
increase hero height to 420px for a seamless blend into the aurora
mesh background.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:13:57 +01:00
9f82275c63 Replace linear gradient background with aurora mesh gradient
Use layered radial gradients on a dark base (#1B1730) with
backdrop blur for an organic, aurora-like background effect
that better complements the glassmorphism event cards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:01:46 +01:00
e203ecf687 Apply glassmorphism styling to event cards on list view
Replace solid white event cards with glass-effect cards featuring
backdrop blur, semi-transparent gradient backgrounds, and light
borders that blend with the Electric Dusk gradient background.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:50:20 +01:00
aa3ea04bfc Merge pull request 'Update dependency vue to v3.5.30' (#21) from renovate/vue-monorepo into master
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 24s
CI / frontend-e2e (push) Successful in 1m13s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #21
2026-03-09 17:25:42 +01:00
Renovate Bot
27ca8ab4b8 Update dependency vue to v3.5.30
All checks were successful
CI / backend-test (push) Successful in 1m2s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Has been skipped
2026-03-09 11:17:01 +00:00
752d153cd4 Merge pull request 'Add organizer-only attendee list (011)' (#20) from 011-view-attendee-list into master
All checks were successful
CI / backend-test (push) Successful in 2m5s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m10s
CI / build-and-publish (push) Successful in 1m2s
2026-03-08 18:37:47 +01:00
763811fce6 Add organizer-only attendee list to event detail view (011)
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m11s
CI / build-and-publish (push) Has been skipped
New GET /events/{token}/attendees endpoint returns attendee names when
a valid organizer token is provided (403 otherwise). The frontend
conditionally renders the list below the attendee count for organizers,
silently degrading for visitors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:34:27 +01:00
d7ed28e036 Merge pull request 'Add event list temporal grouping (010)' (#19) from 010-event-list-grouping into master
All checks were successful
CI / backend-test (push) Successful in 1m2s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m9s
CI / build-and-publish (push) Successful in 1m1s
2026-03-08 17:30:35 +01:00
a52d0cd1d3 Add temporal grouping to event list (Today/This Week/Next Week/Later/Past)
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m9s
CI / build-and-publish (push) Has been skipped
Group events into five temporal sections with section headers, date subheaders,
and context-aware time display (clock time for upcoming, relative for past).
Includes new useEventGrouping composable, SectionHeader and DateSubheader
components, full unit and E2E test coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:26:58 +01:00
373f3671f6 Merge pull request 'Redesign event detail view with full-screen layout' (#18) from redesign-event-detail-view into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 1m5s
CI / build-and-publish (push) Has been skipped
2026-03-08 16:51:09 +01:00
8f78c6cd45 Redesign event detail view: full-screen layout with hero image
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 23s
CI / frontend-e2e (push) Successful in 1m5s
CI / build-and-publish (push) Has been skipped
Replace card-based event detail view with full-screen gradient layout.
Add hero image with gradient overlay, icon-based meta rows, and
"About" section. Content renders directly on the gradient background
with white text for an app-native feel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:47:29 +01:00
fe291e36e4 Merge pull request 'Add event list feature (009-list-events)' (#17) from 009-list-events into master
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 1m3s
CI / build-and-publish (push) Successful in 59s
2026-03-08 15:58:04 +01:00
e56998b17c Add event list feature (009-list-events)
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 1m4s
CI / build-and-publish (push) Has been skipped
Enable users to see all their saved events on the home screen, sorted
by date with upcoming events first. Key capabilities:

- EventCard with title, relative time display, and organizer/attendee
  role badge
- Sortable EventList with past-event visual distinction (faded style)
- Empty state when no events are stored
- Swipe-to-delete gesture with confirmation dialog
- Floating action button for quick event creation
- Rename router param :token → :eventToken across all views
- useRelativeTime composable (Intl.RelativeTimeFormat)
- useEventStorage: add validation, removeEvent(), reactive versioning
- Full E2E and unit test coverage for all new components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:53:55 +01:00
1b3eafa8d1 Remove unimplemented specs (009-026) and consolidate ideas into ideen.md
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 56s
CI / build-and-publish (push) Has been skipped
Move feature summaries for 18 unimplemented specs into
.specify/memory/ideen.md before deleting the full spec files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:27:28 +01:00
061d507825 Use GitHub-hosted mirror for gitea-release-action
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 55s
CI / build-and-publish (push) Successful in 10s
The Gitea runner cannot reach gitea.com (IPv6 timeout), so switch to
the akkuman/gitea-release-action mirror hosted on GitHub.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:15:41 +01:00
d79a19ca15 Add Gitea release creation to CI pipeline
Some checks failed
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 57s
CI / build-and-publish (push) Failing after 34s
Generate changelog from commits between tags and create a Gitea release
using the official gitea-release-action after publishing container images.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:08:49 +01:00
2da36058ae Merge pull request 'Add RSVP feature: submit RSVP, block on expired events' (#16) from 008-rsvp into master
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 56s
CI / build-and-publish (push) Successful in 1m4s
2026-03-08 13:39:35 +01:00
90bfd12bf3 Validate expiryDate is strictly after eventDate and harden rejection tests
All checks were successful
CI / backend-test (push) Successful in 59s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 56s
CI / build-and-publish (push) Has been skipped
Adds ExpiryDateBeforeEventException (400) when expiryDate <= eventDate,
asserts DB row count unchanged after every rejection in integration tests,
and replaces all hardcoded dates in EventServiceTest with TODAY-relative
expressions derived from the fixed Clock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:22:10 +01:00
4d6df8d16b Block RSVPs on expired events with 409 Conflict and inject Clock into RsvpService
Adds expiry check to RsvpService using an injected Clock for testability,
handles EventExpiredException in GlobalExceptionHandler as 409 Conflict,
and adds unit + integration tests using relative dates from a fixed clock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:00:30 +01:00
be1c5062a2 Add RSVP frontend: bottom sheet form, RsvpBar, and localStorage persistence
Introduces BottomSheet and RsvpBar components, integrates the RSVP
submission flow into EventDetailView, extends useEventStorage with
saveRsvp/getRsvp, and adds unit tests plus an E2E spec for the RSVP
workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:47:53 +01:00
d9136481d8 Run mvnw verify instead of test in stop hook to include SpotBugs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:05:09 +01:00
e248a2ee06 Add ArchUnit rule: web adapter must not depend on outbound ports
Prevents future regressions where controllers bypass the application layer
and access repositories directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:05:00 +01:00
fc77248c38 Extract CountAttendeesByEventUseCase to decouple controller from repository
The EventController was directly accessing RsvpRepository (an outbound port)
to count attendees, bypassing the application layer. Introduce a dedicated
inbound port and implement it in RsvpService. Remove the now-unused Clock
dependency from RsvpService.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:04:51 +01:00
a625e34fe4 Add RSVP creation endpoint with typed tokens and attendee count
Introduce typed token value objects (EventToken, OrganizerToken,
RsvpToken) and refactor all existing Event code to use them.

Add POST /events/{token}/rsvps endpoint that persists an RSVP and
returns an rsvpToken. Populate attendeeCount in GET /events/{token}
from a real count query instead of hardcoded 0.

Includes: OpenAPI spec, Liquibase migration (rsvps table with
ON DELETE CASCADE), domain model, hexagonal ports/adapters,
service layer, and full test coverage (unit + integration).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:49:49 +01:00
4828d06aba Add 008-rsvp feature spec and design artifacts
Spec, research decisions, implementation plan, data model,
API contract, and task breakdown for the RSVP feature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:48:00 +01:00
cac2903807 Merge pull request 'Update dependency eslint to v10.0.3' (#15) from renovate/eslint-monorepo into master
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 58s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #15
2026-03-07 00:07:17 +01:00
Renovate Bot
210118bf9a Update dependency eslint to v10.0.3
All checks were successful
CI / backend-test (push) Successful in 54s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 52s
CI / build-and-publish (push) Has been skipped
2026-03-06 23:02:21 +00:00
9a78ebd9b0 Add merge-pr skill for Gitea PR + CI workflow
All checks were successful
CI / backend-test (push) Successful in 54s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 53s
CI / build-and-publish (push) Has been skipped
Encodes the workflow for creating PRs, monitoring CI status via
Actions API (cross-referencing head SHA), and merging when green.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:04:55 +01:00
5f50ea991b Merge pull request 'Add public event detail page (007-view-event)' (#14) from 007-view-event into master
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 52s
CI / build-and-publish (push) Successful in 1m1s
Reviewed-on: #14
2026-03-06 22:57:04 +01:00
fd9175925e Use vue-tsc --build in frontend hook to match CI
All checks were successful
CI / backend-test (push) Successful in 57s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 52s
CI / build-and-publish (push) Has been skipped
The hook used --noEmit which is less strict than CI's --build,
causing type errors to slip through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:54:41 +01:00
63108f4eb5 Fix TypeScript type errors in frontend test files
- Add missing timezone field to CreateEventResponse mock
- Fix createTestRouter signature to accept optional token parameter
- Add non-null assertion for dateField element access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:53:36 +01:00
cd71110514 Add test-results/ to gitignore
Some checks failed
CI / backend-test (push) Successful in 1m1s
CI / frontend-test (push) Failing after 17s
CI / frontend-e2e (push) Successful in 52s
CI / build-and-publish (push) Has been skipped
Playwright test artifacts should not be tracked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:34:51 +01:00
76b48d8b61 Add EventDetailView with loading, expired, not-found, and error states
New view fetches event via openapi-fetch, formats date/time with
Intl.DateTimeFormat. Skeleton shimmer during loading (CSS-only).
Create form now sends auto-detected timezone.
Unit tests for all five view states, E2E tests with MSW mocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:34:51 +01:00
e5d0dd5f8f Implement GET /events/{token} backend with timezone support
Domain: add timezone field to Event and CreateEventCommand.
Ports: new GetEventUseCase inbound port.
Service: implement getByEventToken, validate IANA timezone on create.
Controller: map to GetEventResponse, compute expired flag via Clock.
Persistence: timezone column in JPA entity and mapping.
Tests: integration tests use DTOs + ObjectMapper instead of inline JSON,
GET tests seed DB directly via JpaRepository for isolation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:34:51 +01:00
e77e479e2a 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>
2026-03-06 22:34:51 +01:00
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
7efe932621 Merge pull request 'Update actions/upload-artifact action to v7' (#13) from renovate/major-github-artifact-actions into master
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 50s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #13
2026-03-06 22:29:15 +01:00
a56a26b1f0 Merge pull request 'Update actions/setup-node action to v6' (#12) from renovate/actions-setup-node-6.x into master
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 22s
CI / frontend-e2e (push) Successful in 50s
CI / build-and-publish (push) Has been skipped
Reviewed-on: #12
2026-03-06 21:27:18 +01:00
906ba99b75 Merge pull request 'Update actions/setup-java action to v5' (#11) from renovate/actions-setup-java-5.x into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #11
2026-03-06 21:25:03 +01:00
da08752642 Merge pull request 'Update actions/checkout action to v6' (#10) from renovate/actions-checkout-6.x into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #10
2026-03-06 21:22:58 +01:00
014b3b0171 Merge pull request 'Update oxlint monorepo to ~1.51.0' (#6) from renovate/oxlint-monorepo into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #6
2026-03-06 21:20:53 +01:00
33aff5bff5 Merge pull request 'Update dependency @vue/tsconfig to ^0.9.0' (#5) from renovate/vue-tsconfig-0.x into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #5
2026-03-06 21:18:46 +01:00
6de0769d70 Merge pull request 'Update eclipse-temurin Docker tag' (#3) from renovate/eclipse-temurin-25.x into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #3
2026-03-06 21:16:41 +01:00
6a16255984 Merge pull request 'Update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.1' (#2) from renovate/org.codehaus.mojo-build-helper-maven-plugin-3.x into master
Some checks failed
CI / backend-test (push) Has been cancelled
CI / frontend-test (push) Has been cancelled
CI / frontend-e2e (push) Has been cancelled
CI / build-and-publish (push) Has been cancelled
Reviewed-on: #2
2026-03-06 21:14:34 +01:00
Renovate Bot
ca651d4c05 Update actions/upload-artifact action to v7
All checks were successful
CI / backend-test (push) Successful in 56s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 50s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:53 +00:00
Renovate Bot
1e065bef18 Update actions/setup-node action to v6
All checks were successful
CI / backend-test (push) Successful in 1m1s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 53s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:51 +00:00
Renovate Bot
6e655597d7 Update actions/setup-java action to v5
All checks were successful
CI / backend-test (push) Successful in 53s
CI / frontend-test (push) Successful in 20s
CI / frontend-e2e (push) Successful in 49s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:48 +00:00
Renovate Bot
e10b88ee5f Update actions/checkout action to v6
All checks were successful
CI / backend-test (push) Successful in 54s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 49s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:46 +00:00
Renovate Bot
465fc2178f Update oxlint monorepo to ~1.51.0
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 49s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:38 +00:00
Renovate Bot
9e48debca7 Update dependency @vue/tsconfig to ^0.9.0
All checks were successful
CI / backend-test (push) Successful in 54s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 50s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:33 +00:00
Renovate Bot
fc344d3ca0 Update eclipse-temurin Docker tag
All checks were successful
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 50s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:25 +00:00
Renovate Bot
e04a86399c Update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.1
All checks were successful
CI / backend-test (push) Successful in 58s
CI / frontend-test (push) Successful in 21s
CI / frontend-e2e (push) Successful in 51s
CI / build-and-publish (push) Has been skipped
2026-03-06 20:07:22 +00:00
227 changed files with 17909 additions and 2408 deletions

View File

@@ -16,7 +16,7 @@ cd "$CLAUDE_PROJECT_DIR/frontend"
ERRORS=""
# Type-check
if OUTPUT=$(npx vue-tsc --noEmit 2>&1); then
if OUTPUT=$(npm run type-check 2>&1); then
:
else
ERRORS+="Type-check failed:\n$OUTPUT\n\n"

View File

@@ -26,7 +26,7 @@ PASSED=""
# Run backend tests if Java sources changed
if [[ -n "$HAS_BACKEND" ]]; then
if OUTPUT=$(cd backend && ./mvnw test -q 2>&1); then
if OUTPUT=$(cd backend && ./mvnw verify -q 2>&1); then
PASSED+="✓ Backend tests passed. "
else
# Filter: only [ERROR] lines, skip Maven boilerplate

View File

@@ -0,0 +1,94 @@
---
name: merge-pr
description: Create a Gitea pull request, monitor CI pipeline status, and merge when green. Use this skill when the user asks to "create a PR", "merge the PR", "ship it", "make it ready to merge", or when you need to open a pull request and wait for CI before merging. Also use when asked to check CI/PR status on Gitea.
---
# Merge PR
Create a pull request on Gitea, monitor the CI pipeline via the Actions API, and merge once all jobs pass.
## Why this skill exists
The Gitea MCP pull request API does not return CI status directly. To know if a PR is ready to merge, you must cross-reference the PR's `head.sha` with the Actions runs API, find the matching run, and check job conclusions. This skill encodes that workflow so it doesn't have to be rediscovered.
## Prerequisites
The Gitea MCP tools must be available. The key tools are:
- `mcp__gitea__pull_request_write` (method: `create`, `merge`)
- `mcp__gitea__pull_request_read` (method: `get`)
- `mcp__gitea__actions_run_read` (methods: `list_runs`, `list_run_jobs`)
If these tools are not yet loaded, use ToolSearch to discover and load them before proceeding.
## Workflow
### 1. Create the PR
Use `mcp__gitea__pull_request_write` with method `create`. Include a clear title, body with summary and test plan, head branch, and base branch (usually `master`).
Save the returned `head.sha` — you need it to find the CI run.
### 2. Find the CI run for the PR
The Actions API has no direct "get CI status for PR" call. Instead:
```
mcp__gitea__actions_run_read(method: "list_runs", owner, repo, perPage: 5)
```
Find the run whose `head_sha` matches the PR's `head.sha`. This is the CI run triggered by the push that the PR points to. If the branch was force-pushed or new commits were added, always match against the latest `head.sha` from a fresh `get` on the PR.
### 3. Monitor job status
Once you have the run ID:
```
mcp__gitea__actions_run_read(method: "list_run_jobs", owner, repo, run_id: <id>)
```
This returns all jobs with their `status` (queued/in_progress/completed) and `conclusion` (success/failure/skipped/null).
Present a status table to the user:
| Job | Status |
|-----|--------|
| backend-test | success |
| frontend-test | in_progress |
| frontend-e2e | queued |
If jobs are still running, wait ~30 seconds and check again. Don't poll in a tight loop.
### 4. Handle failures
If any job has `conclusion: failure`:
- Use `mcp__gitea__actions_run_read` with method `get_job_log_preview` to fetch the failing job's log
- Report the failure to the user with relevant log output
- Do NOT attempt to merge
### 5. Merge when green
Once all jobs show `conclusion: success` (or `skipped` for conditional jobs like `build-and-publish`):
```
mcp__gitea__pull_request_write(
method: "merge",
owner, repo,
index: <pr_number>,
merge_style: "merge",
delete_branch: true
)
```
Ask the user for confirmation before merging. They may want to review the PR in the web UI first.
### 6. Post-merge cleanup
After a successful merge, suggest:
- `git checkout master && git pull origin master`
- `git branch -d <feature-branch>` (local cleanup)
- Tagging a release if appropriate (see `/release` skill)
## Abbreviated flow
When the user just wants a quick status check (e.g. "how's the PR?"), skip straight to steps 2-3: find the run by SHA, show the job status table.

View File

@@ -7,10 +7,10 @@ jobs:
backend-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
@@ -21,10 +21,10 @@ jobs:
frontend-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Node 24
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 24
@@ -49,10 +49,10 @@ jobs:
frontend-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Node 24
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 24
@@ -66,7 +66,7 @@ jobs:
run: cd frontend && npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
@@ -78,7 +78,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref_name, '.')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Parse SemVer tag
id: semver
@@ -114,3 +116,22 @@ jobs:
docker push "${IMAGE}:${{ steps.semver.outputs.minor }}"
docker push "${IMAGE}:${{ steps.semver.outputs.major }}"
docker push "${IMAGE}:latest"
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
if [ -z "$PREV_TAG" ]; then
git log --oneline --no-merges > RELEASE_NOTES.md
else
git log --oneline --no-merges "${PREV_TAG}..HEAD" > RELEASE_NOTES.md
fi
echo "Container image: \`${IMAGE}:${{ steps.semver.outputs.full }}\`" >> RELEASE_NOTES.md
- name: Create Gitea release
uses: akkuman/gitea-release-action@v1
with:
tag_name: ${{ github.ref_name }}
name: v${{ steps.semver.outputs.full }}
body_path: RELEASE_NOTES.md
token: ${{ github.token }}

3
.gitignore vendored
View File

@@ -14,6 +14,9 @@ Thumbs.db
.agent-tests/
.ralph/*/iteration-*.jsonl
# Test results (Playwright artifacts)
test-results/
# Java/Maven
*.class
*.jar

View File

@@ -107,8 +107,10 @@ Accessibility is a baseline requirement, not an afterthought.
rationale. Never rewrite or delete the original decision.
- The visual design system in `.specify/memory/design-system.md` is authoritative. All
frontend implementation MUST follow it.
- Research reports go to `docs/agents/research/`, implementation plans to
`docs/agents/plan/`.
- Feature specs, research, and plans live in `specs/NNN-feature-name/`
(spec-kit format). Cross-cutting research goes to
`.specify/memory/research/`, cross-cutting plans to
`.specify/memory/plans/`.
- Conversation and brainstorming in German; code, comments, commits, and
documentation in English.
- Documentation lives in the README. No wiki, no elaborate docs site.

View File

@@ -33,12 +33,16 @@ Person erstellt via App eine Veranstaltung und schickt seine Freunden irgendwie
* Updaten der Veranstaltung
* Einsicht angemeldete Gäste, kann bei Bedarf Einträge entfernen
* Featureideen:
* Organisator kann einstellen, ob Attendee-Namensliste öffentlich auf der Event-Seite sichtbar ist (default: nur für Organisator). Wenn öffentlich, muss im RSVP-Bottom-Sheet eine Warnung angezeigt werden, dass der Name öffentlich sichtbar sein wird.
* Link-Previews (OpenGraph Meta-Tags): Generische OG-Tags mit App-Branding (z.B. "fete — Du wurdest eingeladen") damit geteilte Links in WhatsApp/Signal/Telegram hübsch aussehen. Keine Event-Daten an Crawler aus Privacy-Gründen. → Eigene User Story.
* Kalender-Integration: .ics-Download + optional webcal:// für Live-Updates bei Änderungen
* Änderungen zum ursprünglichen Inhalt (z.b. geändertes datum/ort) werden iwi hervorgehoben
* Veranstalter kann Updatenachrichten im Event posten, pro Device wird via LocalStorage gemerkt was man schon gesehen hat (Badge/Hervorhebung für neue Updates)
* QR Code generieren (z.B. für Plakate/Flyer)
* Ablaufdatum als Pflichtfeld, nach dem alle gespeicherten Daten gelöscht werden
* Übersichtsliste im LocalStorage: Alle Events die man zugesagt oder gemerkt hat (vgl. spliit)
* RSVP editieren: Gast kann seine bestehende Zusage bearbeiten (Name ändern via PUT mit rsvpToken) oder zurückziehen (DELETE mit rsvpToken). Bottom Sheet öffnet sich im Edit-Mode mit pre-filled Name + "Zusage zurückziehen"-Button. Später ergänzen: "Absagen und merken" (Kombination mit 011-bookmark-event). Ausgelagert aus 008-rsvp um den Scope klein zu halten.
* Organizer-Gästeliste: Namensliste der Zusagen nur für Organisator sichtbar (über Organizer-Link). Gehört thematisch zu 009-guest-list, nicht zu 008-rsvp.
* Sicherheit/Missbrauchsschutz:
* Nicht-erratbare Event-Tokens (z.B. UUIDs)
* Event-Erstellung ist offen, kein Login/Passwort/Invite-Code nötig
@@ -78,3 +82,66 @@ Die folgenden Punkte wurden in Diskussionen bereits geklärt und sind verbindlic
* Frontend: Vue 3 (mit Vite als Bundler, TypeScript, Vue Router)
* Architekturentscheidungen die NOCH NICHT getroffen wurden (hier darf nichts eigenmächtig entschieden werden!):
* (derzeit keine offenen Architekturentscheidungen)
## Nicht umgesetzte Feature-Ideen (ehemals Specs 009026)
### 010 Event bearbeiten
Organisator kann Titel, Beschreibung, Datum, Ort und Ablaufdatum ändern.
* Formular vorausgefüllt mit aktuellen Werten
* Ablaufdatum muss in der Zukunft liegen
* Ohne Organizer-Token kein Edit-UI sichtbar
### 013 Kalender-Export
.ics-Download (RFC 5545) mit Event-Details, optional webcal:// für Live-Updates.
* Stabile UID aus Event-Token (Re-Import aktualisiert statt dupliziert)
* Bei Absage: STATUS:CANCELLED im .ics
* Kein externer Kalenderservice kontaktiert
### 014 Änderungen hervorheben
Geänderte Felder werden visuell hervorgehoben, wenn der Gast seit der letzten Änderung nicht mehr auf der Seite war.
* Server trackt `last_edited_at` + geänderte Feldnamen
* Client speichert `last_seen_at` in localStorage
* Privacy-freundlich: kein serverseitiges Read-Tracking
### 015 Organisator-Updates
Organisator kann Textnachrichten im Event posten (Pinnwand-Stil).
* Chronologisch sortiert, löschbar durch Organisator
* Nach Ablauf kein Posting mehr möglich
* Ohne Organizer-Token kein Compose-UI
### 016 Gast-Benachrichtigungen
Badge/Indikator bei ungelesenen Organisator-Updates, rein clientseitig via localStorage.
* Eigener Timestamp `updates_last_seen_at` (getrennt von Feld-Änderungen)
* Kein Indikator beim ersten Besuch
* Kein serverseitiges Tracking (Privacy)
### 017 QR-Code
Event-Seite zeigt QR-Code mit der öffentlichen Event-URL.
* Serverseitig generiert (kein externer QR-Service)
* Download als SVG oder hochauflösendes PNG
### 020 PWA
Web App Manifest + Service Worker für Installierbarkeit und Offline-Caching.
* Standalone-Modus ohne Browser-Chrome
* Icon + Name auf Home-Screen
* Alle Assets selbstgehostet
### 021 Farbthemen
Organisator wählt bei Erstellung ein vordefiniertes Farbthema für die Event-Seite.
* Nur auf der Gast-Seite angewendet (nicht global)
* Änderbar beim Bearbeiten
* Unabhängig von Dark/Light Mode
### 022 Headerbild
Organisator sucht Headerbild über integrierte Unsplash-Suche.
* Serverseitig geproxied (Client kontaktiert nie Unsplash)
* Bild lokal gespeichert + Unsplash-Attribution
* Feature deaktiviert wenn kein API-Key konfiguriert
### 026 404-Seite
Catch-all Route für ungültige Pfade mit "Seite nicht gefunden" und Link zur Startseite.
* Folgt dem Design System (Electric Dusk + Sora)
* WCAG AA konform
* Verhindert leere Seiten bei Fehlnavigation
### 027 - Update der EventListe
* Irgendwie ein update der event liste, wenn man sie betritt oder wenn man mit touch die seite nach unten zieht (hier müssen wir noch überlegen, wie wir mit den verschiedenen update fällen umgehen und wie wir das update überhaupt requesten. Ich meine sowas wie: was ist, wenn das event nicht mehr gefunden wurde?)

View File

@@ -0,0 +1,37 @@
# Modern UI Effects Research (2025-2026)
## Liquid Glass (Apple WWDC 2025)
Evolved glassmorphism with directional lighting. Three-layer approach: highlight, shadow, illumination.
- `backdrop-filter: blur(20px) saturate(1.5)` — higher saturation than basic glass
- `inset 0 1px 0 rgba(255,255,255,0.15)` — top highlight (light direction)
- `inset 0 -1px 0 rgba(0,0,0,0.1)` — bottom shadow
- Outer drop shadow for depth: `0 8px 32px rgba(0,0,0,0.3)`
- Advanced: SVG `feTurbulence` + `feSpecularLighting` for refraction (Chromium only)
- Browser support: `backdrop-filter` ~88%, Firefox since v103
## Aurora / Gradient Mesh Backgrounds
Stacked animated radial gradients simulating northern lights. Pairs well with glass cards on dark backgrounds.
- Multiple `radial-gradient(ellipse ...)` layers with partial opacity
- Animated via `background-position` shift (GPU-friendly)
- `@property` rule enables direct gradient color animation (broad support since 2024)
- Best for ambient background movement, not for content areas
## Animated Glow Borders
Rotating `conic-gradient` borders with blur halo. Striking on dark backgrounds.
- Outer wrapper with `conic-gradient(from var(--angle), color1, color2, color3, color1)`
- `::before` pseudo with `filter: blur(12px)` and `opacity: 0.5` for glow halo
- `@property --angle` trick to animate custom property inside `conic-gradient`
- Use sparingly — best for single highlight elements (FAB, CTA), not all cards
## Modern Neumorphism (2025-2026 revision)
Subtler than the original trend. Higher contrast, less extreme extrusion, combined with accent colors.
- Light and dark shadow pair: `6px 6px 12px rgba(0,0,0,0.5)` + `-6px -6px 12px rgba(60,50,80,0.15)`
- `border: 1px solid rgba(255,255,255,0.05)` for definition
- Works on dark backgrounds with slightly lighter "uplift" shadow direction
- Better suited for interactive elements (buttons, toggles) than content cards
## Sources
- Apple Liquid Glass CSS: dev.to/gruszdev, dev.to/kevinbism, css-tricks.com, kube.io
- Aurora: dev.to/oobleck, daltonwalsh.com, github.com/mattnewdavid
- Glow borders: frontendmasters.com (Kevin Powell), docode.co.in
- Trends overview: medium.com/design-bootcamp, index.dev, bighuman.com

View File

@@ -49,3 +49,10 @@ The following skills are available and should be used for their respective purpo
- The loop runner is `ralph.sh`. Each run lives in its own directory under `.ralph/`.
- Run directories contain: `instructions.md` (prompt), `chief-wiggum.md` (directives), `answers.md` (human answers), `questions.md` (Ralph's questions), `progress.txt` (iteration log), `meta.md` (metadata), `run.log` (execution log).
- Project specifications (user stories, setup tasks, personas, etc.) live in `specs/` (feature dirs) and `.specify/memory/` (cross-cutting docs).
## Active Technologies
- TypeScript 5.x, Vue 3 (Composition API) + openapi-fetch, Vue Router, Vite (018-cancel-event-list)
- localStorage via `useEventStorage()` composable (018-cancel-event-list)
## Recent Changes
- 018-cancel-event-list: Added TypeScript 5.x, Vue 3 (Composition API) + openapi-fetch, Vue Router, Vite

View File

@@ -1,5 +1,5 @@
# Stage 1: Build frontend
FROM node:24-alpine AS frontend-build
FROM node:25-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
@@ -10,14 +10,14 @@ COPY backend/src/main/resources/openapi/api.yaml \
RUN npm run build
# Stage 2: Build backend with frontend assets baked in
FROM eclipse-temurin:25-jdk-alpine AS backend-build
FROM eclipse-temurin:25.0.2_10-jdk-alpine AS backend-build
WORKDIR /app/backend
COPY backend/ ./
COPY --from=frontend-build /app/frontend/dist src/main/resources/static/
RUN ./mvnw -B -DskipTests -Dcheckstyle.skip -Dspotbugs.skip package
# Stage 3: Runtime
FROM eclipse-temurin:25-jre-alpine
FROM eclipse-temurin:25.0.2_10-jre-alpine
WORKDIR /app
COPY --from=backend-build /app/backend/target/*.jar app.jar
EXPOSE 8080

View File

@@ -1,6 +1,25 @@
# fete
<p align="center">
<img src="frontend/public/og-image.png" alt="fete" width="100%" />
</p>
A privacy-focused, self-hostable web app for event announcements and RSVPs. An alternative to Facebook Events or Telegram groups — reduced to the essentials.
<p align="center">
<strong>Privacy-focused, self-hostable event announcements and RSVPs.</strong><br>
An alternative to Facebook Events or Telegram groups — reduced to the essentials.
</p>
<p align="center">
<img src="docs/screenshots/01-create-event.png" alt="Create Event" width="230" />
&nbsp;&nbsp;&nbsp;
<img src="docs/screenshots/02-event-detail.png" alt="Event Detail" width="230" />
&nbsp;&nbsp;&nbsp;
<img src="docs/screenshots/03-rsvp.png" alt="RSVP" width="230" />
</p>
<p align="center">
<sub>Create events &middot; Share with guests &middot; Collect RSVPs</sub>
</p>
---
## What it does

View File

@@ -1,3 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.13/apache-maven-3.9.13-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip

View File

@@ -179,7 +179,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>add-openapi-sources</id>

View File

@@ -7,4 +7,8 @@
<Match>
<Package name="de.fete.adapter.in.web.model"/>
</Match>
<!-- Constructor-injected Spring beans storing interfaces/proxies are not a real exposure risk -->
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>

View File

@@ -2,9 +2,11 @@ package de.fete;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/** Spring Boot entry point for the fete application. */
@SpringBootApplication
@EnableScheduling
public class FeteApplication {
/** Starts the application. */

View File

@@ -1,11 +1,33 @@
package de.fete.adapter.in.web;
import de.fete.adapter.in.web.api.EventsApi;
import de.fete.adapter.in.web.model.Attendee;
import de.fete.adapter.in.web.model.CreateEventRequest;
import de.fete.adapter.in.web.model.CreateEventResponse;
import de.fete.adapter.in.web.model.CreateRsvpRequest;
import de.fete.adapter.in.web.model.CreateRsvpResponse;
import de.fete.adapter.in.web.model.GetAttendeesResponse;
import de.fete.adapter.in.web.model.GetEventResponse;
import de.fete.adapter.in.web.model.PatchEventRequest;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.InvalidTimezoneException;
import de.fete.domain.model.CreateEventCommand;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.model.Rsvp;
import de.fete.domain.model.RsvpToken;
import de.fete.domain.port.in.CancelRsvpUseCase;
import de.fete.domain.port.in.CountAttendeesByEventUseCase;
import de.fete.domain.port.in.CreateEventUseCase;
import de.fete.domain.port.in.CreateRsvpUseCase;
import de.fete.domain.port.in.GetAttendeesUseCase;
import de.fete.domain.port.in.GetEventUseCase;
import de.fete.domain.port.in.UpdateEventUseCase;
import java.time.DateTimeException;
import java.time.ZoneId;
import java.util.List;
import java.util.UUID;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
@@ -15,32 +37,131 @@ import org.springframework.web.bind.annotation.RestController;
public class EventController implements EventsApi {
private final CreateEventUseCase createEventUseCase;
private final GetEventUseCase getEventUseCase;
private final CreateRsvpUseCase createRsvpUseCase;
private final CancelRsvpUseCase cancelRsvpUseCase;
private final CountAttendeesByEventUseCase countAttendeesByEventUseCase;
private final GetAttendeesUseCase getAttendeesUseCase;
private final UpdateEventUseCase updateEventUseCase;
/** Creates a new controller with the given use case. */
public EventController(CreateEventUseCase createEventUseCase) {
/** Creates a new controller with the given use cases. */
public EventController(
CreateEventUseCase createEventUseCase,
GetEventUseCase getEventUseCase,
CreateRsvpUseCase createRsvpUseCase,
CancelRsvpUseCase cancelRsvpUseCase,
CountAttendeesByEventUseCase countAttendeesByEventUseCase,
GetAttendeesUseCase getAttendeesUseCase,
UpdateEventUseCase updateEventUseCase) {
this.createEventUseCase = createEventUseCase;
this.getEventUseCase = getEventUseCase;
this.createRsvpUseCase = createRsvpUseCase;
this.cancelRsvpUseCase = cancelRsvpUseCase;
this.countAttendeesByEventUseCase = countAttendeesByEventUseCase;
this.getAttendeesUseCase = getAttendeesUseCase;
this.updateEventUseCase = updateEventUseCase;
}
@Override
public ResponseEntity<CreateEventResponse> createEvent(
CreateEventRequest request) {
ZoneId zoneId = parseTimezone(request.getTimezone());
var command = new CreateEventCommand(
request.getTitle(),
request.getDescription(),
request.getDateTime(),
request.getLocation(),
request.getExpiryDate()
zoneId,
request.getLocation()
);
Event event = createEventUseCase.createEvent(command);
var response = new CreateEventResponse();
response.setEventToken(event.getEventToken());
response.setOrganizerToken(event.getOrganizerToken());
response.setTitle(event.getTitle());
response.setDateTime(event.getDateTime());
response.setExpiryDate(event.getExpiryDate());
response.setEventToken(event.eventToken().value());
response.setOrganizerToken(event.organizerToken().value());
response.setTitle(event.title());
response.setDateTime(event.dateTime());
response.setTimezone(event.timezone().getId());
return ResponseEntity.status(HttpStatus.CREATED).body(response);
}
@Override
public ResponseEntity<GetEventResponse> getEvent(UUID eventToken) {
var evtToken = new EventToken(eventToken);
Event event = getEventUseCase.getByEventToken(evtToken)
.orElseThrow(() -> new EventNotFoundException(eventToken));
var response = new GetEventResponse();
response.setEventToken(event.eventToken().value());
response.setTitle(event.title());
response.setDescription(event.description());
response.setDateTime(event.dateTime());
response.setTimezone(event.timezone().getId());
response.setLocation(event.location());
response.setAttendeeCount(
(int) countAttendeesByEventUseCase.countByEvent(evtToken));
response.setCancelled(event.cancelled());
response.setCancellationReason(event.cancellationReason());
return ResponseEntity.ok(response);
}
@Override
public ResponseEntity<Void> patchEvent(
UUID eventToken, UUID organizerToken, PatchEventRequest request) {
updateEventUseCase.cancelEvent(
new EventToken(eventToken),
new OrganizerToken(organizerToken),
request.getCancelled(),
request.getCancellationReason());
return ResponseEntity.noContent().build();
}
@Override
public ResponseEntity<GetAttendeesResponse> getAttendees(
UUID eventToken, UUID organizerToken) {
var evtToken = new EventToken(eventToken);
var orgToken = new OrganizerToken(organizerToken);
List<String> names = getAttendeesUseCase
.getAttendeeNames(evtToken, orgToken);
var attendees = names.stream()
.map(name -> new Attendee().name(name))
.toList();
var response = new GetAttendeesResponse();
response.setAttendees(attendees);
return ResponseEntity.ok(response);
}
@Override
public ResponseEntity<CreateRsvpResponse> createRsvp(
UUID eventToken, CreateRsvpRequest createRsvpRequest) {
var evtToken = new EventToken(eventToken);
Rsvp rsvp = createRsvpUseCase.createRsvp(evtToken, createRsvpRequest.getName());
var response = new CreateRsvpResponse();
response.setRsvpToken(rsvp.rsvpToken().value());
response.setName(rsvp.name());
return ResponseEntity.status(HttpStatus.CREATED).body(response);
}
@Override
public ResponseEntity<Void> cancelRsvp(UUID eventToken, UUID rsvpToken) {
cancelRsvpUseCase.cancelRsvp(new EventToken(eventToken), new RsvpToken(rsvpToken));
return ResponseEntity.noContent().build();
}
private static ZoneId parseTimezone(String timezone) {
try {
return ZoneId.of(timezone);
} catch (DateTimeException e) {
throw new InvalidTimezoneException(timezone);
}
}
}

View File

@@ -1,6 +1,13 @@
package de.fete.adapter.in.web;
import de.fete.application.service.ExpiryDateInPastException;
import de.fete.application.service.exception.EventAlreadyCancelledException;
import de.fete.application.service.exception.EventCancelledException;
import de.fete.application.service.exception.EventExpiredException;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.ExpiryDateBeforeEventException;
import de.fete.application.service.exception.ExpiryDateInPastException;
import de.fete.application.service.exception.InvalidOrganizerTokenException;
import de.fete.application.service.exception.InvalidTimezoneException;
import java.net.URI;
import java.util.List;
import java.util.Map;
@@ -44,6 +51,19 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
return handleExceptionInternal(ex, problemDetail, headers, status, request);
}
/** Handles expiry date before event date. */
@ExceptionHandler(ExpiryDateBeforeEventException.class)
public ResponseEntity<ProblemDetail> handleExpiryDateBeforeEvent(
ExpiryDateBeforeEventException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.BAD_REQUEST, ex.getMessage());
problemDetail.setTitle("Invalid Expiry Date");
problemDetail.setType(URI.create("urn:problem-type:expiry-date-before-event"));
return ResponseEntity.badRequest()
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles expiry date validation failures. */
@ExceptionHandler(ExpiryDateInPastException.class)
public ResponseEntity<ProblemDetail> handleExpiryDateInPast(
@@ -57,6 +77,84 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
.body(problemDetail);
}
/** Handles attempt to cancel an already cancelled event. */
@ExceptionHandler(EventAlreadyCancelledException.class)
public ResponseEntity<ProblemDetail> handleEventAlreadyCancelled(
EventAlreadyCancelledException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.CONFLICT, ex.getMessage());
problemDetail.setTitle("Event Already Cancelled");
problemDetail.setType(URI.create("urn:problem-type:event-already-cancelled"));
return ResponseEntity.status(HttpStatus.CONFLICT)
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles RSVP on cancelled event. */
@ExceptionHandler(EventCancelledException.class)
public ResponseEntity<ProblemDetail> handleEventCancelled(
EventCancelledException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.CONFLICT, ex.getMessage());
problemDetail.setTitle("Event Cancelled");
problemDetail.setType(URI.create("urn:problem-type:event-cancelled"));
return ResponseEntity.status(HttpStatus.CONFLICT)
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles RSVP on expired event. */
@ExceptionHandler(EventExpiredException.class)
public ResponseEntity<ProblemDetail> handleEventExpired(
EventExpiredException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.CONFLICT, ex.getMessage());
problemDetail.setTitle("Event Expired");
problemDetail.setType(URI.create("urn:problem-type:event-expired"));
return ResponseEntity.status(HttpStatus.CONFLICT)
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles invalid organizer token. */
@ExceptionHandler(InvalidOrganizerTokenException.class)
public ResponseEntity<ProblemDetail> handleInvalidOrganizerToken(
InvalidOrganizerTokenException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.FORBIDDEN, ex.getMessage());
problemDetail.setTitle("Forbidden");
problemDetail.setType(URI.create("urn:problem-type:invalid-organizer-token"));
return ResponseEntity.status(HttpStatus.FORBIDDEN)
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles event not found. */
@ExceptionHandler(EventNotFoundException.class)
public ResponseEntity<ProblemDetail> handleEventNotFound(
EventNotFoundException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.NOT_FOUND, ex.getMessage());
problemDetail.setTitle("Event Not Found");
problemDetail.setType(URI.create("urn:problem-type:event-not-found"));
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Handles invalid timezone. */
@ExceptionHandler(InvalidTimezoneException.class)
public ResponseEntity<ProblemDetail> handleInvalidTimezone(
InvalidTimezoneException ex) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(
HttpStatus.BAD_REQUEST, ex.getMessage());
problemDetail.setTitle("Invalid Timezone");
problemDetail.setType(URI.create("urn:problem-type:invalid-timezone"));
return ResponseEntity.badRequest()
.contentType(MediaType.APPLICATION_PROBLEM_JSON)
.body(problemDetail);
}
/** Catches all unhandled exceptions. */
@ExceptionHandler(Exception.class)
public ResponseEntity<ProblemDetail> handleAll(Exception ex) {

View File

@@ -0,0 +1,188 @@
package de.fete.adapter.in.web;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.port.in.GetEventUseCase;
import jakarta.annotation.PostConstruct;
import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
/** Serves the SPA index.html with injected Open Graph and Twitter Card meta-tags. */
@Controller
public class SpaController {
private static final String PLACEHOLDER = "<!-- OG_META_TAGS -->";
private static final int MAX_TITLE_LENGTH = 70;
private static final int MAX_DESCRIPTION_LENGTH = 200;
private static final String GENERIC_TITLE = "fete";
private static final String GENERIC_DESCRIPTION =
"Privacy-focused event planning. Create and share events without accounts.";
private static final DateTimeFormatter DATE_FORMAT =
DateTimeFormatter.ofPattern("EEEE, MMMM d, yyyy 'at' h:mm a", Locale.ENGLISH);
private final GetEventUseCase getEventUseCase;
private String htmlTemplate;
/** Creates a new SpaController. */
public SpaController(GetEventUseCase getEventUseCase) {
this.getEventUseCase = getEventUseCase;
}
/** Loads and caches the index.html template at startup. */
@PostConstruct
void loadTemplate() throws IOException {
var resource = new ClassPathResource("/static/index.html");
if (resource.exists()) {
htmlTemplate = resource.getContentAsString(StandardCharsets.UTF_8);
}
}
/** Serves SPA HTML with generic meta-tags for non-event routes. */
@GetMapping(
value = {"/", "/create", "/events"},
produces = MediaType.TEXT_HTML_VALUE
)
@ResponseBody
public String serveGenericPage(HttpServletRequest request) {
if (htmlTemplate == null) {
return "";
}
String baseUrl = getBaseUrl(request);
return htmlTemplate.replace(PLACEHOLDER, renderTags(buildGenericMeta(baseUrl)));
}
/** Serves SPA HTML with event-specific meta-tags. */
@GetMapping(
value = "/events/{eventToken}",
produces = MediaType.TEXT_HTML_VALUE
)
@ResponseBody
public String serveEventPage(@PathVariable String eventToken,
HttpServletRequest request) {
if (htmlTemplate == null) {
return "";
}
String baseUrl = getBaseUrl(request);
Map<String, String> meta = resolveEventMeta(eventToken, baseUrl);
return htmlTemplate.replace(PLACEHOLDER, renderTags(meta));
}
// --- Meta-tag composition ---
private Map<String, String> buildEventMeta(Event event, String baseUrl) {
var tags = new LinkedHashMap<String, String>();
String title = truncateTitle(event.title());
String description = formatDescription(event);
tags.put("og:title", title);
tags.put("og:description", description);
tags.put("og:url", baseUrl + "/events/" + event.eventToken().value());
tags.put("og:type", "website");
tags.put("og:site_name", GENERIC_TITLE);
tags.put("og:image", baseUrl + "/og-image.png");
tags.put("twitter:card", "summary");
tags.put("twitter:title", title);
tags.put("twitter:description", description);
return tags;
}
private Map<String, String> buildGenericMeta(String baseUrl) {
var tags = new LinkedHashMap<String, String>();
tags.put("og:title", GENERIC_TITLE);
tags.put("og:description", GENERIC_DESCRIPTION);
tags.put("og:url", baseUrl);
tags.put("og:type", "website");
tags.put("og:site_name", GENERIC_TITLE);
tags.put("og:image", baseUrl + "/og-image.png");
tags.put("twitter:card", "summary");
tags.put("twitter:title", GENERIC_TITLE);
tags.put("twitter:description", GENERIC_DESCRIPTION);
return tags;
}
private Map<String, String> resolveEventMeta(String token, String baseUrl) {
try {
UUID uuid = UUID.fromString(token);
Optional<Event> event =
getEventUseCase.getByEventToken(new EventToken(uuid));
if (event.isPresent()) {
return buildEventMeta(event.get(), baseUrl);
}
} catch (IllegalArgumentException ignored) {
// Invalid UUID — fall back to generic
}
return buildGenericMeta(baseUrl);
}
// --- Description formatting ---
private String truncateTitle(String title) {
if (title.length() <= MAX_TITLE_LENGTH) {
return title;
}
return title.substring(0, MAX_TITLE_LENGTH - 3) + "...";
}
private String formatDescription(Event event) {
ZonedDateTime zoned = event.dateTime().atZoneSameInstant(event.timezone());
var sb = new StringBuilder();
sb.append("📅 ").append(zoned.format(DATE_FORMAT));
if (event.location() != null && !event.location().isBlank()) {
sb.append(" · 📍 ").append(event.location());
}
if (event.description() != null && !event.description().isBlank()) {
sb.append("").append(event.description());
}
String result = sb.toString();
if (result.length() > MAX_DESCRIPTION_LENGTH) {
return result.substring(0, MAX_DESCRIPTION_LENGTH - 3) + "...";
}
return result;
}
// --- HTML rendering ---
private String renderTags(Map<String, String> tags) {
var sb = new StringBuilder();
for (var entry : tags.entrySet()) {
String key = entry.getKey();
String value = escapeHtml(entry.getValue());
String attr = key.startsWith("twitter:") ? "name" : "property";
sb.append("<meta ").append(attr).append("=\"").append(key)
.append("\" content=\"").append(value).append("\">\n");
}
return sb.toString().stripTrailing();
}
private String escapeHtml(String input) {
return input
.replace("&", "&amp;")
.replace("\"", "&quot;")
.replace("<", "&lt;")
.replace(">", "&gt;");
}
private String getBaseUrl(HttpServletRequest request) {
return ServletUriComponentsBuilder.fromRequestUri(request)
.replacePath("")
.build()
.toUriString();
}
}

View File

@@ -34,6 +34,9 @@ public class EventJpaEntity {
@Column(name = "date_time", nullable = false)
private OffsetDateTime dateTime;
@Column(nullable = false, length = 64)
private String timezone;
@Column(length = 500)
private String location;
@@ -43,6 +46,12 @@ public class EventJpaEntity {
@Column(name = "created_at", nullable = false)
private OffsetDateTime createdAt;
@Column(name = "cancelled", nullable = false)
private boolean cancelled;
@Column(name = "cancellation_reason", length = 2000)
private String cancellationReason;
/** Returns the internal database ID. */
public Long getId() {
return id;
@@ -103,6 +112,16 @@ public class EventJpaEntity {
this.dateTime = dateTime;
}
/** Returns the IANA timezone name. */
public String getTimezone() {
return timezone;
}
/** Sets the IANA timezone name. */
public void setTimezone(String timezone) {
this.timezone = timezone;
}
/** Returns the event location. */
public String getLocation() {
return location;
@@ -132,4 +151,24 @@ public class EventJpaEntity {
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
/** Returns whether the event is cancelled. */
public boolean isCancelled() {
return cancelled;
}
/** Sets the cancelled flag. */
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
/** Returns the cancellation reason. */
public String getCancellationReason() {
return cancellationReason;
}
/** Sets the cancellation reason. */
public void setCancellationReason(String cancellationReason) {
this.cancellationReason = cancellationReason;
}
}

View File

@@ -3,10 +3,17 @@ package de.fete.adapter.out.persistence;
import java.util.Optional;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
/** Spring Data JPA repository for event entities. */
public interface EventJpaRepository extends JpaRepository<EventJpaEntity, Long> {
/** Finds an event by its public event token. */
Optional<EventJpaEntity> findByEventToken(UUID eventToken);
/** Deletes all events whose expiry date is before today. Returns the number of deleted rows. */
@Modifying
@Query(value = "DELETE FROM events WHERE expiry_date < CURRENT_DATE", nativeQuery = true)
int deleteExpired();
}

View File

@@ -1,9 +1,11 @@
package de.fete.adapter.out.persistence;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.port.out.EventRepository;
import java.time.ZoneId;
import java.util.Optional;
import java.util.UUID;
import org.springframework.stereotype.Repository;
/** Persistence adapter implementing the EventRepository outbound port. */
@@ -25,35 +27,45 @@ public class EventPersistenceAdapter implements EventRepository {
}
@Override
public Optional<Event> findByEventToken(UUID eventToken) {
return jpaRepository.findByEventToken(eventToken).map(this::toDomain);
public Optional<Event> findByEventToken(EventToken eventToken) {
return jpaRepository.findByEventToken(eventToken.value()).map(this::toDomain);
}
@Override
public int deleteExpired() {
return jpaRepository.deleteExpired();
}
private EventJpaEntity toEntity(Event event) {
var entity = new EventJpaEntity();
entity.setId(event.getId());
entity.setEventToken(event.getEventToken());
entity.setOrganizerToken(event.getOrganizerToken());
entity.setTitle(event.getTitle());
entity.setDescription(event.getDescription());
entity.setDateTime(event.getDateTime());
entity.setLocation(event.getLocation());
entity.setExpiryDate(event.getExpiryDate());
entity.setCreatedAt(event.getCreatedAt());
entity.setId(event.id());
entity.setEventToken(event.eventToken().value());
entity.setOrganizerToken(event.organizerToken().value());
entity.setTitle(event.title());
entity.setDescription(event.description());
entity.setDateTime(event.dateTime());
entity.setTimezone(event.timezone().getId());
entity.setLocation(event.location());
entity.setExpiryDate(event.expiryDate());
entity.setCreatedAt(event.createdAt());
entity.setCancelled(event.cancelled());
entity.setCancellationReason(event.cancellationReason());
return entity;
}
private Event toDomain(EventJpaEntity entity) {
var event = new Event();
event.setId(entity.getId());
event.setEventToken(entity.getEventToken());
event.setOrganizerToken(entity.getOrganizerToken());
event.setTitle(entity.getTitle());
event.setDescription(entity.getDescription());
event.setDateTime(entity.getDateTime());
event.setLocation(entity.getLocation());
event.setExpiryDate(entity.getExpiryDate());
event.setCreatedAt(entity.getCreatedAt());
return event;
return new Event(
entity.getId(),
new EventToken(entity.getEventToken()),
new OrganizerToken(entity.getOrganizerToken()),
entity.getTitle(),
entity.getDescription(),
entity.getDateTime(),
ZoneId.of(entity.getTimezone()),
entity.getLocation(),
entity.getExpiryDate(),
entity.getCreatedAt(),
entity.isCancelled(),
entity.getCancellationReason());
}
}

View File

@@ -0,0 +1,68 @@
package de.fete.adapter.out.persistence;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.util.UUID;
/** JPA entity mapping to the rsvps table. */
@Entity
@Table(name = "rsvps")
public class RsvpJpaEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "rsvp_token", nullable = false, unique = true)
private UUID rsvpToken;
@Column(name = "event_id", nullable = false)
private Long eventId;
@Column(nullable = false, length = 100)
private String name;
/** Returns the internal database ID. */
public Long getId() {
return id;
}
/** Sets the internal database ID. */
public void setId(Long id) {
this.id = id;
}
/** Returns the RSVP token. */
public UUID getRsvpToken() {
return rsvpToken;
}
/** Sets the RSVP token. */
public void setRsvpToken(UUID rsvpToken) {
this.rsvpToken = rsvpToken;
}
/** Returns the event ID. */
public Long getEventId() {
return eventId;
}
/** Sets the event ID. */
public void setEventId(Long eventId) {
this.eventId = eventId;
}
/** Returns the guest's display name. */
public String getName() {
return name;
}
/** Sets the guest's display name. */
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,20 @@
package de.fete.adapter.out.persistence;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;
/** Spring Data JPA repository for RSVP entities. */
public interface RsvpJpaRepository extends JpaRepository<RsvpJpaEntity, Long> {
/** Finds an RSVP by its token. */
java.util.Optional<RsvpJpaEntity> findByRsvpToken(UUID rsvpToken);
/** Counts RSVPs for the given event. */
long countByEventId(Long eventId);
/** Finds all RSVPs for the given event, ordered by ID ascending. */
java.util.List<RsvpJpaEntity> findAllByEventIdOrderByIdAsc(Long eventId);
/** Deletes an RSVP by event ID and RSVP token. Returns count of deleted rows. */
long deleteByEventIdAndRsvpToken(Long eventId, UUID rsvpToken);
}

View File

@@ -0,0 +1,60 @@
package de.fete.adapter.out.persistence;
import de.fete.domain.model.Rsvp;
import de.fete.domain.model.RsvpToken;
import de.fete.domain.port.out.RsvpRepository;
import java.util.List;
import org.springframework.stereotype.Repository;
/** Persistence adapter implementing the RsvpRepository outbound port. */
@Repository
public class RsvpPersistenceAdapter implements RsvpRepository {
private final RsvpJpaRepository jpaRepository;
/** Creates a new adapter with the given JPA repository. */
public RsvpPersistenceAdapter(RsvpJpaRepository jpaRepository) {
this.jpaRepository = jpaRepository;
}
@Override
public Rsvp save(Rsvp rsvp) {
RsvpJpaEntity entity = toEntity(rsvp);
RsvpJpaEntity saved = jpaRepository.save(entity);
return toDomain(saved);
}
@Override
public long countByEventId(Long eventId) {
return jpaRepository.countByEventId(eventId);
}
@Override
public List<Rsvp> findByEventId(Long eventId) {
return jpaRepository.findAllByEventIdOrderByIdAsc(eventId).stream()
.map(this::toDomain)
.toList();
}
@Override
public boolean deleteByEventIdAndRsvpToken(Long eventId, RsvpToken rsvpToken) {
return jpaRepository.deleteByEventIdAndRsvpToken(eventId, rsvpToken.value()) > 0;
}
private RsvpJpaEntity toEntity(Rsvp rsvp) {
var entity = new RsvpJpaEntity();
entity.setId(rsvp.id());
entity.setRsvpToken(rsvp.rsvpToken().value());
entity.setEventId(rsvp.eventId());
entity.setName(rsvp.name());
return entity;
}
private Rsvp toDomain(RsvpJpaEntity entity) {
return new Rsvp(
entity.getId(),
new RsvpToken(entity.getRsvpToken()),
entity.getEventId(),
entity.getName());
}
}

View File

@@ -1,18 +1,28 @@
package de.fete.application.service;
import de.fete.application.service.exception.EventAlreadyCancelledException;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.InvalidOrganizerTokenException;
import de.fete.domain.model.CreateEventCommand;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.port.in.CreateEventUseCase;
import de.fete.domain.port.in.GetEventUseCase;
import de.fete.domain.port.in.UpdateEventUseCase;
import de.fete.domain.port.out.EventRepository;
import java.time.Clock;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.UUID;
import java.util.Optional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** Application service implementing event creation. */
/** Application service implementing event creation and retrieval. */
@Service
public class EventService implements CreateEventUseCase {
public class EventService implements CreateEventUseCase, GetEventUseCase, UpdateEventUseCase {
private static final int EXPIRY_DAYS_AFTER_EVENT = 7;
private final EventRepository eventRepository;
private final Clock clock;
@@ -25,20 +35,50 @@ public class EventService implements CreateEventUseCase {
@Override
public Event createEvent(CreateEventCommand command) {
if (!command.expiryDate().isAfter(LocalDate.now(clock))) {
throw new ExpiryDateInPastException(command.expiryDate());
}
LocalDate expiryDate = command.dateTime().toLocalDate().plusDays(EXPIRY_DAYS_AFTER_EVENT);
var event = new Event();
event.setEventToken(UUID.randomUUID());
event.setOrganizerToken(UUID.randomUUID());
event.setTitle(command.title());
event.setDescription(command.description());
event.setDateTime(command.dateTime());
event.setLocation(command.location());
event.setExpiryDate(command.expiryDate());
event.setCreatedAt(OffsetDateTime.now(clock));
var event = new Event(
null,
EventToken.generate(),
OrganizerToken.generate(),
command.title(),
command.description(),
command.dateTime(),
command.timezone(),
command.location(),
expiryDate,
OffsetDateTime.now(clock),
false,
null);
return eventRepository.save(event);
}
@Override
public Optional<Event> getByEventToken(EventToken eventToken) {
return eventRepository.findByEventToken(eventToken);
}
@Transactional
@Override
public void cancelEvent(
EventToken eventToken, OrganizerToken organizerToken,
Boolean cancelled, String reason) {
if (!Boolean.TRUE.equals(cancelled)) {
return;
}
Event event = eventRepository.findByEventToken(eventToken)
.orElseThrow(() -> new EventNotFoundException(eventToken.value()));
if (!event.organizerToken().equals(organizerToken)) {
throw new InvalidOrganizerTokenException();
}
if (event.cancelled()) {
throw new EventAlreadyCancelledException(eventToken.value());
}
eventRepository.save(event.withCancellation(true, reason));
}
}

View File

@@ -0,0 +1,30 @@
package de.fete.application.service;
import de.fete.domain.port.out.EventRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/** Scheduled job that deletes events whose expiry date is in the past. */
@Component
public class ExpiredEventCleanupJob {
private static final Logger log = LoggerFactory.getLogger(ExpiredEventCleanupJob.class);
private final EventRepository eventRepository;
/** Creates a new cleanup job with the given event repository. */
public ExpiredEventCleanupJob(EventRepository eventRepository) {
this.eventRepository = eventRepository;
}
/** Runs daily at 03:00 and deletes all expired events. */
@Scheduled(cron = "0 0 3 * * *")
@Transactional
public void deleteExpiredEvents() {
int deleted = eventRepository.deleteExpired();
log.info("Expired event cleanup: deleted {} event(s)", deleted);
}
}

View File

@@ -0,0 +1,90 @@
package de.fete.application.service;
import de.fete.application.service.exception.EventCancelledException;
import de.fete.application.service.exception.EventExpiredException;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.InvalidOrganizerTokenException;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.model.Rsvp;
import de.fete.domain.model.RsvpToken;
import de.fete.domain.port.in.CancelRsvpUseCase;
import de.fete.domain.port.in.CountAttendeesByEventUseCase;
import de.fete.domain.port.in.CreateRsvpUseCase;
import de.fete.domain.port.in.GetAttendeesUseCase;
import de.fete.domain.port.out.EventRepository;
import de.fete.domain.port.out.RsvpRepository;
import jakarta.transaction.Transactional;
import java.time.Clock;
import java.time.LocalDate;
import java.util.List;
import org.springframework.stereotype.Service;
/** Application service implementing RSVP operations. */
@Service
public class RsvpService
implements CreateRsvpUseCase, CancelRsvpUseCase, CountAttendeesByEventUseCase,
GetAttendeesUseCase {
private final EventRepository eventRepository;
private final RsvpRepository rsvpRepository;
private final Clock clock;
/** Creates a new RsvpService. */
public RsvpService(
EventRepository eventRepository,
RsvpRepository rsvpRepository,
Clock clock) {
this.eventRepository = eventRepository;
this.rsvpRepository = rsvpRepository;
this.clock = clock;
}
@Override
public Rsvp createRsvp(EventToken eventToken, String name) {
Event event = eventRepository.findByEventToken(eventToken)
.orElseThrow(() -> new EventNotFoundException(eventToken.value()));
if (event.cancelled()) {
throw new EventCancelledException(eventToken.value());
}
if (!event.expiryDate().isAfter(LocalDate.now(clock))) {
throw new EventExpiredException(eventToken.value());
}
var rsvp = new Rsvp(null, RsvpToken.generate(), event.id(), name.strip());
return rsvpRepository.save(rsvp);
}
@Override
@Transactional
public void cancelRsvp(EventToken eventToken, RsvpToken rsvpToken) {
eventRepository.findByEventToken(eventToken)
.ifPresent(event ->
rsvpRepository.deleteByEventIdAndRsvpToken(event.id(), rsvpToken));
}
@Override
public long countByEvent(EventToken eventToken) {
Event event = eventRepository.findByEventToken(eventToken)
.orElseThrow(() -> new EventNotFoundException(eventToken.value()));
return rsvpRepository.countByEventId(event.id());
}
@Override
public List<String> getAttendeeNames(EventToken eventToken, OrganizerToken organizerToken) {
Event event = eventRepository.findByEventToken(eventToken)
.orElseThrow(() -> new EventNotFoundException(eventToken.value()));
if (!event.organizerToken().equals(organizerToken)) {
throw new InvalidOrganizerTokenException();
}
return rsvpRepository.findByEventId(event.id()).stream()
.map(Rsvp::name)
.toList();
}
}

View File

@@ -0,0 +1,12 @@
package de.fete.application.service.exception;
import java.util.UUID;
/** Thrown when attempting to cancel an event that is already cancelled. */
public class EventAlreadyCancelledException extends RuntimeException {
/** Creates a new exception for the given event token. */
public EventAlreadyCancelledException(UUID eventToken) {
super("Event is already cancelled: " + eventToken);
}
}

View File

@@ -0,0 +1,12 @@
package de.fete.application.service.exception;
import java.util.UUID;
/** Thrown when an RSVP is attempted on a cancelled event. */
public class EventCancelledException extends RuntimeException {
/** Creates a new exception for the given event token. */
public EventCancelledException(UUID eventToken) {
super("Event is cancelled: " + eventToken);
}
}

View File

@@ -0,0 +1,12 @@
package de.fete.application.service.exception;
import java.util.UUID;
/** Thrown when an RSVP is attempted on an expired event. */
public class EventExpiredException extends RuntimeException {
/** Creates a new exception for the given event token. */
public EventExpiredException(UUID eventToken) {
super("Event has expired: " + eventToken);
}
}

View File

@@ -0,0 +1,12 @@
package de.fete.application.service.exception;
import java.util.UUID;
/** Thrown when an event cannot be found by its token. */
public class EventNotFoundException extends RuntimeException {
/** Creates a new exception for the given event token. */
public EventNotFoundException(UUID eventToken) {
super("Event not found: " + eventToken);
}
}

View File

@@ -0,0 +1,13 @@
package de.fete.application.service.exception;
import java.time.LocalDate;
import java.time.OffsetDateTime;
/** Thrown when an event's expiry date is not after the event date. */
public class ExpiryDateBeforeEventException extends RuntimeException {
/** Creates a new exception for the given dates. */
public ExpiryDateBeforeEventException(LocalDate expiryDate, OffsetDateTime dateTime) {
super("Expiry date " + expiryDate + " must be after event date " + dateTime.toLocalDate());
}
}

View File

@@ -1,4 +1,4 @@
package de.fete.application.service;
package de.fete.application.service.exception;
import java.time.LocalDate;

View File

@@ -0,0 +1,10 @@
package de.fete.application.service.exception;
/** Thrown when an invalid organizer token is provided. */
public class InvalidOrganizerTokenException extends RuntimeException {
/** Creates a new exception for an invalid organizer token. */
public InvalidOrganizerTokenException() {
super("Invalid organizer token.");
}
}

View File

@@ -0,0 +1,10 @@
package de.fete.application.service.exception;
/** Thrown when an invalid IANA timezone ID is provided. */
public class InvalidTimezoneException extends RuntimeException {
/** Creates a new exception for the given invalid timezone. */
public InvalidTimezoneException(String timezone) {
super("Invalid IANA timezone: " + timezone);
}
}

View File

@@ -0,0 +1,4 @@
/**
* Application-layer exceptions thrown by service use case implementations.
*/
package de.fete.application.service.exception;

View File

@@ -1,21 +1,17 @@
package de.fete.config;
import java.io.IOException;
import java.time.Clock;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.resource.PathResourceResolver;
/** Configures API path prefix and SPA static resource serving. */
/** Configures API path prefix. Static resources served by default Spring Boot handler. */
@Configuration
public class WebConfig implements WebMvcConfigurer {
/** Provides a system clock bean for time-dependent services. */
@Bean
Clock clock() {
return Clock.systemDefaultZone();
@@ -25,23 +21,4 @@ public class WebConfig implements WebMvcConfigurer {
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.addPathPrefix("/api", c -> c.isAnnotationPresent(RestController.class));
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/")
.resourceChain(true)
.addResolver(new PathResourceResolver() {
@Override
protected Resource getResource(String resourcePath,
Resource location) throws IOException {
Resource requested = location.createRelative(resourcePath);
if (requested.exists() && requested.isReadable()) {
return requested;
}
Resource index = new ClassPathResource("/static/index.html");
return (index.exists() && index.isReadable()) ? index : null;
}
});
}
}

View File

@@ -2,12 +2,13 @@ package de.fete.domain.model;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
/** Command carrying the data needed to create an event. */
public record CreateEventCommand(
String title,
String description,
OffsetDateTime dateTime,
String location,
LocalDate expiryDate
ZoneId timezone,
String location
) {}

View File

@@ -2,108 +2,29 @@ package de.fete.domain.model;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.UUID;
import java.time.ZoneId;
/** Domain entity representing an event. */
public class Event {
public record Event(
Long id,
EventToken eventToken,
OrganizerToken organizerToken,
String title,
String description,
OffsetDateTime dateTime,
ZoneId timezone,
String location,
LocalDate expiryDate,
OffsetDateTime createdAt,
boolean cancelled,
String cancellationReason
) {
private Long id;
private UUID eventToken;
private UUID organizerToken;
private String title;
private String description;
private OffsetDateTime dateTime;
private String location;
private LocalDate expiryDate;
private OffsetDateTime createdAt;
/** Returns the internal database ID. */
public Long getId() {
return id;
}
/** Sets the internal database ID. */
public void setId(Long id) {
this.id = id;
}
/** Returns the public event token (UUID). */
public UUID getEventToken() {
return eventToken;
}
/** Sets the public event token. */
public void setEventToken(UUID eventToken) {
this.eventToken = eventToken;
}
/** Returns the secret organizer token (UUID). */
public UUID getOrganizerToken() {
return organizerToken;
}
/** Sets the secret organizer token. */
public void setOrganizerToken(UUID organizerToken) {
this.organizerToken = organizerToken;
}
/** Returns the event title. */
public String getTitle() {
return title;
}
/** Sets the event title. */
public void setTitle(String title) {
this.title = title;
}
/** Returns the event description. */
public String getDescription() {
return description;
}
/** Sets the event description. */
public void setDescription(String description) {
this.description = description;
}
/** Returns the event date and time with UTC offset. */
public OffsetDateTime getDateTime() {
return dateTime;
}
/** Sets the event date and time. */
public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
}
/** Returns the event location. */
public String getLocation() {
return location;
}
/** Sets the event location. */
public void setLocation(String location) {
this.location = location;
}
/** Returns the expiry date after which event data is deleted. */
public LocalDate getExpiryDate() {
return expiryDate;
}
/** Sets the expiry date. */
public void setExpiryDate(LocalDate expiryDate) {
this.expiryDate = expiryDate;
}
/** Returns the creation timestamp. */
public OffsetDateTime getCreatedAt() {
return createdAt;
}
/** Sets the creation timestamp. */
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
/** Returns a copy of this event with cancellation applied. */
public Event withCancellation(boolean cancelled, String cancellationReason) {
return new Event(
id, eventToken, organizerToken, title, description,
dateTime, timezone, location, expiryDate, createdAt,
cancelled, cancellationReason);
}
}

View File

@@ -0,0 +1,18 @@
package de.fete.domain.model;
import java.util.Objects;
import java.util.UUID;
/** Type-safe wrapper for the public event token. */
public record EventToken(UUID value) {
/** Validates that the token value is not null. */
public EventToken {
Objects.requireNonNull(value, "eventToken must not be null");
}
/** Generates a new random event token. */
public static EventToken generate() {
return new EventToken(UUID.randomUUID());
}
}

View File

@@ -0,0 +1,18 @@
package de.fete.domain.model;
import java.util.Objects;
import java.util.UUID;
/** Type-safe wrapper for the secret organizer token. */
public record OrganizerToken(UUID value) {
/** Validates that the token value is not null. */
public OrganizerToken {
Objects.requireNonNull(value, "organizerToken must not be null");
}
/** Generates a new random organizer token. */
public static OrganizerToken generate() {
return new OrganizerToken(UUID.randomUUID());
}
}

View File

@@ -0,0 +1,9 @@
package de.fete.domain.model;
/** Domain entity representing an RSVP. */
public record Rsvp(
Long id,
RsvpToken rsvpToken,
Long eventId,
String name
) {}

View File

@@ -0,0 +1,18 @@
package de.fete.domain.model;
import java.util.Objects;
import java.util.UUID;
/** Type-safe wrapper for the RSVP token. */
public record RsvpToken(UUID value) {
/** Validates that the token value is not null. */
public RsvpToken {
Objects.requireNonNull(value, "rsvpToken must not be null");
}
/** Generates a new random RSVP token. */
public static RsvpToken generate() {
return new RsvpToken(UUID.randomUUID());
}
}

View File

@@ -0,0 +1,11 @@
package de.fete.domain.port.in;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.RsvpToken;
/** Inbound port for cancelling an RSVP. */
public interface CancelRsvpUseCase {
/** Cancels the RSVP identified by the given tokens. Idempotent — no error if not found. */
void cancelRsvp(EventToken eventToken, RsvpToken rsvpToken);
}

View File

@@ -0,0 +1,10 @@
package de.fete.domain.port.in;
import de.fete.domain.model.EventToken;
/** Inbound port for counting attendees of an event. */
public interface CountAttendeesByEventUseCase {
/** Counts the number of confirmed attendees for the given event. */
long countByEvent(EventToken eventToken);
}

View File

@@ -0,0 +1,11 @@
package de.fete.domain.port.in;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.Rsvp;
/** Inbound port for creating a new RSVP. */
public interface CreateRsvpUseCase {
/** Creates an RSVP for the given event and guest name. */
Rsvp createRsvp(EventToken eventToken, String name);
}

View File

@@ -0,0 +1,12 @@
package de.fete.domain.port.in;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import java.util.List;
/** Inbound port for retrieving attendee names of an event. */
public interface GetAttendeesUseCase {
/** Returns attendee names ordered by RSVP submission time. */
List<String> getAttendeeNames(EventToken eventToken, OrganizerToken organizerToken);
}

View File

@@ -0,0 +1,12 @@
package de.fete.domain.port.in;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import java.util.Optional;
/** Inbound port for retrieving a public event by its token. */
public interface GetEventUseCase {
/** Finds an event by its public event token. */
Optional<Event> getByEventToken(EventToken eventToken);
}

View File

@@ -0,0 +1,13 @@
package de.fete.domain.port.in;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
/** Inbound port for updating an event. */
public interface UpdateEventUseCase {
/** Cancels the event identified by the given token. */
void cancelEvent(
EventToken eventToken, OrganizerToken organizerToken,
Boolean cancelled, String reason);
}

View File

@@ -1,8 +1,8 @@
package de.fete.domain.port.out;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import java.util.Optional;
import java.util.UUID;
/** Outbound port for persisting and retrieving events. */
public interface EventRepository {
@@ -11,5 +11,8 @@ public interface EventRepository {
Event save(Event event);
/** Finds an event by its public event token. */
Optional<Event> findByEventToken(UUID eventToken);
Optional<Event> findByEventToken(EventToken eventToken);
/** Deletes all events whose expiry date is in the past. Returns the number of deleted events. */
int deleteExpired();
}

View File

@@ -0,0 +1,21 @@
package de.fete.domain.port.out;
import de.fete.domain.model.Rsvp;
import de.fete.domain.model.RsvpToken;
import java.util.List;
/** Outbound port for persisting and querying RSVPs. */
public interface RsvpRepository {
/** Persists the given RSVP and returns it with generated fields populated. */
Rsvp save(Rsvp rsvp);
/** Counts the number of RSVPs for the given event. */
long countByEventId(Long eventId);
/** Finds all RSVPs for the given event, ordered by ID ascending. */
List<Rsvp> findByEventId(Long eventId);
/** Deletes an RSVP by event ID and RSVP token. Returns true if a record was deleted. */
boolean deleteByEventIdAndRsvpToken(Long eventId, RsvpToken rsvpToken);
}

View File

@@ -7,6 +7,9 @@ spring.jpa.open-in-view=false
# Liquibase
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml
# Proxy headers
server.forward-headers-strategy=framework
# Actuator
management.endpoints.web.exposure.include=health
management.endpoint.health.show-details=never

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

@@ -0,0 +1,36 @@
<?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="003-create-rsvps-table" author="fete">
<createTable tableName="rsvps">
<column name="id" type="bigserial" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="rsvp_token" type="uuid">
<constraints nullable="false" unique="true"/>
</column>
<column name="event_id" type="bigint">
<constraints nullable="false"
foreignKeyName="fk_rsvps_event_id"
references="events(id)"
deleteCascade="true"/>
</column>
<column name="name" type="varchar(100)">
<constraints nullable="false"/>
</column>
</createTable>
<createIndex tableName="rsvps" indexName="idx_rsvps_event_id">
<column name="event_id"/>
</createIndex>
<createIndex tableName="rsvps" indexName="idx_rsvps_rsvp_token">
<column name="rsvp_token"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,17 @@
<?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="004-add-cancellation-columns" author="fete">
<addColumn tableName="events">
<column name="cancelled" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
<column name="cancellation_reason" type="VARCHAR(2000)"/>
</addColumn>
</changeSet>
</databaseChangeLog>

View File

@@ -7,5 +7,8 @@
<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"/>
<include file="db/changelog/003-create-rsvps-table.xml"/>
<include file="db/changelog/004-add-cancellation-columns.xml"/>
</databaseChangeLog>

View File

@@ -37,6 +37,205 @@ paths:
schema:
$ref: "#/components/schemas/ValidationProblemDetail"
/events/{eventToken}/rsvps/{rsvpToken}:
delete:
operationId: cancelRsvp
summary: Cancel RSVP
description: |
Permanently deletes an RSVP identified by the RSVP token.
Idempotent: returns 204 whether the RSVP existed or not.
tags:
- events
parameters:
- name: eventToken
in: path
required: true
schema:
type: string
format: uuid
description: Event token (UUID)
- name: rsvpToken
in: path
required: true
schema:
type: string
format: uuid
description: RSVP token (UUID) identifying the attendance to cancel
responses:
"204":
description: >
RSVP successfully cancelled (or was already cancelled).
No response body.
"500":
description: Internal server error
/events/{eventToken}/rsvps:
post:
operationId: createRsvp
summary: Submit an RSVP for an event
tags:
- events
parameters:
- name: eventToken
in: path
required: true
schema:
type: string
format: uuid
description: Public event token
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateRsvpRequest"
responses:
"201":
description: RSVP created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/CreateRsvpResponse"
"400":
description: Validation failed (e.g. blank name)
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ValidationProblemDetail"
"404":
description: Event not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
"409":
description: Event has expired — RSVPs no longer accepted
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
/events/{eventToken}/attendees:
get:
operationId: getAttendees
summary: Get attendee list for an event (organizer only)
tags:
- events
parameters:
- name: eventToken
in: path
required: true
schema:
type: string
format: uuid
description: Public event token
- name: organizerToken
in: query
required: true
schema:
type: string
format: uuid
description: Organizer token for authorization
responses:
"200":
description: Attendee list
content:
application/json:
schema:
$ref: "#/components/schemas/GetAttendeesResponse"
"403":
description: Invalid organizer token
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
"404":
description: Event not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
/events/{eventToken}:
get:
operationId: getEvent
summary: Get public event details by token
tags:
- events
parameters:
- name: eventToken
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"
patch:
operationId: patchEvent
summary: Update an event (currently cancel)
description: |
Partial update of an event resource. Currently the only supported operation
is cancellation (setting cancelled to true). Requires the organizer token.
Cancellation is irreversible.
tags:
- events
parameters:
- name: eventToken
in: path
required: true
schema:
type: string
format: uuid
description: Public event token
- name: organizerToken
in: query
required: true
schema:
type: string
format: uuid
description: Organizer token for authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PatchEventRequest"
responses:
"204":
description: Event updated successfully
"403":
description: Invalid organizer token
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
"404":
description: Event not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
"409":
description: Event is already cancelled
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ProblemDetail"
components:
schemas:
CreateEventRequest:
@@ -44,7 +243,7 @@ components:
required:
- title
- dateTime
- expiryDate
- timezone
properties:
title:
type: string
@@ -58,14 +257,13 @@ 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
expiryDate:
type: string
format: date
description: Date after which event data is deleted. Must be in the future.
example: "2026-06-15"
CreateEventResponse:
type: object
@@ -74,7 +272,7 @@ components:
- organizerToken
- title
- dateTime
- expiryDate
- timezone
properties:
eventToken:
type: string
@@ -93,10 +291,129 @@ components:
type: string
format: date-time
example: "2026-03-15T20:00:00+01:00"
expiryDate:
timezone:
type: string
format: date
example: "2026-06-15"
description: IANA timezone of the organizer
example: "Europe/Berlin"
GetEventResponse:
type: object
required:
- eventToken
- title
- dateTime
- timezone
- attendeeCount
- cancelled
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
cancelled:
type: boolean
description: Whether the event has been cancelled
example: false
cancellationReason:
type:
- string
- "null"
description: Reason for cancellation, if provided
example: null
PatchEventRequest:
type: object
required:
- cancelled
properties:
cancelled:
type: boolean
description: Set to true to cancel the event (irreversible)
example: true
cancellationReason:
type: string
maxLength: 2000
description: Optional cancellation reason
example: "Unfortunately the venue is no longer available."
CreateRsvpRequest:
type: object
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 100
description: Guest's display name
example: "Max Mustermann"
CreateRsvpResponse:
type: object
required:
- rsvpToken
- name
properties:
rsvpToken:
type: string
format: uuid
description: Token identifying this RSVP (store client-side for future updates)
example: "d4e5f6a7-b8c9-0123-4567-890abcdef012"
name:
type: string
description: Guest's display name as stored
example: "Max Mustermann"
GetAttendeesResponse:
type: object
required:
- attendees
properties:
attendees:
type: array
items:
$ref: "#/components/schemas/Attendee"
example:
- name: "Alice"
- name: "Bob"
Attendee:
type: object
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 100
example: "Alice"
ProblemDetail:
type: object

View File

@@ -4,10 +4,14 @@ import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
import static com.tngtech.archunit.library.Architectures.onionArchitecture;
import com.tngtech.archunit.core.domain.JavaClass;
import com.tngtech.archunit.core.importer.ImportOption;
import com.tngtech.archunit.junit.AnalyzeClasses;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.lang.ArchCondition;
import com.tngtech.archunit.lang.ArchRule;
import com.tngtech.archunit.lang.ConditionEvents;
import com.tngtech.archunit.lang.SimpleConditionEvent;
@AnalyzeClasses(packages = "de.fete", importOptions = ImportOption.DoNotIncludeTests.class)
class HexagonalArchitectureTest {
@@ -60,4 +64,29 @@ class HexagonalArchitectureTest {
static final ArchRule persistenceMustNotDependOnWeb = noClasses()
.that().resideInAPackage("de.fete.adapter.out.persistence..")
.should().dependOnClassesThat().resideInAPackage("de.fete.adapter.in.web..");
@ArchTest
static final ArchRule webAdapterMustNotDependOnOutboundPorts = noClasses()
.that().resideInAPackage("de.fete.adapter.in.web..")
.should().dependOnClassesThat().resideInAPackage("de.fete.domain.port.out..");
@ArchTest
static final ArchRule domainModelsMustBeRecords = classes()
.that().resideInAPackage("de.fete.domain.model..")
.and().doNotHaveSimpleName("package-info")
.should(beRecords());
private static ArchCondition<JavaClass> beRecords() {
return new ArchCondition<>("be records") {
@Override
public void check(JavaClass javaClass,
ConditionEvents events) {
boolean isRecord = javaClass.reflect().isRecord();
if (!isRecord) {
events.add(SimpleConditionEvent.violated(javaClass,
javaClass.getFullName() + " is not a record"));
}
}
};
}
}

View File

@@ -1,12 +1,29 @@
package de.fete.adapter.in.web;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.fete.TestcontainersConfig;
import de.fete.adapter.in.web.model.CreateEventRequest;
import de.fete.adapter.in.web.model.CreateEventResponse;
import de.fete.adapter.in.web.model.CreateRsvpRequest;
import de.fete.adapter.in.web.model.CreateRsvpResponse;
import de.fete.adapter.out.persistence.EventJpaEntity;
import de.fete.adapter.out.persistence.EventJpaRepository;
import de.fete.adapter.out.persistence.RsvpJpaEntity;
import de.fete.adapter.out.persistence.RsvpJpaRepository;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.Map;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@@ -23,158 +40,571 @@ class EventControllerIntegrationTest {
@Autowired
private MockMvc mockMvc;
@Autowired
private ObjectMapper objectMapper;
@Autowired
private EventJpaRepository jpaRepository;
@Autowired
private RsvpJpaRepository rsvpJpaRepository;
// --- Create Event tests ---
@Test
void createEventWithValidBody() throws Exception {
String body =
"""
{
"title": "Birthday Party",
"description": "Come celebrate!",
"dateTime": "2026-06-15T20:00:00+02:00",
"location": "Berlin",
"expiryDate": "%s"
}
""".formatted(LocalDate.now().plusDays(30));
var request = new CreateEventRequest()
.title("Birthday Party")
.description("Come celebrate!")
.dateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)))
.timezone("Europe/Berlin")
.location("Berlin");
mockMvc.perform(post("/api/events")
var result = mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isCreated())
.andExpect(jsonPath("$.eventToken").isNotEmpty())
.andExpect(jsonPath("$.organizerToken").isNotEmpty())
.andExpect(jsonPath("$.title").value("Birthday Party"))
.andExpect(jsonPath("$.timezone").value("Europe/Berlin"))
.andExpect(jsonPath("$.dateTime").isNotEmpty())
.andExpect(jsonPath("$.expiryDate").isNotEmpty());
.andReturn();
var response = objectMapper.readValue(
result.getResponse().getContentAsString(), CreateEventResponse.class);
EventJpaEntity persisted = jpaRepository
.findByEventToken(response.getEventToken()).orElseThrow();
assertThat(persisted.getTitle()).isEqualTo("Birthday Party");
assertThat(persisted.getDescription()).isEqualTo("Come celebrate!");
assertThat(persisted.getTimezone()).isEqualTo("Europe/Berlin");
assertThat(persisted.getLocation()).isEqualTo("Berlin");
assertThat(persisted.getExpiryDate()).isEqualTo(LocalDate.of(2026, 6, 22));
assertThat(persisted.getDateTime().toInstant())
.isEqualTo(request.getDateTime().toInstant());
assertThat(persisted.getOrganizerToken()).isNotNull();
assertThat(persisted.getCreatedAt()).isNotNull();
}
@Test
void createEventWithOptionalFieldsNull() throws Exception {
String body =
"""
{
"title": "Minimal Event",
"dateTime": "2026-06-15T20:00:00+02:00",
"expiryDate": "%s"
}
""".formatted(LocalDate.now().plusDays(30));
var request = new CreateEventRequest()
.title("Minimal Event")
.dateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)))
.timezone("UTC");
mockMvc.perform(post("/api/events")
var result = mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isCreated())
.andExpect(jsonPath("$.eventToken").isNotEmpty())
.andExpect(jsonPath("$.organizerToken").isNotEmpty())
.andExpect(jsonPath("$.title").value("Minimal Event"));
.andExpect(jsonPath("$.title").value("Minimal Event"))
.andReturn();
var response = objectMapper.readValue(
result.getResponse().getContentAsString(), CreateEventResponse.class);
EventJpaEntity persisted = jpaRepository
.findByEventToken(response.getEventToken()).orElseThrow();
assertThat(persisted.getTitle()).isEqualTo("Minimal Event");
assertThat(persisted.getDescription()).isNull();
assertThat(persisted.getLocation()).isNull();
}
@Test
void createEventMissingTitleReturns400() throws Exception {
String body =
"""
{
"dateTime": "2026-06-15T20:00:00+02:00",
"expiryDate": "%s"
}
""".formatted(LocalDate.now().plusDays(30));
long countBefore = jpaRepository.count();
var request = new CreateEventRequest()
.dateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)))
.timezone("Europe/Berlin");
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.title").value("Validation Failed"))
.andExpect(jsonPath("$.fieldErrors").isArray());
assertThat(jpaRepository.count()).isEqualTo(countBefore);
}
@Test
void createEventMissingDateTimeReturns400() throws Exception {
String body =
"""
{
"title": "No Date",
"expiryDate": "%s"
}
""".formatted(LocalDate.now().plusDays(30));
long countBefore = jpaRepository.count();
var request = new CreateEventRequest()
.title("No Date")
.timezone("Europe/Berlin");
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.fieldErrors").isArray());
}
@Test
void createEventMissingExpiryDateReturns400() throws Exception {
String body =
"""
{
"title": "No Expiry",
"dateTime": "2026-06-15T20:00:00+02:00"
}
""";
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.fieldErrors").isArray());
}
@Test
void createEventExpiryDateInPastReturns400() throws Exception {
String body =
"""
{
"title": "Past Expiry",
"dateTime": "2026-06-15T20:00:00+02:00",
"expiryDate": "2025-01-01"
}
""";
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:expiry-date-in-past"));
}
@Test
void createEventExpiryDateTodayReturns400() throws Exception {
String body =
"""
{
"title": "Today Expiry",
"dateTime": "2026-06-15T20:00:00+02:00",
"expiryDate": "%s"
}
""".formatted(LocalDate.now());
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:expiry-date-in-past"));
assertThat(jpaRepository.count()).isEqualTo(countBefore);
}
@Test
void errorResponseContentTypeIsProblemJson() throws Exception {
String body =
"""
{
"title": "",
"dateTime": "2026-06-15T20:00:00+02:00",
"expiryDate": "%s"
}
""".formatted(LocalDate.now().plusDays(30));
var request = new CreateEventRequest()
.title("")
.dateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)))
.timezone("Europe/Berlin");
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(body))
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"));
}
@Test
void createEventWithInvalidTimezoneReturns400() throws Exception {
long countBefore = jpaRepository.count();
var request = new CreateEventRequest()
.title("Bad TZ")
.dateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)))
.timezone("Not/A/Zone");
mockMvc.perform(post("/api/events")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:invalid-timezone"));
assertThat(jpaRepository.count()).isEqualTo(countBefore);
}
// --- GET /events/{token} tests ---
@Test
void getEventReturnsFullResponse() throws Exception {
EventJpaEntity entity = seedEvent(
"Summer BBQ", "Bring drinks!", "Europe/Berlin",
"Central Park", LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + entity.getEventToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.eventToken").value(entity.getEventToken().toString()))
.andExpect(jsonPath("$.title").value("Summer BBQ"))
.andExpect(jsonPath("$.description").value("Bring drinks!"))
.andExpect(jsonPath("$.timezone").value("Europe/Berlin"))
.andExpect(jsonPath("$.location").value("Central Park"))
.andExpect(jsonPath("$.attendeeCount").value(0))
.andExpect(jsonPath("$.dateTime").isNotEmpty());
}
@Test
void getEventWithOptionalFieldsAbsent() throws Exception {
EventJpaEntity entity = seedEvent(
"Minimal", null, "UTC", null, LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + entity.getEventToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.title").value("Minimal"))
.andExpect(jsonPath("$.description").doesNotExist())
.andExpect(jsonPath("$.location").doesNotExist())
.andExpect(jsonPath("$.attendeeCount").value(0));
}
@Test
void getEventNotFoundReturns404() throws Exception {
mockMvc.perform(get("/api/events/" + UUID.randomUUID()))
.andExpect(status().isNotFound())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-not-found"));
}
// --- RSVP tests ---
@Test
void createRsvpReturns201WithToken() throws Exception {
EventJpaEntity event = seedEvent(
"RSVP Event", "Join us!", "Europe/Berlin",
"Berlin", LocalDate.now().plusDays(30));
var request = new CreateRsvpRequest().name("Max Mustermann");
var result = mockMvc.perform(post("/api/events/" + event.getEventToken() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isCreated())
.andExpect(jsonPath("$.rsvpToken").isNotEmpty())
.andExpect(jsonPath("$.name").value("Max Mustermann"))
.andReturn();
var response = objectMapper.readValue(
result.getResponse().getContentAsString(), CreateRsvpResponse.class);
RsvpJpaEntity persisted = rsvpJpaRepository
.findByRsvpToken(response.getRsvpToken()).orElseThrow();
assertThat(persisted.getName()).isEqualTo("Max Mustermann");
assertThat(persisted.getEventId()).isEqualTo(event.getId());
}
@Test
void createRsvpWithBlankNameReturns400() throws Exception {
EventJpaEntity event = seedEvent(
"RSVP Event", null, "Europe/Berlin",
null, LocalDate.now().plusDays(30));
long countBefore = rsvpJpaRepository.count();
var request = new CreateRsvpRequest().name("");
mockMvc.perform(post("/api/events/" + event.getEventToken() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isBadRequest())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"));
assertThat(rsvpJpaRepository.count()).isEqualTo(countBefore);
}
@Test
void attendeeCountIncreasesAfterRsvp() throws Exception {
EventJpaEntity event = seedEvent(
"Count Event", null, "Europe/Berlin",
null, LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(jsonPath("$.attendeeCount").value(0));
var request = new CreateRsvpRequest().name("First Guest");
mockMvc.perform(post("/api/events/" + event.getEventToken() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isCreated());
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(jsonPath("$.attendeeCount").value(1));
}
@Test
void createRsvpForUnknownEventReturns404() throws Exception {
long countBefore = rsvpJpaRepository.count();
var request = new CreateRsvpRequest().name("Ghost");
mockMvc.perform(post("/api/events/" + UUID.randomUUID() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isNotFound())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-not-found"));
assertThat(rsvpJpaRepository.count()).isEqualTo(countBefore);
}
@Test
void createRsvpForExpiredEventReturns409() throws Exception {
EventJpaEntity event = seedEvent(
"Expired Party", null, "Europe/Berlin",
null, LocalDate.now().minusDays(1));
long countBefore = rsvpJpaRepository.count();
var request = new CreateRsvpRequest().name("Late Guest");
mockMvc.perform(post("/api/events/" + event.getEventToken() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isConflict())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-expired"));
assertThat(rsvpJpaRepository.count()).isEqualTo(countBefore);
}
// --- GET /events/{token}/attendees tests ---
@Test
void getAttendeesReturnsNamesForOrganizer() throws Exception {
EventJpaEntity event = seedEvent(
"Party", null, "Europe/Berlin", null,
LocalDate.now().plusDays(30));
seedRsvp(event, "Alice");
seedRsvp(event, "Bob");
mockMvc.perform(get("/api/events/" + event.getEventToken()
+ "/attendees?organizerToken=" + event.getOrganizerToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.attendees").isArray())
.andExpect(jsonPath("$.attendees.length()").value(2))
.andExpect(jsonPath("$.attendees[0].name").value("Alice"))
.andExpect(jsonPath("$.attendees[1].name").value("Bob"));
}
@Test
void getAttendeesReturnsEmptyListWhenNoRsvps() throws Exception {
EventJpaEntity event = seedEvent(
"Empty Party", null, "Europe/Berlin", null,
LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + event.getEventToken()
+ "/attendees?organizerToken=" + event.getOrganizerToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.attendees").isArray())
.andExpect(jsonPath("$.attendees.length()").value(0));
}
@Test
void getAttendeesReturns403ForInvalidOrganizerToken() throws Exception {
EventJpaEntity event = seedEvent(
"Secret Party", null, "Europe/Berlin", null,
LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + event.getEventToken()
+ "/attendees?organizerToken=" + UUID.randomUUID()))
.andExpect(status().isForbidden())
.andExpect(content().contentTypeCompatibleWith(
"application/problem+json"));
}
@Test
void getAttendeesReturns404ForUnknownEvent() throws Exception {
mockMvc.perform(get("/api/events/" + UUID.randomUUID()
+ "/attendees?organizerToken=" + UUID.randomUUID()))
.andExpect(status().isNotFound())
.andExpect(content().contentTypeCompatibleWith(
"application/problem+json"));
}
// --- Cancel RSVP tests ---
@Test
void cancelRsvpReturns204AndDeletesRow() throws Exception {
EventJpaEntity event = seedEvent(
"Cancel Event", null, "Europe/Berlin",
null, LocalDate.now().plusDays(30));
UUID rsvpToken = seedRsvpAndGetToken(event, "Departing Guest");
long countBefore = rsvpJpaRepository.count();
mockMvc.perform(delete("/api/events/" + event.getEventToken()
+ "/rsvps/" + rsvpToken))
.andExpect(status().isNoContent());
assertThat(rsvpJpaRepository.count()).isEqualTo(countBefore - 1);
assertThat(rsvpJpaRepository.findByRsvpToken(rsvpToken)).isEmpty();
}
@Test
void cancelRsvpReturns204WhenAlreadyDeleted() throws Exception {
EventJpaEntity event = seedEvent(
"Idempotent Event", null, "Europe/Berlin",
null, LocalDate.now().plusDays(30));
mockMvc.perform(delete("/api/events/" + event.getEventToken()
+ "/rsvps/" + UUID.randomUUID()))
.andExpect(status().isNoContent());
}
@Test
void cancelRsvpReturns204WhenEventNotFound() throws Exception {
mockMvc.perform(delete("/api/events/" + UUID.randomUUID()
+ "/rsvps/" + UUID.randomUUID()))
.andExpect(status().isNoContent());
}
@Test
void attendeeCountDecreasesAfterCancelRsvp() throws Exception {
EventJpaEntity event = seedEvent(
"Count Cancel Event", null, "Europe/Berlin",
null, LocalDate.now().plusDays(30));
UUID rsvpToken = seedRsvpAndGetToken(event, "Leaving Guest");
seedRsvp(event, "Staying Guest");
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(jsonPath("$.attendeeCount").value(2));
mockMvc.perform(delete("/api/events/" + event.getEventToken()
+ "/rsvps/" + rsvpToken))
.andExpect(status().isNoContent());
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(jsonPath("$.attendeeCount").value(1));
}
// --- Cancel Event tests ---
@Test
void cancelEventReturns204AndPersists() throws Exception {
EventJpaEntity event = seedEvent(
"Cancel Me", null, "Europe/Berlin", null, LocalDate.now().plusDays(30));
var body = Map.of(
"cancelled", true,
"cancellationReason", "Venue closed");
mockMvc.perform(patch("/api/events/" + event.getEventToken()
+ "?organizerToken=" + event.getOrganizerToken())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(body)))
.andExpect(status().isNoContent());
EventJpaEntity persisted = jpaRepository
.findByEventToken(event.getEventToken()).orElseThrow();
assertThat(persisted.isCancelled()).isTrue();
assertThat(persisted.getCancellationReason()).isEqualTo("Venue closed");
}
@Test
void cancelEventWithoutReasonReturns204() throws Exception {
EventJpaEntity event = seedEvent(
"Cancel No Reason", null, "Europe/Berlin", null, LocalDate.now().plusDays(30));
var body = Map.of("cancelled", true);
mockMvc.perform(patch("/api/events/" + event.getEventToken()
+ "?organizerToken=" + event.getOrganizerToken())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(body)))
.andExpect(status().isNoContent());
EventJpaEntity persisted = jpaRepository
.findByEventToken(event.getEventToken()).orElseThrow();
assertThat(persisted.isCancelled()).isTrue();
assertThat(persisted.getCancellationReason()).isNull();
}
@Test
void cancelEventWithWrongOrganizerTokenReturns403() throws Exception {
EventJpaEntity event = seedEvent(
"Wrong Token", null, "Europe/Berlin", null, LocalDate.now().plusDays(30));
var body = Map.of("cancelled", true);
mockMvc.perform(patch("/api/events/" + event.getEventToken()
+ "?organizerToken=" + UUID.randomUUID())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(body)))
.andExpect(status().isForbidden())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:invalid-organizer-token"));
assertThat(jpaRepository.findByEventToken(event.getEventToken())
.orElseThrow().isCancelled()).isFalse();
}
@Test
void cancelEventNotFoundReturns404() throws Exception {
var body = Map.of("cancelled", true);
mockMvc.perform(patch("/api/events/" + UUID.randomUUID()
+ "?organizerToken=" + UUID.randomUUID())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(body)))
.andExpect(status().isNotFound())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-not-found"));
}
@Test
void cancelAlreadyCancelledEventReturns409() throws Exception {
EventJpaEntity event = seedCancelledEvent("Already Cancelled");
var body = Map.of("cancelled", true);
mockMvc.perform(patch("/api/events/" + event.getEventToken()
+ "?organizerToken=" + event.getOrganizerToken())
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(body)))
.andExpect(status().isConflict())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-already-cancelled"));
}
@Test
void getEventReturnsCancelledFields() throws Exception {
EventJpaEntity event = seedCancelledEvent("Weather Event");
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.cancelled").value(true))
.andExpect(jsonPath("$.cancellationReason").value("Cancelled"));
}
@Test
void getEventReturnsNotCancelledByDefault() throws Exception {
EventJpaEntity event = seedEvent(
"Active Event", null, "Europe/Berlin", null, LocalDate.now().plusDays(30));
mockMvc.perform(get("/api/events/" + event.getEventToken()))
.andExpect(status().isOk())
.andExpect(jsonPath("$.cancelled").value(false))
.andExpect(jsonPath("$.cancellationReason").doesNotExist());
}
@Test
void createRsvpOnCancelledEventReturns409() throws Exception {
EventJpaEntity event = seedCancelledEvent("Cancelled RSVP");
long countBefore = rsvpJpaRepository.count();
var request = new CreateRsvpRequest().name("Late Guest");
mockMvc.perform(post("/api/events/" + event.getEventToken() + "/rsvps")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isConflict())
.andExpect(content().contentTypeCompatibleWith("application/problem+json"))
.andExpect(jsonPath("$.type").value("urn:problem-type:event-cancelled"));
assertThat(rsvpJpaRepository.count()).isEqualTo(countBefore);
}
private EventJpaEntity seedCancelledEvent(String title) {
var entity = new EventJpaEntity();
entity.setEventToken(UUID.randomUUID());
entity.setOrganizerToken(UUID.randomUUID());
entity.setTitle(title);
entity.setDateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)));
entity.setTimezone("Europe/Berlin");
entity.setExpiryDate(LocalDate.now().plusDays(30));
entity.setCreatedAt(OffsetDateTime.now());
entity.setCancelled(true);
entity.setCancellationReason("Cancelled");
return jpaRepository.save(entity);
}
private UUID seedRsvpAndGetToken(EventJpaEntity event, String name) {
var rsvp = new RsvpJpaEntity();
UUID token = UUID.randomUUID();
rsvp.setRsvpToken(token);
rsvp.setEventId(event.getId());
rsvp.setName(name);
rsvpJpaRepository.save(rsvp);
return token;
}
private void seedRsvp(EventJpaEntity event, String name) {
var rsvp = new RsvpJpaEntity();
rsvp.setRsvpToken(UUID.randomUUID());
rsvp.setEventId(event.getId());
rsvp.setName(name);
rsvpJpaRepository.save(rsvp);
}
private EventJpaEntity seedEvent(
String title, String description, String timezone,
String location, LocalDate expiryDate) {
var entity = new EventJpaEntity();
entity.setEventToken(UUID.randomUUID());
entity.setOrganizerToken(UUID.randomUUID());
entity.setTitle(title);
entity.setDescription(description);
entity.setDateTime(OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)));
entity.setTimezone(timezone);
entity.setLocation(location);
entity.setExpiryDate(expiryDate);
entity.setCreatedAt(OffsetDateTime.now());
return jpaRepository.save(entity);
}
}

View File

@@ -0,0 +1,281 @@
package de.fete.adapter.in.web;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import de.fete.TestcontainersConfig;
import de.fete.adapter.out.persistence.EventJpaEntity;
import de.fete.adapter.out.persistence.EventJpaRepository;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
@SpringBootTest
@AutoConfigureMockMvc
@Import(TestcontainersConfig.class)
class SpaControllerTest {
@Autowired
private MockMvc mockMvc;
@Autowired
private EventJpaRepository eventJpaRepository;
// --- Phase 2: Base functionality ---
@Test
void rootServesHtml() throws Exception {
mockMvc.perform(get("/").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML));
}
@Test
void rootHtmlDoesNotContainPlaceholder() throws Exception {
String html = mockMvc.perform(get("/").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).doesNotContain("<!-- OG_META_TAGS -->");
}
@Test
void createRouteServesHtml() throws Exception {
mockMvc.perform(get("/create").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML));
}
@Test
void eventsRouteServesHtml() throws Exception {
mockMvc.perform(get("/events").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML));
}
// --- Phase 4 (US2): Generic OG meta-tags ---
@Test
void rootContainsGenericOgTitle() throws Exception {
String html = mockMvc.perform(get("/").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:title");
assertThat(html).contains("content=\"fete\"");
}
@Test
void createRouteContainsGenericOgDescription() throws Exception {
String html = mockMvc.perform(get("/create").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:description");
assertThat(html).contains("Privacy-focused event planning");
}
@Test
void unknownRouteReturns404() throws Exception {
mockMvc.perform(get("/unknown/path").accept(MediaType.TEXT_HTML))
.andExpect(status().isNotFound());
}
// --- Phase 5 (US3): Twitter Card meta-tags ---
@Test
void eventRouteContainsTwitterCardTags() throws Exception {
EventJpaEntity event = seedEvent(
"Twitter Test", "Testing cards",
"Europe/Berlin", "Berlin", LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("twitter:card");
assertThat(html).contains("twitter:title");
assertThat(html).contains("twitter:description");
}
@Test
void genericRouteContainsTwitterCardTags() throws Exception {
String html = mockMvc.perform(get("/").accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("twitter:card");
assertThat(html).contains("content=\"summary\"");
}
// --- Phase 3 (US1): Event-specific OG meta-tags ---
@Test
void eventRouteContainsEventSpecificOgTitle() throws Exception {
EventJpaEntity event = seedEvent(
"Birthday Party", "Come celebrate!",
"Europe/Berlin", "Berlin", LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:title");
assertThat(html).contains("Birthday Party");
}
@Test
void eventRouteContainsOgDescription() throws Exception {
EventJpaEntity event = seedEvent(
"BBQ", "Bring drinks!",
"Europe/Berlin", "Central Park", LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:description");
assertThat(html).contains("Central Park");
assertThat(html).contains("Bring drinks!");
}
@Test
void eventRouteContainsOgUrl() throws Exception {
EventJpaEntity event = seedEvent(
"Party", null,
"Europe/Berlin", null, LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:url");
assertThat(html).contains("/events/" + event.getEventToken());
}
@Test
void eventRouteContainsOgImage() throws Exception {
EventJpaEntity event = seedEvent(
"Party", null,
"Europe/Berlin", null, LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:image");
assertThat(html).contains("/og-image.png");
}
@Test
void unknownEventTokenFallsBackToGenericMeta() throws Exception {
String html = mockMvc.perform(
get("/events/" + UUID.randomUUID()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("og:title");
assertThat(html).contains("content=\"fete\"");
}
// --- HTML escaping ---
@Test
void specialCharactersAreHtmlEscaped() throws Exception {
EventJpaEntity event = seedEvent(
"Tom & Jerry's \"Party\"", "Fun <times> & more",
"Europe/Berlin", "O'Brien's Pub", LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("Tom &amp; Jerry");
assertThat(html).contains("&amp; more");
assertThat(html).contains("&lt;times&gt;");
assertThat(html).doesNotContain("content=\"Tom & Jerry");
}
// --- Title truncation ---
@Test
void longTitleIsTruncatedTo70Chars() throws Exception {
String longTitle = "A".repeat(80);
EventJpaEntity event = seedEvent(
longTitle, "Desc",
"Europe/Berlin", null, LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("A".repeat(67) + "...");
assertThat(html).doesNotContain("A".repeat(68));
}
// --- Description formatting ---
@Test
void eventWithoutLocationOmitsPinEmoji() throws Exception {
EventJpaEntity event = seedEvent(
"Online Meetup", "Virtual gathering",
"Europe/Berlin", null, LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).doesNotContain("📍");
}
@Test
void eventWithoutDescriptionOmitsDash() throws Exception {
EventJpaEntity event = seedEvent(
"Silent Event", null,
"Europe/Berlin", "Berlin", LocalDate.now().plusDays(30));
String html = mockMvc.perform(
get("/events/" + event.getEventToken()).accept(MediaType.TEXT_HTML))
.andExpect(status().isOk())
.andReturn().getResponse().getContentAsString();
assertThat(html).contains("📅");
assertThat(html).contains("Berlin");
assertThat(html).doesNotContain("");
}
private EventJpaEntity seedEvent(
String title, String description, String timezone,
String location, LocalDate expiryDate) {
var entity = new EventJpaEntity();
entity.setEventToken(UUID.randomUUID());
entity.setOrganizerToken(UUID.randomUUID());
entity.setTitle(title);
entity.setDescription(description);
entity.setDateTime(
OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)));
entity.setTimezone(timezone);
entity.setLocation(location);
entity.setExpiryDate(expiryDate);
entity.setCreatedAt(OffsetDateTime.now());
return eventJpaRepository.save(entity);
}
}

View File

@@ -0,0 +1,83 @@
package de.fete.adapter.out.persistence;
import static org.assertj.core.api.Assertions.assertThat;
import de.fete.TestcontainersConfig;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.port.out.EventRepository;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.Transactional;
@SpringBootTest
@Import(TestcontainersConfig.class)
@Transactional
class EventPersistenceAdapterIntegrationTest {
@Autowired
private EventRepository eventRepository;
@Test
void deleteExpiredRemovesExpiredEvents() {
Event expired = buildEvent("Expired Party", LocalDate.now().minusDays(1));
eventRepository.save(expired);
int deleted = eventRepository.deleteExpired();
assertThat(deleted).isGreaterThanOrEqualTo(1);
}
@Test
void deleteExpiredKeepsNonExpiredEvents() {
Event future = buildEvent("Future Party", LocalDate.now().plusDays(30));
Event saved = eventRepository.save(future);
eventRepository.deleteExpired();
assertThat(eventRepository.findByEventToken(saved.eventToken())).isPresent();
}
@Test
void deleteExpiredKeepsEventsExpiringToday() {
Event today = buildEvent("Today Party", LocalDate.now());
Event saved = eventRepository.save(today);
eventRepository.deleteExpired();
assertThat(eventRepository.findByEventToken(saved.eventToken())).isPresent();
}
@Test
void deleteExpiredReturnsZeroWhenNoneExpired() {
// Only save a future event
buildEvent("Future Only", LocalDate.now().plusDays(60));
int deleted = eventRepository.deleteExpired();
assertThat(deleted).isGreaterThanOrEqualTo(0);
}
private Event buildEvent(String title, LocalDate expiryDate) {
return new Event(
null,
EventToken.generate(),
OrganizerToken.generate(),
title,
"Test description",
OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)),
ZoneId.of("Europe/Berlin"),
"Test Location",
expiryDate,
OffsetDateTime.now(),
false,
null);
}
}

View File

@@ -4,12 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat;
import de.fete.TestcontainersConfig;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.port.out.EventRepository;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Optional;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -28,8 +30,8 @@ class EventPersistenceAdapterTest {
Event saved = eventRepository.save(event);
assertThat(saved.getId()).isNotNull();
assertThat(saved.getTitle()).isEqualTo("Test Event");
assertThat(saved.id()).isNotNull();
assertThat(saved.title()).isEqualTo("Test Event");
}
@Test
@@ -37,16 +39,16 @@ class EventPersistenceAdapterTest {
Event event = buildEvent();
Event saved = eventRepository.save(event);
Optional<Event> found = eventRepository.findByEventToken(saved.getEventToken());
Optional<Event> found = eventRepository.findByEventToken(saved.eventToken());
assertThat(found).isPresent();
assertThat(found.get().getTitle()).isEqualTo("Test Event");
assertThat(found.get().getId()).isEqualTo(saved.getId());
assertThat(found.get().title()).isEqualTo("Test Event");
assertThat(found.get().id()).isEqualTo(saved.id());
}
@Test
void findByUnknownEventTokenReturnsEmpty() {
Optional<Event> found = eventRepository.findByEventToken(UUID.randomUUID());
Optional<Event> found = eventRepository.findByEventToken(EventToken.generate());
assertThat(found).isEmpty();
}
@@ -59,39 +61,47 @@ class EventPersistenceAdapterTest {
OffsetDateTime createdAt =
OffsetDateTime.of(2026, 3, 4, 12, 0, 0, 0, ZoneOffset.UTC);
var event = new Event();
event.setEventToken(UUID.randomUUID());
event.setOrganizerToken(UUID.randomUUID());
event.setTitle("Full Event");
event.setDescription("A detailed description");
event.setDateTime(dateTime);
event.setLocation("Berlin, Germany");
event.setExpiryDate(expiryDate);
event.setCreatedAt(createdAt);
var event = new Event(
null,
EventToken.generate(),
OrganizerToken.generate(),
"Full Event",
"A detailed description",
dateTime,
ZoneId.of("Europe/Berlin"),
"Berlin, Germany",
expiryDate,
createdAt,
false,
null);
Event saved = eventRepository.save(event);
Event found = eventRepository.findByEventToken(saved.getEventToken()).orElseThrow();
Event found = eventRepository.findByEventToken(saved.eventToken()).orElseThrow();
assertThat(found.getEventToken()).isEqualTo(event.getEventToken());
assertThat(found.getOrganizerToken()).isEqualTo(event.getOrganizerToken());
assertThat(found.getTitle()).isEqualTo("Full Event");
assertThat(found.getDescription()).isEqualTo("A detailed description");
assertThat(found.getDateTime().toInstant()).isEqualTo(dateTime.toInstant());
assertThat(found.getLocation()).isEqualTo("Berlin, Germany");
assertThat(found.getExpiryDate()).isEqualTo(expiryDate);
assertThat(found.getCreatedAt().toInstant()).isEqualTo(createdAt.toInstant());
assertThat(found.eventToken()).isEqualTo(event.eventToken());
assertThat(found.organizerToken()).isEqualTo(event.organizerToken());
assertThat(found.title()).isEqualTo("Full Event");
assertThat(found.description()).isEqualTo("A detailed description");
assertThat(found.dateTime().toInstant()).isEqualTo(dateTime.toInstant());
assertThat(found.timezone()).isEqualTo(ZoneId.of("Europe/Berlin"));
assertThat(found.location()).isEqualTo("Berlin, Germany");
assertThat(found.expiryDate()).isEqualTo(expiryDate);
assertThat(found.createdAt().toInstant()).isEqualTo(createdAt.toInstant());
}
private Event buildEvent() {
var event = new Event();
event.setEventToken(UUID.randomUUID());
event.setOrganizerToken(UUID.randomUUID());
event.setTitle("Test Event");
event.setDescription("Test description");
event.setDateTime(OffsetDateTime.now().plusDays(7));
event.setLocation("Somewhere");
event.setExpiryDate(LocalDate.now().plusDays(30));
event.setCreatedAt(OffsetDateTime.now());
return event;
return new Event(
null,
EventToken.generate(),
OrganizerToken.generate(),
"Test Event",
"Test description",
OffsetDateTime.now().plusDays(7),
ZoneId.of("Europe/Berlin"),
"Somewhere",
LocalDate.now().plusDays(30),
OffsetDateTime.now(),
false,
null);
}
}

View File

@@ -0,0 +1,133 @@
package de.fete.application.service;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import de.fete.application.service.exception.EventAlreadyCancelledException;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.InvalidOrganizerTokenException;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.port.out.EventRepository;
import java.time.Clock;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
class EventServiceCancelTest {
private static final ZoneId ZONE = ZoneId.of("Europe/Berlin");
private static final Instant FIXED_INSTANT =
LocalDate.of(2026, 3, 5).atStartOfDay(ZONE).toInstant();
private static final Clock FIXED_CLOCK = Clock.fixed(FIXED_INSTANT, ZONE);
@Mock
private EventRepository eventRepository;
private EventService eventService;
@BeforeEach
void setUp() {
eventService = new EventService(eventRepository, FIXED_CLOCK);
}
@Test
void cancelEventDelegatesToDomainAndSaves() {
EventToken eventToken = EventToken.generate();
OrganizerToken organizerToken = OrganizerToken.generate();
var event = new Event(null, eventToken, organizerToken, null, null, null, null, null, null,
null, false, null);
when(eventRepository.findByEventToken(eventToken))
.thenReturn(Optional.of(event));
when(eventRepository.save(any(Event.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
eventService.cancelEvent(eventToken, organizerToken, true, "Venue unavailable");
ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
verify(eventRepository).save(captor.capture());
assertThat(captor.getValue().cancelled()).isTrue();
assertThat(captor.getValue().cancellationReason()).isEqualTo("Venue unavailable");
}
@Test
void cancelEventWithNullReason() {
EventToken eventToken = EventToken.generate();
OrganizerToken organizerToken = OrganizerToken.generate();
var event = new Event(null, eventToken, organizerToken, null, null, null, null, null, null,
null, false, null);
when(eventRepository.findByEventToken(eventToken))
.thenReturn(Optional.of(event));
when(eventRepository.save(any(Event.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
eventService.cancelEvent(eventToken, organizerToken, true, null);
ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
verify(eventRepository).save(captor.capture());
assertThat(captor.getValue().cancelled()).isTrue();
assertThat(captor.getValue().cancellationReason()).isNull();
}
@Test
void cancelEventThrows404WhenNotFound() {
EventToken eventToken = EventToken.generate();
OrganizerToken organizerToken = OrganizerToken.generate();
when(eventRepository.findByEventToken(eventToken))
.thenReturn(Optional.empty());
assertThatThrownBy(() -> eventService.cancelEvent(eventToken, organizerToken, true, null))
.isInstanceOf(EventNotFoundException.class);
verify(eventRepository, never()).save(any());
}
@Test
void cancelEventThrows403WhenWrongOrganizerToken() {
EventToken eventToken = EventToken.generate();
OrganizerToken correctToken = OrganizerToken.generate();
var event = new Event(null, eventToken, correctToken, null, null, null, null, null, null,
null, false, null);
when(eventRepository.findByEventToken(eventToken))
.thenReturn(Optional.of(event));
final OrganizerToken wrongToken = OrganizerToken.generate();
assertThatThrownBy(() -> eventService.cancelEvent(eventToken, wrongToken, true, null))
.isInstanceOf(InvalidOrganizerTokenException.class);
verify(eventRepository, never()).save(any());
}
@Test
void cancelEventThrows409WhenAlreadyCancelled() {
EventToken eventToken = EventToken.generate();
OrganizerToken organizerToken = OrganizerToken.generate();
var event = new Event(null, eventToken, organizerToken, null, null, null, null, null, null,
null, true, null);
when(eventRepository.findByEventToken(eventToken))
.thenReturn(Optional.of(event));
assertThatThrownBy(() -> eventService.cancelEvent(eventToken, organizerToken, true, null))
.isInstanceOf(EventAlreadyCancelledException.class);
verify(eventRepository, never()).save(any());
}
}

View File

@@ -1,7 +1,6 @@
package de.fete.application.service;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -9,13 +8,14 @@ import static org.mockito.Mockito.when;
import de.fete.domain.model.CreateEventCommand;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.port.out.EventRepository;
import java.time.Clock;
import java.time.Instant;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -30,6 +30,7 @@ class EventServiceTest {
private static final Instant FIXED_INSTANT =
LocalDate.of(2026, 3, 5).atStartOfDay(ZONE).toInstant();
private static final Clock FIXED_CLOCK = Clock.fixed(FIXED_INSTANT, ZONE);
private static final LocalDate TODAY = LocalDate.ofInstant(FIXED_INSTANT, ZONE);
@Mock
private EventRepository eventRepository;
@@ -49,35 +50,20 @@ class EventServiceTest {
var command = new CreateEventCommand(
"Birthday Party",
"Come celebrate!",
OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)),
"Berlin",
LocalDate.of(2026, 7, 15)
TODAY.plusDays(90).atStartOfDay(ZONE).toOffsetDateTime(),
ZONE,
"Berlin"
);
Event result = eventService.createEvent(command);
assertThat(result.getTitle()).isEqualTo("Birthday Party");
assertThat(result.getDescription()).isEqualTo("Come celebrate!");
assertThat(result.getLocation()).isEqualTo("Berlin");
assertThat(result.getEventToken()).isNotNull();
assertThat(result.getOrganizerToken()).isNotNull();
assertThat(result.getCreatedAt()).isEqualTo(OffsetDateTime.now(FIXED_CLOCK));
}
@Test
void eventTokenAndOrganizerTokenAreDifferent() {
when(eventRepository.save(any(Event.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
var command = new CreateEventCommand(
"Test", null,
OffsetDateTime.now(FIXED_CLOCK).plusDays(1), null,
LocalDate.now(FIXED_CLOCK).plusDays(30)
);
Event result = eventService.createEvent(command);
assertThat(result.getEventToken()).isNotEqualTo(result.getOrganizerToken());
assertThat(result.title()).isEqualTo("Birthday Party");
assertThat(result.description()).isEqualTo("Come celebrate!");
assertThat(result.timezone()).isEqualTo(ZONE);
assertThat(result.location()).isEqualTo("Berlin");
assertThat(result.eventToken()).isNotNull();
assertThat(result.organizerToken()).isNotNull();
assertThat(result.createdAt()).isEqualTo(OffsetDateTime.ofInstant(FIXED_INSTANT, ZONE));
}
@Test
@@ -87,54 +73,74 @@ class EventServiceTest {
var command = new CreateEventCommand(
"Test", null,
OffsetDateTime.now(FIXED_CLOCK).plusDays(1), null,
LocalDate.now(FIXED_CLOCK).plusDays(30)
TODAY.plusDays(10).atStartOfDay(ZONE).toOffsetDateTime(), ZONE, null
);
eventService.createEvent(command);
ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
verify(eventRepository, times(1)).save(captor.capture());
assertThat(captor.getValue().getTitle()).isEqualTo("Test");
assertThat(captor.getValue().title()).isEqualTo("Test");
}
@Test
void expiryDateTodayThrowsException() {
void expiryDateIsEventDatePlusSevenDays() {
when(eventRepository.save(any(Event.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
var eventDate = TODAY.plusDays(10);
var command = new CreateEventCommand(
"Test", null,
OffsetDateTime.now(FIXED_CLOCK).plusDays(1), null,
LocalDate.now(FIXED_CLOCK)
eventDate.atStartOfDay(ZONE).toOffsetDateTime(), ZONE, null
);
assertThatThrownBy(() -> eventService.createEvent(command))
.isInstanceOf(ExpiryDateInPastException.class);
Event result = eventService.createEvent(command);
assertThat(result.expiryDate()).isEqualTo(eventDate.plusDays(7));
}
// --- GetEventUseCase tests (T004) ---
@Test
void getByEventTokenReturnsEvent() {
EventToken token = EventToken.generate();
var event = new Event(null, token, null, "Found Event", null, null, null, null, null, null,
false, null);
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.of(event));
Optional<Event> result = eventService.getByEventToken(token);
assertThat(result).isPresent();
assertThat(result.get().title()).isEqualTo("Found Event");
}
@Test
void expiryDateInPastThrowsException() {
var command = new CreateEventCommand(
"Test", null,
OffsetDateTime.now(FIXED_CLOCK).plusDays(1), null,
LocalDate.now(FIXED_CLOCK).minusDays(5)
);
void getByEventTokenReturnsEmptyForUnknownToken() {
EventToken token = EventToken.generate();
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.empty());
assertThatThrownBy(() -> eventService.createEvent(command))
.isInstanceOf(ExpiryDateInPastException.class);
Optional<Event> result = eventService.getByEventToken(token);
assertThat(result).isEmpty();
}
// --- Timezone validation tests (T006) ---
@Test
void expiryDateTomorrowSucceeds() {
void createEventWithValidTimezoneSucceeds() {
when(eventRepository.save(any(Event.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
var command = new CreateEventCommand(
"Test", null,
OffsetDateTime.now(FIXED_CLOCK).plusDays(1), null,
LocalDate.now(FIXED_CLOCK).plusDays(1)
TODAY.plusDays(10).atStartOfDay(ZONE).toOffsetDateTime(),
ZoneId.of("America/New_York"), null
);
Event result = eventService.createEvent(command);
assertThat(result.getExpiryDate()).isEqualTo(LocalDate.of(2026, 3, 6));
assertThat(result.timezone()).isEqualTo(ZoneId.of("America/New_York"));
}
}

View File

@@ -0,0 +1,241 @@
package de.fete.application.service;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import de.fete.application.service.exception.EventCancelledException;
import de.fete.application.service.exception.EventExpiredException;
import de.fete.application.service.exception.EventNotFoundException;
import de.fete.application.service.exception.InvalidOrganizerTokenException;
import de.fete.domain.model.Event;
import de.fete.domain.model.EventToken;
import de.fete.domain.model.OrganizerToken;
import de.fete.domain.model.Rsvp;
import de.fete.domain.model.RsvpToken;
import de.fete.domain.port.out.EventRepository;
import de.fete.domain.port.out.RsvpRepository;
import java.time.Clock;
import java.time.Instant;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
class RsvpServiceTest {
private static final ZoneId ZONE = ZoneId.of("Europe/Berlin");
private static final Instant NOW = Instant.parse("2026-03-08T12:00:00Z");
private static final Clock FIXED_CLOCK = Clock.fixed(NOW, ZONE);
private static final LocalDate TODAY = LocalDate.ofInstant(NOW, ZONE);
@Mock
private EventRepository eventRepository;
@Mock
private RsvpRepository rsvpRepository;
private RsvpService rsvpService;
@BeforeEach
void setUp() {
rsvpService = new RsvpService(eventRepository, rsvpRepository, FIXED_CLOCK);
}
@Test
void createRsvpSucceedsForActiveEvent() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
when(rsvpRepository.save(any(Rsvp.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
Rsvp result = rsvpService.createRsvp(token, "Max Mustermann");
assertThat(result.name()).isEqualTo("Max Mustermann");
assertThat(result.rsvpToken()).isNotNull();
assertThat(result.eventId()).isEqualTo(event.id());
}
@Test
void createRsvpPersistsViaRepository() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
when(rsvpRepository.save(any(Rsvp.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
rsvpService.createRsvp(token, "Test Guest");
ArgumentCaptor<Rsvp> captor = ArgumentCaptor.forClass(Rsvp.class);
verify(rsvpRepository).save(captor.capture());
assertThat(captor.getValue().name()).isEqualTo("Test Guest");
assertThat(captor.getValue().eventId()).isEqualTo(event.id());
}
@Test
void createRsvpThrowsWhenEventNotFound() {
EventToken token = EventToken.generate();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.empty());
assertThatThrownBy(() -> rsvpService.createRsvp(token, "Guest"))
.isInstanceOf(EventNotFoundException.class);
}
@Test
void createRsvpTrimsName() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
when(rsvpRepository.save(any(Rsvp.class)))
.thenAnswer(invocation -> invocation.getArgument(0));
Rsvp result = rsvpService.createRsvp(token, " Max ");
assertThat(result.name()).isEqualTo("Max");
}
@Test
void createRsvpThrowsWhenEventExpired() {
Event event = buildActiveEvent(TODAY.minusDays(1));
EventToken token = event.eventToken();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
assertThatThrownBy(() -> rsvpService.createRsvp(token, "Late Guest"))
.isInstanceOf(EventExpiredException.class);
}
@Test
void createRsvpThrowsWhenEventExpiresToday() {
Event event = buildActiveEvent(TODAY);
EventToken token = event.eventToken();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
assertThatThrownBy(() -> rsvpService.createRsvp(token, "Late Guest"))
.isInstanceOf(EventExpiredException.class);
}
@Test
void getAttendeeNamesReturnsNamesInOrder() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
OrganizerToken orgToken = event.organizerToken();
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.of(event));
when(rsvpRepository.findByEventId(event.id()))
.thenReturn(List.of(
buildRsvp(1L, "Alice"),
buildRsvp(2L, "Bob"),
buildRsvp(3L, "Charlie")));
List<String> names = rsvpService.getAttendeeNames(token, orgToken);
assertThat(names).containsExactly("Alice", "Bob", "Charlie");
}
@Test
void getAttendeeNamesReturnsEmptyListWhenNoRsvps() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
OrganizerToken orgToken = event.organizerToken();
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.of(event));
when(rsvpRepository.findByEventId(event.id()))
.thenReturn(List.of());
List<String> names = rsvpService.getAttendeeNames(token, orgToken);
assertThat(names).isEmpty();
}
@Test
void getAttendeeNamesThrowsWhenEventNotFound() {
EventToken token = EventToken.generate();
OrganizerToken orgToken = OrganizerToken.generate();
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.empty());
assertThatThrownBy(
() -> rsvpService.getAttendeeNames(token, orgToken))
.isInstanceOf(EventNotFoundException.class);
}
@Test
void getAttendeeNamesThrowsWhenOrganizerTokenInvalid() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
OrganizerToken wrongToken = OrganizerToken.generate();
when(eventRepository.findByEventToken(token))
.thenReturn(Optional.of(event));
assertThatThrownBy(
() -> rsvpService.getAttendeeNames(token, wrongToken))
.isInstanceOf(InvalidOrganizerTokenException.class);
}
private Rsvp buildRsvp(Long id, String name) {
return new Rsvp(id, RsvpToken.generate(), 1L, name);
}
@Test
void cancelRsvpDeletesWhenEventAndRsvpExist() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
RsvpToken rsvpToken = RsvpToken.generate();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
when(rsvpRepository.deleteByEventIdAndRsvpToken(event.id(), rsvpToken)).thenReturn(true);
rsvpService.cancelRsvp(token, rsvpToken);
verify(rsvpRepository).deleteByEventIdAndRsvpToken(event.id(), rsvpToken);
}
@Test
void cancelRsvpSucceedsWhenRsvpNotFound() {
Event event = buildActiveEvent(TODAY.plusDays(30));
EventToken token = event.eventToken();
RsvpToken rsvpToken = RsvpToken.generate();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.of(event));
when(rsvpRepository.deleteByEventIdAndRsvpToken(event.id(), rsvpToken)).thenReturn(false);
rsvpService.cancelRsvp(token, rsvpToken);
verify(rsvpRepository).deleteByEventIdAndRsvpToken(event.id(), rsvpToken);
}
@Test
void cancelRsvpSucceedsWhenEventNotFound() {
EventToken token = EventToken.generate();
RsvpToken rsvpToken = RsvpToken.generate();
when(eventRepository.findByEventToken(token)).thenReturn(Optional.empty());
rsvpService.cancelRsvp(token, rsvpToken);
}
private Event buildActiveEvent(LocalDate expiryDate) {
return new Event(
1L,
EventToken.generate(),
OrganizerToken.generate(),
"Test Event",
null,
OffsetDateTime.of(2026, 6, 15, 20, 0, 0, 0, ZoneOffset.ofHours(2)),
ZONE,
null,
expiryDate,
OffsetDateTime.now(),
false,
null);
}
}

View File

@@ -29,8 +29,10 @@ class WebConfigTest {
@Test
void apiPrefixNotAccessibleWithoutIt() throws Exception {
// /events without /api prefix should not resolve to the API endpoint
mockMvc.perform(get("/events"))
.andExpect(status().isNotFound());
// /events without /api prefix should not resolve to the REST API endpoint;
// it is served by SpaController as HTML instead
mockMvc.perform(get("/events")
.accept("text/html"))
.andExpect(status().isOk());
}
}

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<!-- OG_META_TAGS -->
<title>fete</title>
</head>
<body>
<div id="app"></div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

View File

@@ -0,0 +1,210 @@
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const organizerEvent: StoredEvent = {
eventToken: 'org-event-aaa',
title: 'Summer BBQ',
dateTime: '2027-06-15T18:00:00Z',
organizerToken: 'org-secret-token',
}
const attendeeEvent: StoredEvent = {
eventToken: 'att-event-bbb',
title: 'Team Meeting',
dateTime: '2027-01-10T09:00:00Z',
rsvpToken: 'rsvp-token-1',
rsvpName: 'Alice',
}
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
test.describe('US1: Organizer Cancels Event from List', () => {
test('T001: organizer taps delete, confirms, event is removed after successful API call', async ({
page,
network,
}) => {
await page.addInitScript(seedEvents([organizerEvent, attendeeEvent]))
const { http, HttpResponse } = await import('msw')
let patchCalled = false
network.use(
http.patch('*/api/events/:token', ({ request, params }) => {
const url = new URL(request.url)
if (
params['token'] === organizerEvent.eventToken &&
url.searchParams.get('organizerToken') === organizerEvent.organizerToken
) {
patchCalled = true
return new HttpResponse(null, { status: 204 })
}
return HttpResponse.json(
{ type: 'about:blank', title: 'Forbidden', status: 403 },
{ status: 403, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto('/')
await expect(page.getByText('Summer BBQ')).toBeVisible()
// Click delete on organizer event
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
// Confirmation dialog appears with organizer-specific text
await expect(page.getByRole('alertdialog')).toBeVisible()
// Confirm cancellation
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event is removed from list
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
// Other event remains
await expect(page.getByText('Team Meeting')).toBeVisible()
expect(patchCalled).toBe(true)
})
test('T002: organizer confirms cancellation, API fails, event stays in list and error shown', async ({
page,
network,
}) => {
await page.addInitScript(seedEvents([organizerEvent]))
const { http, HttpResponse } = await import('msw')
network.use(
http.patch('*/api/events/:token', () => {
return HttpResponse.json(
{
type: 'about:blank',
title: 'Internal Server Error',
status: 500,
},
{ status: 500, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByRole('alertdialog')).toBeVisible()
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event stays in list
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
test('T003: organizer confirms cancellation, API returns 409 Conflict, event is silently removed', async ({
page,
network,
}) => {
await page.addInitScript(seedEvents([organizerEvent]))
const { http, HttpResponse } = await import('msw')
network.use(
http.patch('*/api/events/:token', () => {
return HttpResponse.json(
{
type: 'about:blank',
title: 'Conflict',
status: 409,
detail: 'Event is already cancelled.',
},
{ status: 409, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByRole('alertdialog')).toBeVisible()
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// 409 treated as success — event removed
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
})
test('T004: organizer opens cancel dialog then dismisses (cancel button), event remains', async ({
page,
}) => {
await page.addInitScript(seedEvents([organizerEvent]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByRole('alertdialog')).toBeVisible()
// Dismiss via Cancel button
await page.getByRole('button', { name: 'Cancel' }).click()
await expect(page.getByRole('alertdialog')).not.toBeVisible()
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
test('T004b: organizer opens cancel dialog then dismisses via Escape', async ({ page }) => {
await page.addInitScript(seedEvents([organizerEvent]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByRole('alertdialog')).toBeVisible()
await page.keyboard.press('Escape')
await expect(page.getByRole('alertdialog')).not.toBeVisible()
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
test('T004c: organizer opens cancel dialog then dismisses via overlay click', async ({
page,
}) => {
await page.addInitScript(seedEvents([organizerEvent]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByRole('alertdialog')).toBeVisible()
// Click on overlay (outside dialog)
await page.locator('.confirm-dialog__overlay').click({ position: { x: 10, y: 10 } })
await expect(page.getByRole('alertdialog')).not.toBeVisible()
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
})
test.describe('US2: Distinct Dialog for Organizer vs. Attendee', () => {
test('T011: organizer dialog shows event-cancellation warning', async ({ page }) => {
await page.addInitScript(seedEvents([organizerEvent]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
const dialog = page.getByRole('alertdialog')
await expect(dialog).toBeVisible()
// Organizer-specific title and message
await expect(dialog.locator('.confirm-dialog__title')).toHaveText('Cancel event?')
await expect(dialog.locator('.confirm-dialog__message')).toContainText(
'all attendees',
)
})
test('T012: attendee dialog preserves existing RSVP-cancellation message', async ({
page,
}) => {
await page.addInitScript(seedEvents([attendeeEvent]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Team Meeting/ }).click()
const dialog = page.getByRole('alertdialog')
await expect(dialog).toBeVisible()
// Attendee-specific title and message
await expect(dialog.locator('.confirm-dialog__title')).toHaveText('Remove event?')
await expect(dialog.locator('.confirm-dialog__message')).toContainText(
'attendance will be cancelled',
)
})
})

View File

@@ -0,0 +1,166 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
cancelled: false,
cancellationReason: null,
}
const organizerToken = '550e8400-e29b-41d4-a716-446655440001'
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
function organizerSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
organizerToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
}
}
test.describe('US1: Organizer cancels event with reason', () => {
test('organizer opens cancel bottom sheet, enters reason, confirms — event shows as cancelled on reload', async ({
page,
network,
}) => {
let cancelled = false
network.use(
http.get('*/api/events/:token', () => {
if (cancelled) {
return HttpResponse.json({
...fullEvent,
cancelled: true,
cancellationReason: 'Venue closed',
})
}
return HttpResponse.json(fullEvent)
}),
http.patch('*/api/events/:token', ({ request }) => {
const url = new URL(request.url)
const token = url.searchParams.get('organizerToken')
if (token === organizerToken) {
cancelled = true
return new HttpResponse(null, { status: 204 })
}
return HttpResponse.json(
{ type: 'urn:problem-type:invalid-organizer-token', title: 'Forbidden', status: 403 },
{ status: 403 },
)
}),
)
await page.addInitScript(seedEvents([organizerSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Open kebab menu, then cancel event
const kebabBtn = page.getByRole('button', { name: /Event actions/i })
await expect(kebabBtn).toBeVisible()
await kebabBtn.click()
const cancelItem = page.getByRole('menuitem', { name: /Cancel event/i })
await expect(cancelItem).toBeVisible()
await cancelItem.click()
// Fill in reason
const reasonField = page.getByLabel(/reason/i)
await expect(reasonField).toBeVisible()
await reasonField.fill('Venue closed')
// Confirm cancellation
await page.getByRole('button', { name: /Confirm cancellation/i }).click()
// Event should show as cancelled
await expect(page.getByText(/This event has been cancelled/i)).toBeVisible()
await expect(page.getByText('Venue closed')).toBeVisible()
// Kebab menu should be gone (event is cancelled)
await expect(kebabBtn).not.toBeVisible()
})
})
test.describe('US1: Organizer cancels event without reason', () => {
test('organizer cancels without reason — event shows as cancelled', async ({
page,
network,
}) => {
let cancelled = false
network.use(
http.get('*/api/events/:token', () => {
if (cancelled) {
return HttpResponse.json({
...fullEvent,
cancelled: true,
cancellationReason: null,
})
}
return HttpResponse.json(fullEvent)
}),
http.patch('*/api/events/:token', ({ request }) => {
const url = new URL(request.url)
const token = url.searchParams.get('organizerToken')
if (token === organizerToken) {
cancelled = true
return new HttpResponse(null, { status: 204 })
}
return HttpResponse.json({}, { status: 403 })
}),
)
await page.addInitScript(seedEvents([organizerSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
await page.getByRole('button', { name: /Event actions/i }).click()
await page.getByRole('menuitem', { name: /Cancel event/i }).click()
// Don't fill in reason, just confirm
await page.getByRole('button', { name: /Confirm cancellation/i }).click()
// Event should show as cancelled without reason text
await expect(page.getByText(/This event has been cancelled/i)).toBeVisible()
})
})
test.describe('US1: Cancel API failure', () => {
test('cancel API fails — error displayed in bottom sheet, button re-enabled for retry', async ({
page,
network,
}) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.patch('*/api/events/:token', () => {
return HttpResponse.json(
{
type: 'about:blank',
title: 'Internal Server Error',
status: 500,
detail: 'Something went wrong',
},
{ status: 500, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.addInitScript(seedEvents([organizerSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
await page.getByRole('button', { name: /Event actions/i }).click()
await page.getByRole('menuitem', { name: /Cancel event/i }).click()
await page.getByRole('button', { name: /Confirm cancellation/i }).click()
// Error message in bottom sheet
await expect(page.getByText(/Could not cancel event/i)).toBeVisible()
// Confirm button should be re-enabled
await expect(page.getByRole('button', { name: /Confirm cancellation/i })).toBeEnabled()
})
})

View File

@@ -0,0 +1,276 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
}
const rsvpToken = 'd4e5f6a7-b8c9-0123-4567-890abcdef012'
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
function rsvpSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
rsvpToken,
rsvpName: 'Anna',
}
}
test.describe('US1: Cancel RSVP from Event Detail View', () => {
test('status bar shows cancel affordance when RSVP\'d', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Status bar visible
const statusBar = page.getByRole('button', { name: /You're attending/ })
await expect(statusBar).toBeVisible()
// Cancel button hidden initially
await expect(page.getByRole('button', { name: 'Cancel RSVP' })).not.toBeVisible()
})
test('tapping status bar reveals cancel button', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Tap status bar
await page.getByRole('button', { name: /You're attending/ }).click()
// Cancel button appears
await expect(page.getByRole('button', { name: 'Cancel RSVP' })).toBeVisible()
})
test('confirm cancellation → localStorage cleared, count decremented, bar reset', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return new HttpResponse(null, { status: 204 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Expand → Cancel RSVP → Confirm in dialog
await page.getByRole('button', { name: /You're attending/ }).click()
await page.locator('.rsvp-bar__cancel').click()
// Confirm dialog
await expect(page.getByText('The organizer will no longer see you as attending.')).toBeVisible()
await page.getByRole('alertdialog').getByRole('button', { name: 'Cancel RSVP' }).click()
// Bar resets to CTA state
await expect(page.getByRole('button', { name: "I'm attending" })).toBeVisible()
await expect(page.getByText("You're attending!")).not.toBeVisible()
// Attendee count decremented
await expect(page.getByText('11 going')).toBeVisible()
// localStorage cleared
const stored = await page.evaluate(() => {
const raw = localStorage.getItem('fete:events')
return raw ? JSON.parse(raw) : null
})
const event = stored?.find((e: StoredEvent) => e.eventToken === fullEvent.eventToken)
expect(event?.rsvpToken).toBeUndefined()
expect(event?.rsvpName).toBeUndefined()
})
test('server error → error message, state unchanged', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return HttpResponse.json({ error: 'fail' }, { status: 500 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Expand → Cancel → Confirm in dialog
await page.getByRole('button', { name: /You're attending/ }).click()
await page.locator('.rsvp-bar__cancel').click()
await page.getByRole('alertdialog').getByRole('button', { name: 'Cancel RSVP' }).click()
// Error message
await expect(page.getByText('Could not cancel RSVP. Please try again.')).toBeVisible()
// Attendee count unchanged
await expect(page.getByText('12 going')).toBeVisible()
})
test('re-RSVP after cancel works', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return new HttpResponse(null, { status: 204 })
}),
http.post('*/api/events/:token/rsvps', () => {
return HttpResponse.json(
{ rsvpToken: 'new-rsvp-token', name: 'Max' },
{ status: 201 },
)
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Cancel first
await page.getByRole('button', { name: /You're attending/ }).click()
await page.locator('.rsvp-bar__cancel').click()
await page.getByRole('alertdialog').getByRole('button', { name: 'Cancel RSVP' }).click()
// CTA should be back
await expect(page.getByRole('button', { name: "I'm attending" })).toBeVisible()
// Re-RSVP
await page.getByRole('button', { name: "I'm attending" }).click()
const dialog = page.getByRole('dialog', { name: 'RSVP' })
await dialog.getByLabel('Your name').fill('Max')
await dialog.getByRole('button', { name: 'Count me in' }).click()
// Status bar returns
await expect(page.getByText("You're attending!")).toBeVisible()
})
})
test.describe('US2: Auto-Cancel on Event List Removal', () => {
test('removal of RSVP\'d event shows attendance warning in dialog', async ({ page }) => {
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByText('your attendance will be cancelled')).toBeVisible()
})
test('removal of non-RSVP\'d watcher event shows standard dialog', async ({ page }) => {
const watcherEvent: StoredEvent = {
eventToken: 'watcher-token',
title: 'Watcher Event',
dateTime: '2027-06-15T18:00:00Z',
}
await page.addInitScript(seedEvents([watcherEvent]))
await page.goto('/')
// Watcher events are removed directly without dialog
await page.getByRole('button', { name: /Remove Watcher Event/ }).click()
// Watcher removal is immediate — event disappears
await expect(page.getByText('Watcher Event')).not.toBeVisible()
})
test('confirm removal → DELETE called → event removed from list', async ({ page, network }) => {
network.use(
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return new HttpResponse(null, { status: 204 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event gone
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
// localStorage updated
const stored = await page.evaluate(() => {
const raw = localStorage.getItem('fete:events')
return raw ? JSON.parse(raw) : null
})
const found = stored?.find((e: StoredEvent) => e.eventToken === fullEvent.eventToken)
expect(found).toBeUndefined()
})
test('server error on DELETE → error message, event stays in list', async ({ page, network }) => {
network.use(
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return HttpResponse.json({ error: 'fail' }, { status: 500 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event still in list
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
test('dismiss dialog → no changes', async ({ page }) => {
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await page.getByRole('button', { name: 'Cancel' }).click()
// Event still there
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
})
test.describe('US3: Cancel RSVP with Stale/Invalid Token', () => {
test('cancel from detail view with stale token (404) → treated as success', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return HttpResponse.json({ error: 'not found' }, { status: 404 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Cancel flow
await page.getByRole('button', { name: /You're attending/ }).click()
await page.locator('.rsvp-bar__cancel').click()
await page.getByRole('alertdialog').getByRole('button', { name: 'Cancel RSVP' }).click()
// Treated as success — CTA returns
await expect(page.getByRole('button', { name: "I'm attending" })).toBeVisible()
// localStorage cleaned
const stored = await page.evaluate(() => {
const raw = localStorage.getItem('fete:events')
return raw ? JSON.parse(raw) : null
})
const event = stored?.find((e: StoredEvent) => e.eventToken === fullEvent.eventToken)
expect(event?.rsvpToken).toBeUndefined()
})
test('event list removal with stale token (404) → treated as success', async ({ page, network }) => {
network.use(
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return HttpResponse.json({ error: 'not found' }, { status: 404 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event removed from list
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
})
})

View File

@@ -0,0 +1,74 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
const cancelledEventWithReason = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
cancelled: true,
cancellationReason: 'Venue no longer available',
}
const cancelledEventWithoutReason = {
...cancelledEventWithReason,
cancellationReason: null,
}
test.describe('US2: Visitor sees cancelled event with reason', () => {
test('visitor sees red banner with cancellation reason on cancelled event', async ({
page,
network,
}) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(cancelledEventWithReason)),
)
await page.goto(`/events/${cancelledEventWithReason.eventToken}`)
await expect(page.getByText(/This event has been cancelled/i)).toBeVisible()
await expect(page.getByText('Venue no longer available')).toBeVisible()
})
})
test.describe('US2: Visitor sees cancelled event without reason', () => {
test('visitor sees red banner without reason when no reason was provided', async ({
page,
network,
}) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(cancelledEventWithoutReason)),
)
await page.goto(`/events/${cancelledEventWithoutReason.eventToken}`)
await expect(page.getByText(/This event has been cancelled/i)).toBeVisible()
// No reason text shown
await expect(page.getByText('Venue no longer available')).not.toBeVisible()
})
})
test.describe('US2: RSVP buttons hidden on cancelled event', () => {
test('RSVP buttons hidden on cancelled event, other details remain visible', async ({
page,
network,
}) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(cancelledEventWithReason)),
)
await page.goto(`/events/${cancelledEventWithReason.eventToken}`)
// Event details are still visible
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
await expect(page.getByText('Bring your own drinks!')).toBeVisible()
await expect(page.getByText('Central Park, NYC')).toBeVisible()
await expect(page.getByText('12 going')).toBeVisible()
// RSVP bar is NOT visible
await expect(page.getByRole('button', { name: "I'm attending" })).not.toBeVisible()
})
})

View File

@@ -9,22 +9,19 @@ test.describe('US-1: Create an event', () => {
await expect(page.getByText('Title is required.')).toBeVisible()
await expect(page.getByText('Date and time are required.')).toBeVisible()
await expect(page.getByText('Expiry date is required.')).toBeVisible()
})
test('creates an event and redirects to stub page', async ({ page }) => {
test('creates an event and redirects to event detail page', async ({ page }) => {
await page.goto('/create')
await page.getByLabel(/title/i).fill('Summer BBQ')
await page.getByLabel(/description/i).fill('Bring your own drinks')
await page.getByLabel(/date/i).first().fill('2026-04-15T18:00')
await page.getByLabel(/location/i).fill('Central Park')
await page.getByLabel(/expiry/i).fill('2026-06-15')
await page.getByRole('button', { name: /create event/i }).click()
await expect(page).toHaveURL(/\/events\/.+/)
await expect(page.getByText('Event created!')).toBeVisible()
})
test('stores event data in localStorage after creation', async ({ page }) => {
@@ -32,7 +29,6 @@ test.describe('US-1: Create an event', () => {
await page.getByLabel(/title/i).fill('Summer BBQ')
await page.getByLabel(/date/i).first().fill('2026-04-15T18:00')
await page.getByLabel(/expiry/i).fill('2026-06-15')
await page.getByRole('button', { name: /create event/i }).click()
await expect(page).toHaveURL(/\/events\/.+/)
@@ -60,7 +56,6 @@ test.describe('US-1: Create an event', () => {
await page.goto('/create')
await page.getByLabel(/title/i).fill('Test')
await page.getByLabel(/date/i).first().fill('2026-04-15T18:00')
await page.getByLabel(/expiry/i).fill('2026-06-15')
await page.getByRole('button', { name: /create event/i }).click()

View File

@@ -0,0 +1,172 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
}
test.describe('US1: RSVP submission flow', () => {
test('submits RSVP, updates attendee count, and persists in localStorage', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
http.post('*/api/events/:token/rsvps', () => {
return HttpResponse.json(
{ rsvpToken: 'd4e5f6a7-b8c9-0123-4567-890abcdef012', name: 'Max Mustermann' },
{ status: 201 },
)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
// CTA is visible
const cta = page.getByRole('button', { name: "I'm attending" })
await expect(cta).toBeVisible()
// Open bottom sheet
await cta.click()
const dialog = page.getByRole('dialog', { name: 'RSVP' })
await expect(dialog).toBeVisible()
// Fill name and submit
await dialog.getByLabel('Your name').fill('Max Mustermann')
await dialog.getByRole('button', { name: 'Count me in' }).click()
// Bottom sheet closes, status bar appears
await expect(dialog).not.toBeVisible()
await expect(page.getByText("You're attending!")).toBeVisible()
await expect(cta).not.toBeVisible()
// Attendee count incremented
await expect(page.getByText('13')).toBeVisible()
// Verify localStorage
const stored = await page.evaluate(() => {
const raw = localStorage.getItem('fete:events')
return raw ? JSON.parse(raw) : null
})
expect(stored).toEqual(
expect.arrayContaining([
expect.objectContaining({
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
rsvpToken: 'd4e5f6a7-b8c9-0123-4567-890abcdef012',
rsvpName: 'Max Mustermann',
}),
]),
)
})
test('shows validation error when name is empty', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await page.getByRole('button', { name: "I'm attending" }).click()
const dialog = page.getByRole('dialog', { name: 'RSVP' })
await dialog.getByRole('button', { name: 'Count me in' }).click()
await expect(page.getByText('Please enter your name.')).toBeVisible()
})
test('restores RSVP status from localStorage on page load', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
// Pre-seed localStorage
await page.goto('/')
await page.evaluate(() => {
localStorage.setItem(
'fete:events',
JSON.stringify([
{
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
dateTime: '2026-03-15T20:00:00+01:00',
expiryDate: '',
rsvpToken: 'existing-rsvp-token',
rsvpName: 'Anna',
},
]),
)
})
await page.goto(`/events/${fullEvent.eventToken}`)
// Status bar should show, not CTA
await expect(page.getByText("You're attending!")).toBeVisible()
await expect(page.getByRole('button', { name: "I'm attending" })).not.toBeVisible()
})
test('shows error when server is unreachable during RSVP', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
http.post('*/api/events/:token/rsvps', () => {
return HttpResponse.json(
{ type: 'about:blank', title: 'Bad Request', status: 400 },
{ status: 400, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await page.getByRole('button', { name: "I'm attending" }).click()
const dialog = page.getByRole('dialog', { name: 'RSVP' })
await dialog.getByLabel('Your name').fill('Max')
await dialog.getByRole('button', { name: 'Count me in' }).click()
await expect(page.getByText('Could not submit RSVP. Please try again.')).toBeVisible()
})
test('does not show RSVP bar for organizer', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
// Pre-seed localStorage with organizer token
await page.goto('/')
await page.evaluate(() => {
localStorage.setItem(
'fete:events',
JSON.stringify([
{
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
organizerToken: 'org-token-123',
title: 'Summer BBQ',
dateTime: '2026-03-15T20:00:00+01:00',
expiryDate: '',
},
]),
)
})
await page.goto(`/events/${fullEvent.eventToken}`)
// Event content should load
await expect(page.getByText('Summer BBQ')).toBeVisible()
// But no RSVP bar
await expect(page.getByRole('button', { name: "I'm attending" })).not.toBeVisible()
await expect(page.getByText("You're attending!")).not.toBeVisible()
})
})

View File

@@ -0,0 +1,112 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
}
test.describe('US-1: View event details', () => {
test('displays all event fields for a valid event', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
await expect(page.getByText('Bring your own drinks!')).toBeVisible()
await expect(page.getByText('Central Park, NYC')).toBeVisible()
await expect(page.getByText('12')).toBeVisible()
await expect(page.getByText('Europe/Berlin')).toBeVisible()
await expect(page.getByText('2026')).toBeVisible()
})
test('does not load external resources', async ({ page, network }) => {
const externalRequests: string[] = []
page.on('request', (req) => {
const url = new URL(req.url())
if (!['localhost', '127.0.0.1'].includes(url.hostname)) {
externalRequests.push(req.url())
}
})
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
expect(externalRequests).toEqual([])
})
})
test.describe('US-4: Event not found', () => {
test('shows "event not found" for unknown token', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(
{ type: 'urn:problem-type:event-not-found', title: 'Event Not Found', status: 404, detail: 'Event not found.' },
{ status: 404, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto('/events/00000000-0000-0000-0000-000000000000')
await expect(page.getByText('Event not found.')).toBeVisible()
// No event data visible
await expect(page.locator('.detail__title')).not.toBeVisible()
})
})
test.describe('Server error', () => {
test('shows error message and retry button on 500', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(
{ type: 'about:blank', title: 'Internal Server Error', status: 500, detail: 'An unexpected error occurred.' },
{ status: 500, headers: { 'Content-Type': 'application/problem+json' } },
)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await expect(page.getByText('Something went wrong.')).toBeVisible()
await expect(page.getByRole('button', { name: 'Retry' })).toBeVisible()
})
test('retry button re-fetches the event', async ({ page, network }) => {
let callCount = 0
network.use(
http.get('*/api/events/:token', () => {
callCount++
if (callCount === 1) {
return HttpResponse.json(
{ type: 'about:blank', title: 'Error', status: 500 },
{ status: 500, headers: { 'Content-Type': 'application/problem+json' } },
)
}
return HttpResponse.json(fullEvent)
}),
)
await page.goto(`/events/${fullEvent.eventToken}`)
await expect(page.getByText('Something went wrong.')).toBeVisible()
await page.getByRole('button', { name: 'Retry' }).click()
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
})
})

View File

@@ -0,0 +1,382 @@
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const futureEvent1: StoredEvent = {
eventToken: 'future-aaa',
title: 'Summer BBQ',
dateTime: '2027-06-15T18:00:00Z',
organizerToken: 'org-token-1',
}
const futureEvent2: StoredEvent = {
eventToken: 'future-bbb',
title: 'Team Meeting',
dateTime: '2027-01-10T09:00:00Z',
rsvpToken: 'rsvp-token-1',
rsvpName: 'Alice',
}
const pastEvent: StoredEvent = {
eventToken: 'past-ccc',
title: 'New Year Party',
dateTime: '2025-01-01T00:00:00Z',
}
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
test.describe('US2: Empty State', () => {
test('shows empty state when no events are stored', async ({ page }) => {
await page.goto('/')
await expect(page.getByText('No events yet')).toBeVisible()
await expect(page.getByRole('link', { name: /Create Event/ })).toBeVisible()
})
test('empty state links to create page', async ({ page }) => {
await page.goto('/')
const link = page.getByRole('link', { name: /Create Event/ })
await expect(link).toHaveAttribute('href', '/create')
})
test('empty state is hidden when events exist', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
await expect(page.getByText('No events yet')).not.toBeVisible()
})
})
test.describe('US4: Past Events Appear Faded', () => {
test('past events have the faded modifier class', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1, pastEvent]))
await page.goto('/')
const cards = page.locator('.event-card')
await expect(cards).toHaveCount(2)
// Future event should NOT have past class
const futureCard = cards.filter({ hasText: 'Summer BBQ' })
await expect(futureCard).not.toHaveClass(/event-card--past/)
// Past event should have past class
const pastCard = cards.filter({ hasText: 'New Year Party' })
await expect(pastCard).toHaveClass(/event-card--past/)
})
test('past events remain clickable', async ({ page, network }) => {
await page.addInitScript(seedEvents([pastEvent]))
const { http, HttpResponse } = await import('msw')
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json({
eventToken: pastEvent.eventToken,
title: pastEvent.title,
dateTime: pastEvent.dateTime,
description: '',
location: '',
timezone: 'UTC',
attendeeCount: 0,
})
}),
)
await page.goto('/')
await page.getByText('New Year Party').click()
await expect(page).toHaveURL(`/events/${pastEvent.eventToken}`)
})
})
test.describe('US3: Remove Event from List', () => {
test('delete icon triggers confirmation dialog, confirm removes event', async ({
page,
network,
}) => {
await page.addInitScript(seedEvents([futureEvent1, futureEvent2]))
const { http, HttpResponse } = await import('msw')
network.use(
http.patch('*/api/events/:token', () => {
return new HttpResponse(null, { status: 204 })
}),
)
await page.goto('/')
// Both events visible
await expect(page.getByText('Summer BBQ')).toBeVisible()
await expect(page.getByText('Team Meeting')).toBeVisible()
// Click delete on Summer BBQ (organizer event)
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
// Confirmation dialog appears (organizer event shows "Cancel event?")
await expect(page.getByText('Cancel event?')).toBeVisible()
// Confirm removal
await page.getByRole('button', { name: 'Remove', exact: true }).click()
// Event is gone, other remains
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
await expect(page.getByText('Team Meeting')).toBeVisible()
})
test('cancel keeps the event in the list', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
await expect(page.getByText('Cancel event?')).toBeVisible()
// Cancel
await page.getByRole('button', { name: 'Cancel' }).click()
// Dialog gone, event still there
await expect(page.getByText('Cancel event?')).not.toBeVisible()
await expect(page.getByText('Summer BBQ')).toBeVisible()
})
})
test.describe('US5: Visual Distinction for Event Roles', () => {
test('shows organizer badge for events with organizerToken', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
const card = page.locator('.event-card').filter({ hasText: 'Summer BBQ' })
const badge = card.locator('.event-card__badge')
await expect(badge).toBeVisible()
await expect(badge).toHaveText('Organizing')
await expect(badge).toHaveClass(/event-card__badge--organizer/)
})
test('shows attendee badge for events with rsvpToken only', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent2]))
await page.goto('/')
const card = page.locator('.event-card').filter({ hasText: 'Team Meeting' })
const badge = card.locator('.event-card__badge')
await expect(badge).toBeVisible()
await expect(badge).toHaveText('Attending')
await expect(badge).toHaveClass(/event-card__badge--attendee/)
})
test('shows watcher badge for events without organizerToken or rsvpToken', async ({ page }) => {
await page.addInitScript(seedEvents([pastEvent]))
await page.goto('/')
const card = page.locator('.event-card').filter({ hasText: 'New Year Party' })
const badge = card.locator('.event-card__badge')
await expect(badge).toBeVisible()
await expect(badge).toHaveText('Watching')
await expect(badge).toHaveClass(/event-card__badge--watcher/)
})
})
test.describe('FAB: Create Event Button', () => {
test('FAB is visible when events exist', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
const fab = page.getByRole('link', { name: 'Create event' })
await expect(fab).toBeVisible()
})
test('FAB navigates to create page', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
const fab = page.getByRole('link', { name: 'Create event' })
await expect(fab).toHaveAttribute('href', '/create')
})
test('FAB is not visible on empty state (empty state has its own CTA)', async ({ page }) => {
await page.goto('/')
await expect(page.locator('.fab')).toHaveCount(0)
})
})
test.describe('Temporal Grouping: Section Headers', () => {
test('events are distributed under correct section headers', async ({ page }) => {
// Use dates relative to "now" to ensure correct section assignment
const now = new Date()
const todayEvent: StoredEvent = {
eventToken: 'today-1',
title: 'Today Standup',
dateTime: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 18, 0, 0).toISOString(),
}
const laterEvent: StoredEvent = {
eventToken: 'later-1',
title: 'Future Conference',
dateTime: new Date(now.getFullYear() + 1, 0, 15, 10, 0, 0).toISOString(),
}
await page.addInitScript(seedEvents([todayEvent, laterEvent, pastEvent]))
await page.goto('/')
// Verify section headers appear
await expect(page.getByRole('heading', { name: 'Today', level: 2 })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Later', level: 2 })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Past', level: 2 })).toBeVisible()
// Events are in the correct sections
const sections = page.locator('.event-section')
const todaySection = sections.filter({ has: page.getByRole('heading', { name: 'Today', level: 2 }) })
await expect(todaySection.getByText('Today Standup')).toBeVisible()
const laterSection = sections.filter({ has: page.getByRole('heading', { name: 'Later', level: 2 }) })
await expect(laterSection.getByText('Future Conference')).toBeVisible()
const pastSection = sections.filter({ has: page.getByRole('heading', { name: 'Past', level: 2 }) })
await expect(pastSection.getByText('New Year Party')).toBeVisible()
})
test('empty sections are not rendered', async ({ page }) => {
// Only a past event — no Today, This Week, or Later sections
await page.addInitScript(seedEvents([pastEvent]))
await page.goto('/')
await expect(page.getByRole('heading', { name: 'Past', level: 2 })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Today', level: 2 })).toHaveCount(0)
await expect(page.getByRole('heading', { name: 'This Week', level: 2 })).toHaveCount(0)
await expect(page.getByRole('heading', { name: 'Next Week', level: 2 })).toHaveCount(0)
await expect(page.getByRole('heading', { name: 'Later', level: 2 })).toHaveCount(0)
})
test('Today section header has emphasis CSS class', async ({ page }) => {
const now = new Date()
const todayEvent: StoredEvent = {
eventToken: 'today-emph',
title: 'Emphasis Test',
dateTime: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 20, 0, 0).toISOString(),
}
await page.addInitScript(seedEvents([todayEvent]))
await page.goto('/')
const todayHeader = page.getByRole('heading', { name: 'Today', level: 2 })
await expect(todayHeader).toHaveClass(/section-header--emphasized/)
})
})
test.describe('Temporal Grouping: Date Subheaders', () => {
test('no date subheader in Today section', async ({ page }) => {
const now = new Date()
const todayEvent: StoredEvent = {
eventToken: 'today-sub',
title: 'No Subheader Test',
dateTime: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 19, 0, 0).toISOString(),
}
await page.addInitScript(seedEvents([todayEvent]))
await page.goto('/')
const todaySection = page.locator('.event-section').filter({
has: page.getByRole('heading', { name: 'Today', level: 2 }),
})
await expect(todaySection.locator('.date-subheader')).toHaveCount(0)
})
test('date subheaders appear in Later section', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1, futureEvent2]))
await page.goto('/')
const laterSection = page.locator('.event-section').filter({
has: page.getByRole('heading', { name: 'Later', level: 2 }),
})
// Both future events are on different dates, so expect subheaders
const subheaders = laterSection.locator('.date-subheader')
await expect(subheaders).toHaveCount(2)
})
test('date subheaders appear in Past section', async ({ page }) => {
await page.addInitScript(seedEvents([pastEvent]))
await page.goto('/')
const pastSection = page.locator('.event-section').filter({
has: page.getByRole('heading', { name: 'Past', level: 2 }),
})
await expect(pastSection.locator('.date-subheader')).toHaveCount(1)
})
})
test.describe('Temporal Grouping: Time Display', () => {
test('future event cards show clock time', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
const timeLabel = page.locator('.event-card__time')
const text = await timeLabel.first().textContent()
// Should show clock time (e.g., "18:00" or "6:00 PM"), not relative time
expect(text).toMatch(/\d{1,2}[:.]\d{2}/)
})
test('past event cards show relative time', async ({ page }) => {
await page.addInitScript(seedEvents([pastEvent]))
await page.goto('/')
const timeLabel = page.locator('.event-card__time')
const text = await timeLabel.first().textContent()
// Should show relative time like "X years ago" or "last year"
expect(text).toMatch(/ago|last|yesterday/)
})
})
test.describe('US1: View My Events', () => {
test('displays all stored events with title and relative time', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1, futureEvent2, pastEvent]))
await page.goto('/')
await expect(page.getByText('Summer BBQ')).toBeVisible()
await expect(page.getByText('Team Meeting')).toBeVisible()
await expect(page.getByText('New Year Party')).toBeVisible()
})
test('events are sorted: upcoming ascending, then past', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1, futureEvent2, pastEvent]))
await page.goto('/')
const titles = page.locator('.event-card__title')
await expect(titles).toHaveCount(3)
// Team Meeting (Jan 2027) before Summer BBQ (Jun 2027), then past event
await expect(titles.nth(0)).toHaveText('Team Meeting')
await expect(titles.nth(1)).toHaveText('Summer BBQ')
await expect(titles.nth(2)).toHaveText('New Year Party')
})
test('clicking an event navigates to its detail page', async ({ page, network }) => {
await page.addInitScript(seedEvents([futureEvent1]))
// Mock the event detail API so navigation doesn't fail
const { http, HttpResponse } = await import('msw')
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json({
eventToken: futureEvent1.eventToken,
title: futureEvent1.title,
dateTime: futureEvent1.dateTime,
description: '',
location: '',
timezone: 'UTC',
attendeeCount: 0,
})
}),
)
await page.goto('/')
await page.getByText('Summer BBQ').click()
await expect(page).toHaveURL(`/events/${futureEvent1.eventToken}`)
})
test('each event shows a relative time label', async ({ page }) => {
await page.addInitScript(seedEvents([futureEvent1]))
await page.goto('/')
// The relative time element should exist and contain text (exact value depends on current time)
const timeLabel = page.locator('.event-card__time')
await expect(timeLabel).toHaveCount(1)
await expect(timeLabel.first()).not.toBeEmpty()
})
})

View File

@@ -0,0 +1,108 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Sommerfest am See',
description: 'Bring your own drinks!',
dateTime: '2026-07-15T18:00:00+02:00',
timezone: 'Europe/Berlin',
location: 'Stadtpark Berlin',
attendeeCount: 12,
cancelled: false,
}
const cancelledEvent = {
...fullEvent,
cancelled: true,
cancellationReason: 'Bad weather',
}
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
function rsvpSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
rsvpToken: 'd4e5f6a7-b8c9-0123-4567-890abcdef012',
rsvpName: 'Anna',
}
}
function organizerSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
organizerToken: 'org-token-1234',
}
}
test.describe('iCal download: calendar button visibility', () => {
test('calendar button visible for pre-RSVP visitor', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.goto(`/events/${fullEvent.eventToken}`)
const calendarBtn = page.getByRole('button', { name: /add to calendar/i })
await expect(calendarBtn).toBeVisible()
})
test('calendar button visible for post-RSVP attendee', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
const calendarBtn = page.getByRole('button', { name: /add to calendar/i })
await expect(calendarBtn).toBeVisible()
})
test('calendar button visible for organizer', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.get('*/api/events/:token/attendees*', () =>
HttpResponse.json({ attendees: [] }),
),
)
await page.addInitScript(seedEvents([organizerSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
const calendarBtn = page.getByRole('button', { name: /add to calendar/i })
await expect(calendarBtn).toBeVisible()
})
test('calendar button NOT visible for cancelled event', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(cancelledEvent)),
)
await page.goto(`/events/${fullEvent.eventToken}`)
const calendarBtn = page.getByRole('button', { name: /add to calendar/i })
await expect(calendarBtn).not.toBeVisible()
})
})
test.describe('iCal download: file generation', () => {
test('triggers download with correct filename', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.goto(`/events/${fullEvent.eventToken}`)
// Intercept the download by overriding the click-link mechanism
const downloadPromise = page.waitForEvent('download')
await page.getByRole('button', { name: /add to calendar/i }).click()
const download = await downloadPromise
expect(download.suggestedFilename()).toBe('sommerfest-am-see.ics')
})
})

View File

@@ -0,0 +1,99 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
const eventToken = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
const organizerToken = 'f9e8d7c6-b5a4-3210-fedc-ba9876543210'
const fullEvent = {
eventToken,
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 3,
expired: false,
}
const attendeesResponse = {
attendees: [
{ name: 'Alice' },
{ name: 'Bob' },
{ name: 'Charlie' },
],
}
test.describe('US-1: View attendee list as organizer', () => {
test('organizer sees attendee names', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
http.get('*/api/events/:token/attendees', () => {
return HttpResponse.json(attendeesResponse)
}),
)
// Set organizer token in localStorage before navigating
await page.goto('/')
await page.evaluate(
([et, ot]) => {
localStorage.setItem(
'fete:events',
JSON.stringify([{ eventToken: et, organizerToken: ot, title: 'Summer BBQ', dateTime: '2026-03-15T20:00:00+01:00', expiryDate: '' }]),
)
},
[eventToken, organizerToken],
)
await page.goto(`/events/${eventToken}`)
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
await expect(page.getByText('3 Attendees')).toBeVisible()
await expect(page.getByText('Alice')).toBeVisible()
await expect(page.getByText('Bob')).toBeVisible()
await expect(page.getByText('Charlie')).toBeVisible()
})
test('visitor does not see attendee list', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json(fullEvent)
}),
)
await page.goto(`/events/${eventToken}`)
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
await expect(page.getByText('3 going')).toBeVisible()
await expect(page.locator('.attendee-list')).not.toBeVisible()
})
test('organizer sees empty state when no attendees', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => {
return HttpResponse.json({ ...fullEvent, attendeeCount: 0 })
}),
http.get('*/api/events/:token/attendees', () => {
return HttpResponse.json({ attendees: [] })
}),
)
await page.goto('/')
await page.evaluate(
([et, ot]) => {
localStorage.setItem(
'fete:events',
JSON.stringify([{ eventToken: et, organizerToken: ot, title: 'Summer BBQ', dateTime: '2026-03-15T20:00:00+01:00', expiryDate: '' }]),
)
},
[eventToken, organizerToken],
)
await page.goto(`/events/${eventToken}`)
await expect(page.getByRole('heading', { name: 'Summer BBQ' })).toBeVisible()
await expect(page.getByText('0 Attendees')).toBeVisible()
await expect(page.getByText('No attendees yet.')).toBeVisible()
})
})

View File

@@ -0,0 +1,218 @@
import { http, HttpResponse } from 'msw'
import { test, expect } from './msw-setup'
import type { StoredEvent } from '../src/composables/useEventStorage'
const STORAGE_KEY = 'fete:events'
const fullEvent = {
eventToken: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
title: 'Summer BBQ',
description: 'Bring your own drinks!',
dateTime: '2026-03-15T20:00:00+01:00',
timezone: 'Europe/Berlin',
location: 'Central Park, NYC',
attendeeCount: 12,
cancelled: false,
}
const rsvpToken = 'd4e5f6a7-b8c9-0123-4567-890abcdef012'
const organizerToken = 'org-token-1234'
function seedEvents(events: StoredEvent[]): string {
return `window.localStorage.setItem('${STORAGE_KEY}', ${JSON.stringify(JSON.stringify(events))})`
}
function watchSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
}
}
function rsvpSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
rsvpToken,
rsvpName: 'Anna',
}
}
function organizerSeed(): StoredEvent {
return {
eventToken: fullEvent.eventToken,
title: fullEvent.title,
dateTime: fullEvent.dateTime,
organizerToken,
}
}
test.describe('US1: Watch event from detail page', () => {
test('bookmark unfilled by default, tapping watches the event', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.goto(`/events/${fullEvent.eventToken}`)
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).toBeVisible()
await expect(bookmark).toHaveAttribute('aria-label', 'Watch this event')
await bookmark.click()
await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event')
// Navigate to event list via back link
await page.getByLabel('Back to home').click()
// Event appears with "Watching" label
await expect(page.getByText('Summer BBQ')).toBeVisible()
await expect(page.getByText('Watching')).toBeVisible()
})
})
test.describe('US2: Un-watch event from detail page', () => {
test('tapping filled bookmark un-watches the event', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([watchSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event')
await bookmark.click()
await expect(bookmark).toHaveAttribute('aria-label', 'Watch this event')
// Navigate to event list via back link (avoid page.goto re-running addInitScript)
await page.getByLabel('Back to home').click()
// Event is gone
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
})
})
test.describe('US3: Bookmark reflects attending status', () => {
test('bookmark is not visible when user has RSVPed, list shows Attendee', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Bookmark not shown for attendees — RsvpBar shows status state
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).not.toBeVisible()
// Navigate to list via back link
await page.getByLabel('Back to home').click()
await expect(page.getByText('Attending')).toBeVisible()
await expect(page.getByText('Watching')).not.toBeVisible()
})
})
test.describe('US4: RSVP cancellation preserves watch status', () => {
test('cancel RSVP → bookmark reappears, list shows Watching', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.delete('*/api/events/:token/rsvps/:rsvpToken', () => {
return new HttpResponse(null, { status: 204 })
}),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Cancel RSVP
await page.getByRole('button', { name: /You're attending/ }).click()
await page.locator('.rsvp-bar__cancel').click()
await page.getByRole('alertdialog').getByRole('button', { name: 'Cancel RSVP' }).click()
// Bookmark reappears in CTA state, filled because event is still stored
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).toBeVisible()
await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event')
// Navigate to list via back link
await page.getByLabel('Back to home').click()
await expect(page.getByText('Watching')).toBeVisible()
await expect(page.getByText('Attending')).not.toBeVisible()
})
})
test.describe('US5: No bookmark for attendees and organizers', () => {
test('attendee does not see bookmark', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([rsvpSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).not.toBeVisible()
})
test('organizer does not see bookmark', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
)
await page.addInitScript(seedEvents([organizerSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).not.toBeVisible()
})
})
test.describe('US6: Un-watch from event list', () => {
test('deleting a watched event skips confirmation dialog', async ({ page }) => {
await page.addInitScript(seedEvents([watchSeed()]))
await page.goto('/')
await expect(page.getByText('Summer BBQ')).toBeVisible()
await page.getByRole('button', { name: /Remove Summer BBQ/ }).click()
// No confirmation dialog — event removed immediately
await expect(page.getByText('Remove event?')).not.toBeVisible()
await expect(page.getByText('Summer BBQ')).not.toBeVisible()
})
})
test.describe('US7: Watcher upgrades to attendee', () => {
test('watch → RSVP → bookmark disappears, list shows Attendee', async ({ page, network }) => {
network.use(
http.get('*/api/events/:token', () => HttpResponse.json(fullEvent)),
http.post('*/api/events/:token/rsvps', () => {
return HttpResponse.json(
{ rsvpToken: 'new-rsvp-token', name: 'Max' },
{ status: 201 },
)
}),
)
await page.addInitScript(seedEvents([watchSeed()]))
await page.goto(`/events/${fullEvent.eventToken}`)
// Verify watching state — bookmark visible
const bookmark = page.getByLabel(/watch.*this event/i)
await expect(bookmark).toBeVisible()
await expect(bookmark).toHaveAttribute('aria-label', 'Stop watching this event')
// RSVP
await page.getByRole('button', { name: "I'm attending" }).click()
const dialog = page.getByRole('dialog', { name: 'RSVP' })
await dialog.getByLabel('Your name').fill('Max')
await dialog.getByRole('button', { name: 'Count me in' }).click()
// Bookmark gone — status bar shown instead
await expect(bookmark).not.toBeVisible()
// Navigate to list via back link
await page.getByLabel('Back to home').click()
await expect(page.getByText('Attending')).toBeVisible()
await expect(page.getByText('Watching')).not.toBeVisible()
})
})

View File

@@ -3,6 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<!-- OG_META_TAGS -->
<title>fete</title>
</head>
<body>

File diff suppressed because it is too large Load Diff

View File

@@ -35,24 +35,30 @@
"@vitest/eslint-plugin": "^1.6.9",
"@vue/eslint-config-typescript": "^14.7.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.8.1",
"@vue/tsconfig": "^0.9.0",
"eslint": "^10.0.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-oxlint": "~1.50.0",
"eslint-plugin-oxlint": "~1.55.0",
"eslint-plugin-vue": "~10.8.0",
"jiti": "^2.6.1",
"jsdom": "^28.1.0",
"msw": "^2.12.10",
"npm-run-all2": "^8.0.4",
"openapi-typescript": "^7.13.0",
"oxlint": "~1.50.0",
"oxlint": "~1.55.0",
"prettier": "3.8.1",
"typescript": "~5.9.3",
"vite": "^7.3.1",
"vite": "^8.0.0",
"vite-plugin-vue-devtools": "^8.0.6",
"vitest": "^4.0.18",
"vue-tsc": "^3.2.5"
},
"browserslist": [
">= 0.5%",
"last 2 versions",
"Firefox ESR",
"not dead"
],
"engines": {
"node": "^20.19.0 || >=22.12.0"
}

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<text y="0.9em" font-size="80" x="50%" text-anchor="middle">🎉</text>
</svg>

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -1,9 +1,35 @@
<template>
<div class="app-container">
<header v-if="route.name !== 'home'" class="app-header">
<BackLink />
<div id="header-actions"></div>
</header>
<RouterView />
</div>
</template>
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { RouterView, useRoute } from 'vue-router'
import BackLink from '@/components/BackLink.vue'
const route = useRoute()
</script>
<style scoped>
.app-header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--spacing-lg) var(--content-padding);
pointer-events: none;
}
.app-header :deep(*) {
pointer-events: auto;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@@ -16,6 +16,37 @@
--color-text-on-gradient: #ffffff;
--color-surface: #fff5f8;
--color-card: #ffffff;
--color-dark-base: #1B1730;
/* Danger / destructive actions */
--color-danger: #fca5a5;
--color-danger-bg: rgba(220, 38, 38, 0.15);
--color-danger-bg-hover: rgba(220, 38, 38, 0.25);
--color-danger-bg-strong: rgba(220, 38, 38, 0.2);
--color-danger-border: rgba(220, 38, 38, 0.3);
--color-danger-border-strong: rgba(220, 38, 38, 0.4);
--color-danger-solid: #d32f2f;
--color-danger-solid-hover: #b71c1c;
--color-danger-solid-text: #fff;
/* Glass system */
--color-glass: rgba(255, 255, 255, 0.1);
--color-glass-strong: rgba(255, 255, 255, 0.15);
--color-glass-subtle: rgba(255, 255, 255, 0.05);
--color-glass-border: rgba(255, 255, 255, 0.18);
--color-glass-border-hover: rgba(255, 255, 255, 0.3);
--color-glass-hover: rgba(255, 255, 255, 0.18);
--color-glass-inner: rgba(27, 23, 48, 0.55);
--color-glass-overlay: rgba(27, 23, 48, 0.4);
/* Text on gradient (opacity variants) */
--color-text-muted: rgba(255, 255, 255, 0.5);
--color-text-secondary: rgba(255, 255, 255, 0.7);
--color-text-soft: rgba(255, 255, 255, 0.85);
--color-text-bright: rgba(255, 255, 255, 0.9);
/* Glow border */
--gradient-glow: conic-gradient(from 135deg, var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));
/* Gradient */
--gradient-primary: linear-gradient(135deg, #f06292 0%, #ab47bc 50%, #5c6bc0 100%);
@@ -33,7 +64,7 @@
--radius-button: 14px;
/* Shadows */
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
--shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
--shadow-button: 0 2px 8px rgba(0, 0, 0, 0.15);
/* Layout */
@@ -60,7 +91,22 @@ html {
body {
min-height: 100vh;
background: var(--gradient-primary);
background-color: var(--color-dark-base);
position: relative;
}
body::before {
content: '';
position: fixed;
inset: 0;
background-color: var(--color-dark-base);
background-image:
radial-gradient(at 70% 20%, rgba(240, 98, 146, 0.55) 0px, transparent 50%),
radial-gradient(at 25% 50%, rgba(171, 71, 188, 0.5) 0px, transparent 55%),
radial-gradient(at 80% 70%, rgba(92, 107, 192, 0.55) 0px, transparent 50%),
radial-gradient(at 35% 85%, rgba(255, 112, 67, 0.3) 0px, transparent 40%);
filter: blur(80px);
z-index: -1;
}
#app {
@@ -82,38 +128,66 @@ body {
/* Card-style form fields */
.form-field {
background: var(--color-card);
border: none;
border: 1px solid #e0e0e0;
border-radius: var(--radius-card);
padding: var(--spacing-md) var(--spacing-md);
box-shadow: var(--shadow-card);
width: 100%;
font-family: inherit;
font-size: 0.95rem;
font-weight: 400;
color: var(--color-text);
outline: none;
transition: box-shadow 0.2s ease;
transition: border-color 0.2s ease;
}
.form-field.glass {
color: var(--color-text-on-gradient);
}
.form-field:focus {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
border-color: var(--color-glass-border-hover);
}
.form-field::placeholder {
color: #999;
color: var(--color-text-muted);
font-weight: 400;
}
.form-field.glass::placeholder {
color: var(--color-text-muted);
}
textarea.form-field {
resize: vertical;
min-height: 5rem;
}
/* iOS Safari: datetime-local overflows container and shows empty when no value */
input[type="datetime-local"].form-field {
min-width: 0;
max-width: 100%;
overflow: hidden;
}
input[type="datetime-local"].form-field.glass::-webkit-date-and-time-value {
color: var(--color-text-on-gradient);
text-align: left;
}
input[type="datetime-local"].form-field.glass::-webkit-datetime-edit {
color: var(--color-text-on-gradient);
}
input[type="datetime-local"].form-field.glass::-webkit-datetime-edit-fields-wrapper {
color: var(--color-text-on-gradient);
}
/* Form group (label + input) */
.form-group {
display: flex;
flex-direction: column;
gap: 0.35rem;
overflow: hidden;
}
.form-label {
@@ -128,22 +202,29 @@ textarea.form-field {
display: block;
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
background: var(--color-accent);
background: var(--color-card);
color: var(--color-text);
border: none;
border: 1px solid #e0e0e0;
border-radius: var(--radius-button);
font-family: inherit;
font-size: 1rem;
font-weight: 700;
cursor: pointer;
box-shadow: var(--shadow-button);
transition: opacity 0.2s ease, transform 0.1s ease;
transition: border-color 0.2s ease, transform 0.1s ease;
text-align: center;
text-decoration: none;
}
.btn-primary.glass {
color: var(--color-text-on-gradient);
border: 2px solid transparent;
background:
linear-gradient(var(--color-glass-inner), var(--color-glass-inner)) padding-box,
var(--gradient-glow) border-box;
}
.btn-primary:hover {
opacity: 0.92;
border-color: var(--color-glass-border-hover);
}
.btn-primary:active {
@@ -157,12 +238,151 @@ textarea.form-field {
/* Error message */
.field-error {
color: #fff;
color: var(--color-danger-solid);
font-size: 0.875rem;
font-weight: 600;
padding-left: 0.25rem;
}
/* Skeleton shimmer loading state */
.skeleton {
background: linear-gradient(90deg, var(--color-card) 25%, #e0e0e0 50%, var(--color-card) 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
border-radius: var(--radius-card);
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* ── Glass System ── */
/* Glass surface: passive containers on gradient (cards, icon boxes) */
.glass {
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
box-shadow: var(--shadow-card);
backdrop-filter: blur(16px);
}
.glass:hover:not(input):not(textarea):not(.btn-primary) {
background: var(--color-glass-hover);
border-color: var(--color-glass-border-hover);
}
/* Glass interactive inner: dark translucent fill for interactive elements (FAB, CTA) */
.glass-inner {
background: var(--color-glass-inner);
backdrop-filter: blur(16px);
}
/* Glow border: conic gradient wrapper with halo (static) */
.glow-border {
background: var(--gradient-glow);
padding: 2px;
position: relative;
}
.glow-border::before {
content: '';
position: absolute;
inset: -4px;
border-radius: inherit;
background: var(--gradient-glow);
filter: blur(8px);
opacity: 0.3;
z-index: -1;
}
/* Glow border animated variant */
@property --glow-angle {
syntax: '<angle>';
initial-value: 0deg;
inherits: false;
}
.glow-border--animated {
background: conic-gradient(from var(--glow-angle), var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));
animation: glow-rotate 4s linear infinite;
}
.glow-border--animated::before {
background: conic-gradient(from var(--glow-angle), var(--color-gradient-start), var(--color-gradient-mid), var(--color-gradient-end), var(--color-gradient-start));
animation: glow-rotate 4s linear infinite;
}
@keyframes glow-rotate {
to { --glow-angle: 360deg; }
}
/* ── Fixed Bottom Bar Components ── */
/* CTA wrapper (text button, e.g. "I'm attending!", "Post an update") */
.bar-cta {
flex: 1;
min-width: 0;
border-radius: var(--radius-button);
transition: transform 0.1s ease;
}
.bar-cta:hover {
transform: scale(1.02);
}
.bar-cta:active {
transform: scale(0.98);
}
.bar-cta-btn {
display: block;
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
border-radius: calc(var(--radius-button) - 2px);
font-family: inherit;
font-size: 1rem;
font-weight: 700;
color: var(--color-text-on-gradient);
text-align: center;
border: none;
cursor: pointer;
}
/* Icon wrapper (e.g. calendar, bookmark buttons) */
.bar-icon {
flex-shrink: 0;
border-radius: var(--radius-button);
transition: transform 0.1s ease;
}
.bar-icon:hover {
transform: scale(1.02);
}
.bar-icon:active {
transform: scale(0.98);
}
.bar-icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: var(--spacing-md);
border-radius: calc(var(--radius-button) - 2px);
border: none;
cursor: pointer;
color: var(--color-text-on-gradient);
line-height: 0;
}
.bar-icon-btn svg {
display: block;
}
/* Utility */
.text-center {
text-align: center;
@@ -179,3 +399,35 @@ textarea.form-field {
white-space: nowrap;
border: 0;
}
/* Bottom sheet form */
.sheet-title {
font-size: 1.2rem;
font-weight: 700;
color: var(--color-text-on-gradient);
}
.rsvp-form {
display: flex;
flex-direction: column;
gap: var(--spacing-md);
}
.rsvp-form__label,
.cancel-form__label {
font-size: 0.85rem;
font-weight: 700;
color: var(--color-text-on-gradient);
padding-left: 0.25rem;
}
.rsvp-form__field-error {
color: var(--color-danger-solid);
font-size: 0.875rem;
font-weight: 600;
padding-left: 0.25rem;
}
.rsvp-form__error {
text-align: center;
}

View File

@@ -0,0 +1,59 @@
<template>
<section class="attendee-list">
<h3 class="attendee-list__heading">
{{ attendees.length === 1 ? '1 Attendee' : `${attendees.length} Attendees` }}
</h3>
<ul v-if="attendees.length > 0" class="attendee-list__items">
<li v-for="(name, index) in attendees" :key="index" class="attendee-list__item">
{{ name }}
</li>
</ul>
<p v-else class="attendee-list__empty">No attendees yet.</p>
</section>
</template>
<script setup lang="ts">
defineProps<{
attendees: string[]
}>()
</script>
<style scoped>
.attendee-list {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
}
.attendee-list__heading {
font-size: 0.75rem;
font-weight: 700;
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.attendee-list__items {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
}
.attendee-list__item {
font-size: 0.95rem;
color: var(--color-text-soft);
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.attendee-list__empty {
font-size: 0.9rem;
color: var(--color-text-muted);
font-style: italic;
}
</style>

View File

@@ -0,0 +1,28 @@
<template>
<RouterLink to="/" class="back-link" aria-label="Back to home">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6" />
</svg>
<span class="back-link__brand">fete</span>
</RouterLink>
</template>
<script setup lang="ts">
import { RouterLink } from 'vue-router'
</script>
<style scoped>
.back-link {
display: inline-flex;
align-items: center;
gap: 0.15rem;
color: var(--color-text-on-gradient);
text-decoration: none;
line-height: 1;
}
.back-link__brand {
font-size: 1.3rem;
font-weight: 700;
}
</style>

View File

@@ -0,0 +1,149 @@
<template>
<Teleport to="body">
<Transition name="sheet">
<div v-if="open" class="sheet-backdrop" @click.self="$emit('close')" @keydown.escape="$emit('close')">
<div
class="sheet"
role="dialog"
aria-modal="true"
:aria-label="label"
ref="sheetEl"
tabindex="-1"
:style="dragStyle"
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
>
<div class="sheet__handle" aria-hidden="true" />
<slot />
</div>
</div>
</Transition>
</Teleport>
</template>
<script setup lang="ts">
import { ref, computed, watch, nextTick } from 'vue'
defineProps<{
open: boolean
label: string
}>()
const emit = defineEmits<{
close: []
}>()
const sheetEl = ref<HTMLElement | null>(null)
watch(
() => sheetEl.value,
async (el) => {
if (el) {
await nextTick()
const firstInput = el.querySelector<HTMLElement>('input, textarea, button[type="submit"]')
if (firstInput) {
firstInput.focus()
} else {
el.focus()
}
}
},
)
/* ── Drag-to-dismiss ── */
const DISMISS_THRESHOLD = 100
const dragY = ref(0)
const dragging = ref(false)
let startY = 0
const dragStyle = computed(() => {
if (!dragging.value || dragY.value <= 0) return undefined
return {
transform: `translateY(${dragY.value}px)`,
transition: 'none',
}
})
function onTouchStart(e: TouchEvent) {
const touch = e.touches[0]
if (!touch) return
startY = touch.clientY
dragging.value = true
dragY.value = 0
}
function onTouchMove(e: TouchEvent) {
if (!dragging.value) return
const touch = e.touches[0]
if (!touch) return
const delta = touch.clientY - startY
if (delta > 0) e.preventDefault()
dragY.value = Math.max(0, delta)
}
function onTouchEnd() {
if (dragY.value >= DISMISS_THRESHOLD) {
emit('close')
}
dragging.value = false
dragY.value = 0
}
</script>
<style scoped>
.sheet-backdrop {
position: fixed;
inset: 0;
background: var(--color-glass-overlay);
display: flex;
align-items: flex-end;
justify-content: center;
z-index: 100;
}
.sheet {
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
border-bottom: none;
backdrop-filter: blur(24px);
border-radius: 20px 20px 0 0;
padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-2xl);
width: 100%;
max-width: var(--content-max-width);
display: flex;
flex-direction: column;
gap: var(--spacing-lg);
outline: none;
}
.sheet__handle {
width: 36px;
height: 4px;
background: var(--color-glass-border-hover);
border-radius: 2px;
align-self: center;
flex-shrink: 0;
}
/* Transition */
.sheet-enter-active,
.sheet-leave-active {
transition: opacity 0.25s ease;
}
.sheet-enter-active .sheet,
.sheet-leave-active .sheet {
transition: transform 0.25s ease;
}
.sheet-enter-from,
.sheet-leave-to {
opacity: 0;
}
.sheet-enter-from .sheet,
.sheet-leave-to .sheet {
transform: translateY(100%);
}
</style>

View File

@@ -0,0 +1,154 @@
<template>
<Teleport to="body">
<Transition name="confirm-dialog">
<div v-if="open" class="confirm-dialog__overlay" @click.self="$emit('cancel')">
<div
class="confirm-dialog"
role="alertdialog"
aria-modal="true"
:aria-label="title"
@keydown.escape="$emit('cancel')"
>
<p class="confirm-dialog__title">{{ title }}</p>
<p class="confirm-dialog__message">{{ message }}</p>
<div class="confirm-dialog__actions">
<button
ref="cancelBtn"
class="confirm-dialog__btn confirm-dialog__btn--cancel"
type="button"
@click="$emit('cancel')"
>
{{ cancelLabel }}
</button>
<button
class="confirm-dialog__btn confirm-dialog__btn--confirm"
type="button"
@click="$emit('confirm')"
>
{{ confirmLabel }}
</button>
</div>
</div>
</div>
</Transition>
</Teleport>
</template>
<script setup lang="ts">
import { ref, watch, nextTick } from 'vue'
const props = withDefaults(
defineProps<{
open: boolean
title?: string
message?: string
confirmLabel?: string
cancelLabel?: string
}>(),
{
title: 'Are you sure?',
message: '',
confirmLabel: 'Remove',
cancelLabel: 'Cancel',
},
)
defineEmits<{
confirm: []
cancel: []
}>()
const cancelBtn = ref<HTMLButtonElement | null>(null)
watch(
() => props.open,
async (isOpen) => {
if (isOpen) {
await nextTick()
cancelBtn.value?.focus()
}
},
)
</script>
<style scoped>
.confirm-dialog__overlay {
position: fixed;
inset: 0;
background: var(--color-glass-overlay);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
padding: var(--spacing-lg);
}
.confirm-dialog {
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
backdrop-filter: blur(24px);
border-radius: var(--radius-card);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
padding: var(--spacing-xl);
max-width: 320px;
width: 100%;
display: flex;
flex-direction: column;
gap: var(--spacing-md);
}
.confirm-dialog__title {
font-size: 1.05rem;
font-weight: 700;
color: var(--color-text-on-gradient);
}
.confirm-dialog__message {
font-size: 0.9rem;
font-weight: 400;
color: var(--color-text-soft);
}
.confirm-dialog__actions {
display: flex;
gap: var(--spacing-sm);
justify-content: flex-end;
margin-top: var(--spacing-xs);
}
.confirm-dialog__btn {
padding: 0.5rem 1rem;
border: none;
border-radius: var(--radius-button);
font-family: inherit;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: opacity 0.15s ease;
}
.confirm-dialog__btn:hover {
opacity: 0.85;
}
.confirm-dialog__btn--cancel {
background: var(--color-glass);
border: 1px solid var(--color-glass-border);
color: var(--color-text-on-gradient);
}
.confirm-dialog__btn--confirm {
background: var(--color-danger-solid);
color: var(--color-danger-solid-text);
}
.confirm-dialog-enter-active,
.confirm-dialog-leave-active {
transition: opacity 0.15s ease;
}
.confirm-dialog-enter-from,
.confirm-dialog-leave-to {
opacity: 0;
}
</style>

View File

@@ -0,0 +1,58 @@
<template>
<RouterLink to="/create" class="fab glow-border" aria-label="Create event">
<span class="fab__inner glass-inner">
<span class="fab__icon" aria-hidden="true">+</span>
</span>
</RouterLink>
</template>
<script setup lang="ts">
import { RouterLink } from 'vue-router'
</script>
<style scoped>
.fab {
position: fixed;
bottom: calc(1.2rem + env(safe-area-inset-bottom));
right: 1.2rem;
width: 56px;
height: 56px;
border-radius: 50%;
color: var(--color-text-on-gradient);
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
z-index: 100;
transition: transform 0.15s ease;
}
.fab__inner {
width: 100%;
height: 100%;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.fab:hover {
transform: scale(1.08);
}
.fab:active {
transform: scale(0.95);
}
.fab:focus-visible {
outline: 2px solid #fff;
outline-offset: 3px;
}
.fab__icon {
font-size: 1.8rem;
font-weight: 300;
line-height: 1;
}
</style>

View File

@@ -0,0 +1,19 @@
<template>
<h3 class="date-subheader">{{ label }}</h3>
</template>
<script setup lang="ts">
defineProps<{
label: string
}>()
</script>
<style scoped>
.date-subheader {
font-size: 0.85rem;
font-weight: 500;
color: var(--color-text-soft);
margin: 0;
padding: var(--spacing-xs) 0;
}
</style>

View File

@@ -0,0 +1,62 @@
<template>
<div class="empty-state">
<p class="empty-state__message">No events yet.<br />Create your first one!</p>
<RouterLink to="/create" class="empty-state__cta glow-border glow-border--animated">
<span class="empty-state__cta-inner glass-inner">Create Event</span>
</RouterLink>
</div>
</template>
<script setup lang="ts">
import { RouterLink } from 'vue-router'
</script>
<style scoped>
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--spacing-lg);
}
.empty-state__message {
font-size: 1rem;
font-weight: 400;
color: var(--color-text-on-gradient);
opacity: 0.9;
text-align: center;
}
.empty-state__cta {
max-width: 280px;
width: 100%;
border-radius: var(--radius-button);
text-decoration: none;
transition: transform 0.1s ease;
}
.empty-state__cta-inner {
display: block;
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
border-radius: calc(var(--radius-button) - 2px);
font-family: inherit;
font-size: 1rem;
font-weight: 700;
color: var(--color-text-on-gradient);
text-align: center;
}
.empty-state__cta:hover {
transform: scale(1.02);
}
.empty-state__cta:active {
transform: scale(0.98);
}
.empty-state__cta:focus-visible {
outline: 2px solid #fff;
outline-offset: 3px;
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<div
class="event-card glass"
:class="{ 'event-card--past': isPast, 'event-card--swiping': isSwiping }"
:style="swipeStyle"
@touchstart="onTouchStart"
@touchmove="onTouchMove"
@touchend="onTouchEnd"
>
<RouterLink :to="`/events/${eventToken}`" class="event-card__link">
<span class="event-card__title">{{ title }}</span>
<span class="event-card__time">{{ displayTime }}</span>
</RouterLink>
<span v-if="eventRole" class="event-card__badge" :class="`event-card__badge--${eventRole}`">
{{ eventRole === 'organizer' ? 'Organizing' : eventRole === 'attendee' ? 'Attending' : 'Watching' }}
</span>
<button
class="event-card__delete"
type="button"
:aria-label="`Remove ${title}`"
@click.stop="$emit('delete', eventToken)"
>
×
</button>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { RouterLink } from 'vue-router'
const props = defineProps<{
eventToken: string
title: string
relativeTime: string
isPast: boolean
eventRole?: 'organizer' | 'attendee' | 'watcher'
timeDisplayMode?: 'clock' | 'relative'
dateTime?: string
}>()
const emit = defineEmits<{
delete: [eventToken: string]
}>()
const displayTime = computed(() => {
if (props.timeDisplayMode === 'clock' && props.dateTime) {
return new Intl.DateTimeFormat(undefined, { hour: '2-digit', minute: '2-digit' }).format(new Date(props.dateTime))
}
return props.relativeTime
})
const SWIPE_THRESHOLD = 80
const startX = ref(0)
const deltaX = ref(0)
const isSwiping = ref(false)
const swipeStyle = computed(() => {
if (deltaX.value === 0) return {}
return { transform: `translateX(${deltaX.value}px)` }
})
function onTouchStart(e: TouchEvent) {
const touch = e.touches[0]
if (!touch) return
startX.value = touch.clientX
deltaX.value = 0
isSwiping.value = false
}
function onTouchMove(e: TouchEvent) {
const touch = e.touches[0]
if (!touch) return
const diff = touch.clientX - startX.value
// Only allow leftward swipe
if (diff < 0) {
deltaX.value = diff
isSwiping.value = true
}
}
function onTouchEnd() {
if (deltaX.value < -SWIPE_THRESHOLD) {
emit('delete', props.eventToken)
}
deltaX.value = 0
isSwiping.value = false
}
</script>
<style scoped>
.event-card {
display: flex;
align-items: center;
border-radius: var(--radius-card);
padding: var(--spacing-md) var(--spacing-lg);
gap: var(--spacing-sm);
transition: background 0.2s ease, border-color 0.2s ease;
}
.event-card--past {
opacity: 0.6;
filter: saturate(0.5);
}
.event-card:not(.event-card--swiping) {
transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}
.event-card__link {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.15rem;
text-decoration: none;
color: inherit;
min-width: 0;
}
.event-card__title {
font-size: 0.95rem;
font-weight: 600;
color: var(--color-text-on-gradient);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.event-card__time {
font-size: 0.8rem;
font-weight: 400;
color: var(--color-text-secondary);
}
.event-card__badge {
font-size: 0.7rem;
font-weight: 600;
padding: 0.15rem 0.5rem;
border-radius: 999px;
white-space: nowrap;
flex-shrink: 0;
}
.event-card__badge--organizer {
background: var(--color-accent);
color: var(--color-text-on-gradient);
}
.event-card__badge--attendee {
background: var(--color-glass-strong);
color: var(--color-text-bright);
}
.event-card__badge--watcher {
background: var(--color-glass);
color: var(--color-text-secondary);
border: 1px solid var(--color-glass-border);
}
.event-card__delete {
flex-shrink: 0;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
font-size: 1.2rem;
color: var(--color-text-muted);
cursor: pointer;
border-radius: 50%;
transition: color 0.15s ease, background 0.15s ease;
}
.event-card__delete:hover {
color: var(--color-danger-solid);
background: rgba(211, 47, 47, 0.08);
}
.event-card__delete:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}
</style>

View File

@@ -0,0 +1,176 @@
<template>
<div class="event-list">
<section
v-for="section in groupedSections"
:key="section.key"
:aria-label="section.label"
class="event-section"
>
<SectionHeader :label="section.label" :emphasized="section.emphasized" />
<div role="list">
<template v-for="group in section.dateGroups" :key="group.dateKey">
<DateSubheader v-if="group.showSubheader" :label="group.label" />
<div v-for="event in group.events" :key="event.eventToken" role="listitem">
<EventCard
:event-token="event.eventToken"
:title="event.title"
:relative-time="formatRelativeTime(event.dateTime)"
:is-past="section.key === 'past'"
:event-role="getRole(event)"
:time-display-mode="section.key === 'past' ? 'relative' : 'clock'"
:date-time="event.dateTime"
@delete="requestDelete"
/>
</div>
</template>
</div>
</section>
<ConfirmDialog
:open="!!pendingDeleteToken"
:title="deleteDialogTitle"
:message="deleteDialogMessage"
confirm-label="Remove"
cancel-label="Cancel"
@confirm="confirmDelete"
@cancel="cancelDelete"
/>
</div>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import { useEventStorage, isValidStoredEvent } from '../composables/useEventStorage'
import { useEventGrouping } from '../composables/useEventGrouping'
import { formatRelativeTime } from '../composables/useRelativeTime'
import { api } from '../api/client'
import EventCard from './EventCard.vue'
import SectionHeader from './SectionHeader.vue'
import DateSubheader from './DateSubheader.vue'
import ConfirmDialog from './ConfirmDialog.vue'
import type { StoredEvent } from '../composables/useEventStorage'
const { getStoredEvents, getRsvp, getOrganizerToken, removeEvent } = useEventStorage()
const pendingDeleteToken = ref<string | null>(null)
const deleteError = ref('')
const pendingDeleteRole = computed(() => {
if (!pendingDeleteToken.value) return null
const event = getStoredEvents().find((e) => e.eventToken === pendingDeleteToken.value)
return event ? getRole(event) : null
})
const deleteDialogTitle = computed(() => {
return pendingDeleteRole.value === 'organizer' ? 'Cancel event?' : 'Remove event?'
})
const deleteDialogMessage = computed(() => {
if (!pendingDeleteToken.value) return ''
if (pendingDeleteRole.value === 'organizer') {
return 'This will permanently cancel the event for all attendees.'
}
const rsvp = getRsvp(pendingDeleteToken.value)
if (rsvp) {
return 'This event will be removed from your list and your attendance will be cancelled.'
}
return 'This event will be removed from your list.'
})
function requestDelete(eventToken: string) {
deleteError.value = ''
const role = getRole(getStoredEvents().find((e) => e.eventToken === eventToken)!)
if (role === 'watcher') {
removeEvent(eventToken)
return
}
pendingDeleteToken.value = eventToken
}
async function confirmDelete() {
if (!pendingDeleteToken.value) return
const eventToken = pendingDeleteToken.value
const organizerToken = getOrganizerToken(eventToken)
if (organizerToken) {
try {
const { response } = await api.PATCH('/events/{eventToken}', {
params: {
path: { eventToken },
query: { organizerToken },
},
body: { cancelled: true },
})
if (response.status !== 204 && response.status !== 409 && response.status !== 404) {
deleteError.value = 'Could not cancel event. Please try again.'
return
}
} catch {
deleteError.value = 'Could not cancel event. Please try again.'
return
}
removeEvent(eventToken)
pendingDeleteToken.value = null
return
}
const rsvp = getRsvp(eventToken)
if (rsvp) {
try {
const { response } = await api.DELETE('/events/{eventToken}/rsvps/{rsvpToken}', {
params: {
path: {
eventToken: eventToken,
rsvpToken: rsvp.rsvpToken,
},
},
})
if (response.status !== 204 && response.status !== 404) {
deleteError.value = 'Could not cancel attendance. Please try again.'
pendingDeleteToken.value = null
return
}
} catch {
deleteError.value = 'Could not cancel attendance. Please try again.'
pendingDeleteToken.value = null
return
}
}
removeEvent(eventToken)
pendingDeleteToken.value = null
}
function cancelDelete() {
pendingDeleteToken.value = null
}
function getRole(event: StoredEvent): 'organizer' | 'attendee' | 'watcher' {
if (event.organizerToken) return 'organizer'
if (event.rsvpToken) return 'attendee'
return 'watcher'
}
const groupedSections = computed(() => {
const valid = getStoredEvents().filter(isValidStoredEvent)
return useEventGrouping(valid)
})
</script>
<style scoped>
.event-list {
display: flex;
flex-direction: column;
gap: var(--spacing-md);
}
.event-section [role="list"] {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
}
</style>

View File

@@ -0,0 +1,260 @@
<template>
<div class="rsvp-bar">
<div class="rsvp-bar__inner">
<!-- Status state: already RSVPed -->
<div v-if="hasRsvp" class="rsvp-bar__status-wrapper">
<div class="rsvp-bar__status-row">
<div
class="rsvp-bar__status"
role="button"
tabindex="0"
:aria-expanded="expanded"
aria-label="You're attending. Tap to show cancel option."
@click="expanded = !expanded"
@keydown.enter.prevent="expanded = !expanded"
@keydown.space.prevent="expanded = !expanded"
@keydown.escape="expanded = false"
>
<span class="rsvp-bar__check" aria-hidden="true"></span>
<span class="rsvp-bar__text">You're attending!</span>
<span class="rsvp-bar__chevron" :class="{ 'rsvp-bar__chevron--open': expanded }" aria-hidden="true"></span>
</div>
<button
class="rsvp-bar__calendar-glass"
type="button"
aria-label="Add to calendar"
@click="$emit('calendar')"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
</button>
</div>
<Transition name="rsvp-bar-cancel">
<button
v-if="expanded"
class="rsvp-bar__cancel"
type="button"
@click="$emit('cancel')"
>
Cancel RSVP
</button>
</Transition>
</div>
<!-- CTA state: no RSVP yet -->
<div v-else class="rsvp-bar__row">
<div class="bar-icon glow-border glow-border--animated">
<button
class="bar-icon-btn glass-inner"
type="button"
:aria-label="bookmarked ? 'Stop watching this event' : 'Watch this event'"
@click="$emit('bookmark')"
>
<svg width="20" height="20" viewBox="0 0 24 24" :fill="bookmarked ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>
</button>
</div>
<div class="bar-cta glow-border glow-border--animated">
<button class="bar-cta-btn glass-inner" type="button" @click="$emit('open')">
I'm attending!
</button>
</div>
<div class="bar-icon glow-border glow-border--animated">
<button
class="bar-icon-btn glass-inner"
type="button"
aria-label="Add to calendar"
@click="$emit('calendar')"
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
</button>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
const props = defineProps<{
hasRsvp?: boolean
bookmarked?: boolean
}>()
defineEmits<{
open: []
cancel: []
bookmark: []
calendar: []
}>()
const expanded = ref(false)
watch(() => props.hasRsvp, () => {
expanded.value = false
})
function onClickOutside(e: MouseEvent) {
const target = e.target as HTMLElement
if (!target.closest('.rsvp-bar__status-wrapper')) {
expanded.value = false
}
}
watch(expanded, (isExpanded) => {
if (isExpanded) {
document.addEventListener('click', onClickOutside, { capture: true })
} else {
document.removeEventListener('click', onClickOutside, { capture: true })
}
})
</script>
<style scoped>
.rsvp-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
z-index: 50;
padding: var(--spacing-md) var(--content-padding);
padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px));
}
.rsvp-bar__inner {
width: 100%;
max-width: var(--content-max-width);
}
.rsvp-bar__row {
display: flex;
gap: var(--spacing-sm);
}
.rsvp-bar__status-wrapper {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
}
.rsvp-bar__status-row {
display: flex;
gap: var(--spacing-sm);
}
.rsvp-bar__status {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
gap: var(--spacing-xs);
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
backdrop-filter: blur(16px);
border-radius: var(--radius-card);
padding: var(--spacing-md) var(--spacing-lg);
box-shadow: var(--shadow-card);
font-weight: 600;
font-size: 0.95rem;
color: var(--color-text-on-gradient);
cursor: pointer;
user-select: none;
-webkit-user-select: none;
}
.rsvp-bar__status:hover {
background: linear-gradient(135deg, var(--color-glass-hover) 0%, var(--color-glass-strong) 100%);
}
.rsvp-bar__check {
color: #4caf50;
font-size: 1.1rem;
font-weight: 700;
}
.rsvp-bar__text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rsvp-bar__chevron {
font-size: 1.2rem;
font-weight: 700;
transition: transform 0.2s ease;
transform: rotate(0deg);
margin-left: auto;
}
.rsvp-bar__chevron--open {
transform: rotate(90deg);
}
.rsvp-bar__cancel {
display: block;
width: 100%;
padding: var(--spacing-sm) var(--spacing-lg);
border-radius: var(--radius-card);
font-family: inherit;
font-size: 0.9rem;
font-weight: 600;
color: #ef5350;
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
backdrop-filter: blur(16px);
cursor: pointer;
text-align: center;
transition: background 0.15s ease;
}
.rsvp-bar__cancel:hover {
background: linear-gradient(135deg, var(--color-glass-hover) 0%, var(--color-glass-strong) 100%);
}
.rsvp-bar-cancel-enter-active,
.rsvp-bar-cancel-leave-active {
transition: opacity 0.15s ease, transform 0.15s ease;
}
.rsvp-bar-cancel-enter-from,
.rsvp-bar-cancel-leave-to {
opacity: 0;
transform: translateY(-4px);
}
/* Calendar button — glassmorphic variant (post-RSVP status row) */
.rsvp-bar__calendar-glass {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
padding: var(--spacing-md);
background: linear-gradient(135deg, var(--color-glass-strong) 0%, var(--color-glass-subtle) 100%);
border: 1px solid var(--color-glass-border);
backdrop-filter: blur(16px);
border-radius: var(--radius-card);
box-shadow: var(--shadow-card);
color: var(--color-text-on-gradient);
cursor: pointer;
line-height: 0;
transition: transform 0.1s ease, background 0.15s ease;
}
.rsvp-bar__calendar-glass:hover {
transform: scale(1.02);
background: linear-gradient(135deg, var(--color-glass-hover) 0%, var(--color-glass-strong) 100%);
}
.rsvp-bar__calendar-glass:active {
transform: scale(0.98);
}
.rsvp-bar__calendar-glass svg {
display: block;
}
</style>

View File

@@ -0,0 +1,27 @@
<template>
<h2 class="section-header" :class="{ 'section-header--emphasized': emphasized }">
{{ label }}
</h2>
</template>
<script setup lang="ts">
defineProps<{
label: string
emphasized?: boolean
}>()
</script>
<style scoped>
.section-header {
font-size: 1rem;
font-weight: 700;
color: var(--color-text-on-gradient);
margin: 0;
padding: var(--spacing-sm) 0;
}
.section-header--emphasized {
font-size: 1.1rem;
font-weight: 800;
}
</style>

Some files were not shown because too many files have changed in this diff Show More