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