package de.gecheckt.pdf.umbenenner.application.port.out;

import java.util.Objects;

/**
 * Lookup result indicating that the document has finally and irrecoverably failed.
 * <p>
 * The master record's overall status is
 * {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#FAILED_FINAL}.
 * The use case must skip further processing and historise a
 * {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#SKIPPED_FINAL_FAILURE}
 * attempt. No failure counters are changed.
 * <p>
 * The existing {@link DocumentRecord} is supplied so the use case can read the
 * current record for the skip attempt historisation without an additional lookup.
 *
 * @param record the current (finally failed) master record for this document; never null
 */
public record DocumentTerminalFinalFailure(DocumentRecord record) implements DocumentRecordLookupResult {

    /**
     * Compact constructor validating the non-null contract.
     *
     * @throws NullPointerException if {@code record} is null
     */
    public DocumentTerminalFinalFailure {
        Objects.requireNonNull(record, "record must not be null");
    }
}
