package org.raddatz.familienarchiv.person;

import java.util.UUID;

/**
 * Projection returned by the /api/persons list endpoint.
 * Includes document count to avoid N+1 queries in the UI.
 * Uses interface projection for compatibility with native queries.
 */
public interface PersonSummaryDTO {
    UUID getId();
    String getTitle();
    String getFirstName();
    String getLastName();
    String getPersonType();
    String getAlias();
    Integer getBirthYear();
    Integer getDeathYear();
    String getNotes();
    boolean isFamilyMember();
    long getDocumentCount();

    default String getDisplayName() {
        return org.raddatz.familienarchiv.user.DisplayNameFormatter.format(
                getTitle(), getFirstName(), getLastName());
    }
}
