package de.gecheckt.pdf.umbenenner.application.config.startup;

import java.nio.file.Path;

import de.gecheckt.pdf.umbenenner.application.config.provider.MultiProviderConfiguration;

/**
 * Typed immutable configuration model for PDF Umbenenner startup parameters.
 * <p>
 * Contains all technical infrastructure and runtime configuration parameters
 * loaded and validated at bootstrap time. This is a complete configuration model
 * for the entire application startup, including paths, AI provider selection, persistence,
 * and operational parameters.
 *
 * <h2>AI provider configuration</h2>
 * <p>
 * The {@link MultiProviderConfiguration} encapsulates the active provider selection
 * together with the per-provider connection parameters for all supported provider families.
 * Exactly one provider family is active per run; the selection is driven by the
 * {@code ai.provider.active} configuration property.
 *
 * <h2>Maximum base title length ({@code max.title.length})</h2>
 * <p>
 * The integer property {@code max.title.length} controls the maximum permitted length of
 * the base title (title portion without the date prefix and without any duplicate-avoidance
 * suffix). The value is supplied to the prompt that is sent to the AI, is enforced when the
 * AI response is validated, and is enforced again defensively when the target filename is
 * built from a persisted naming proposal. Valid values are integers in the range
 * {@code [10, 120]}. When the property is missing or blank, a default of {@code 60} is
 * used for backward compatibility with existing configurations.
 *
 * <h2>AI content sensitivity ({@code log.ai.sensitive})</h2>
 * <p>
 * The boolean property {@code log.ai.sensitive} controls whether sensitive AI-generated
 * content (complete raw AI response, complete AI {@code reasoning}) may be written to
 * log files. The default is {@code false} (safe/protect). Set to {@code true} only when
 * explicit diagnostic logging of AI content is required.
 * <p>
 * Sensitive AI content is always persisted in SQLite regardless of this setting.
 * Only log output is affected.
 */
public record StartConfiguration(
        Path sourceFolder,
        Path targetFolder,
        Path sqliteFile,
        MultiProviderConfiguration multiProviderConfiguration,
        int maxRetriesTransient,
        int maxPages,
        int maxTextCharacters,
        int maxTitleLength,
        Path promptTemplateFile,
        Path runtimeLockFile,
        Path logDirectory,
        String logLevel,

        /**
         * Whether sensitive AI content (raw response, reasoning) may be written to log files.
         * Corresponds to the {@code log.ai.sensitive} configuration property.
         * Default: {@code false} (do not log sensitive content).
         */
        boolean logAiSensitive
)
{ }
