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>
19 lines
457 B
Java
19 lines
457 B
Java
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());
|
|
}
|
|
}
|