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