package at.procon.dip.migration.audit.config;

import jakarta.validation.constraints.Min;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "dip.migration.legacy-audit")
@Data
public class LegacyTedAuditProperties {

    /**
     * Enables the Wave 1 / Milestone A legacy TED audit subsystem.
     */
    private boolean enabled = true;

    /**
     * Automatically runs the read-only audit on application startup.
     */
    private boolean startupRunEnabled = false;

    /**
     * Maximum number of legacy TED documents to scan during startup.
     * 0 means no limit.
     */
    @Min(0)
    private int startupRunLimit = 500;

    /**
     * Batch size for legacy TED document paging.
     */
    @Min(1)
    private int pageSize = 100;

    /**
     * Hard cap for persisted findings in a single run to avoid runaway audit volume.
     */
    @Min(1)
    private int maxFindingsPerRun = 10000;

    /**
     * Maximum number of duplicate/grouped samples recorded for global aggregate checks.
     */
    @Min(1)
    private int maxDuplicateSamples = 100;
}
