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());
  }
}
