package de.gecheckt.pdf.umbenenner.domain.model;

import java.util.Objects;

/**
 * Stable, unique identifier for an externally-loaded prompt template.
 * <p>
 * The prompt is not embedded in code but loaded from an external file or resource.
 * The identifier allows traceability: which prompt version was used for a specific
 * AI request and naming proposal?
 * <p>
 * <strong>Identity semantics:</strong> Two {@code PromptIdentifier} instances are
 * equal if and only if their identifier strings are equal (by value, not by reference).
 * <p>
 * <strong>Typical examples:</strong>
 * <ul>
 *   <li>Prompt file name: {@code "prompt_de_v1.txt"}</li>
 *   <li>Version string: {@code "2026-03-v2"}</li>
 *   <li>Content hash: {@code "sha256:abc123..."}</li>
 * </ul>
 * <p>
 * The choice of identifier scheme is flexible (filename, semantic version, hash, etc.),
 * but must be stable and deterministic so that the same prompt always receives the
 * same identifier across batch runs.
 *
 * @param identifier the stable, non-null identifier string (typically non-empty)
 */
public record PromptIdentifier(String identifier) {

    /**
     * Compact constructor validating that the identifier is not null.
     *
     * @throws NullPointerException if {@code identifier} is null
     */
    public PromptIdentifier {
        Objects.requireNonNull(identifier, "identifier must not be null");
    }
}
