dip:
  runtime:
    mode: LEGACY

# Legacy / shared application properties
# New-runtime-only properties are moved to application-new.yml.
ted:
  # Directory configuration for file processing
  input:
    # Base directory for watching incoming TED XML files
    directory: ${TED_INPUT_DIR:/ted.europe/extracted}
    # File pattern to match (recursive scanning)
    pattern: "**/*.xml"
    # Move processed files to this directory
    processed-directory: ${TED_PROCESSED_DIR:.processed}
    # Move failed files to this directory
    error-directory: ${TED_ERROR_DIR:.error}
    # Polling interval in milliseconds
    poll-interval: 5000
    # Maximum messages per poll (reduced to prevent memory issues)
    max-messages-per-poll: 10

  # Schema validation configuration
  schema:
    # Enable/disable XSD validation
    enabled: true
    # Path to eForms SDK schemas (from Maven dependency or custom location)
    path: classpath:schemas/maindoc/UBL-ContractNotice-2.3.xsd

  # Vectorization configuration
  vectorization:
    # Enable/disable async vectorization
    enabled: false
    # Use external HTTP API instead of subprocess
    use-http-api: true
    # Embedding service URL
    api-url: http://172.20.20.6:8001
    # Model name for sentence-transformers
    model-name: intfloat/multilingual-e5-large
    # Vector dimensions (must match model output)
    dimensions: 1024
    # Batch size for vectorization
    batch-size: 16
    # Thread pool size for async processing
    thread-pool-size: 4
    # Maximum text length for vectorization (characters)
    max-text-length: 8192
    # HTTP connection timeout (milliseconds)
    connect-timeout: 10000
    # HTTP socket/read timeout (milliseconds)
    socket-timeout: 60000
    # Maximum retries on connection failure
    max-retries: 5

  # Packages download configuration
  download:
    # Enable/disable automatic package download
    enabled: false
    # User service-based camel route
    use-service-based: false
    # Base URL for TED Daily Packages
    base-url: https://ted.europa.eu/packages/daily/
    # Download directory for tar.gz files
    download-directory: /ted.europe/downloads
    # Extract directory for XML files
    extract-directory: /ted.europe/extracted
    # Start year for downloads
    start-year: 2026
    # Max consecutive 404 errors before stopping
    max-consecutive-404: 4
    # Polling interval (milliseconds) - 2 minutes
    poll-interval: 120000
    # Retry interval for tail NOT_FOUND packages - 6 hours
    not-found-retry-interval: 21600000
    # Grace period after year end before a previous-year tail 404 is treated as final
    previous-year-grace-period-days: 30
    # Keep retrying current-year tail 404 packages indefinitely
    retry-current-year-not-found-indefinitely: true
    # Download timeout (milliseconds) - 5 minutes
    download-timeout: 300000
    # Max concurrent downloads
    max-concurrent-downloads: 2
    # Delay between downloads (milliseconds) for rate limiting - 5 seconds
    delay-between-downloads: 3000
    # Delete tar.gz after extraction
    delete-after-extraction: true
    # Prioritize current year first
    prioritize-current-year: false

  repair:
    # Enable one-off repair / re-import of incomplete TED packages on startup
    enabled: false
    # Only list candidate packages without modifying data
    dry-run: true
    # Safety cap for one startup run
    max-packages: 200
    # Optional explicit package identifiers to repair
    package-identifiers: []
    # Optional inclusive package range
    from-package-identifier:
    to-package-identifier:
    # Also try to fill missing sequence numbers inside the selected range
    include-missing-sequence-gaps: true
    # Download missing archives when not available locally
    redownload-missing-archives: true
    # Always refresh the archive from TED before repairing
    force-redownload: false
    # Leave false unless the automatic download scheduler is disabled
    allow-while-download-enabled: false

  # IMAP Mail configuration
  mail:
    # Enable/disable mail processing
    enabled: false
    # IMAP server hostname
    host: mail.mymagenta.business
    # IMAP server port (993 for IMAPS)
    port: 993
    # Mail account username (email address)
    username: archiv@procon.co.at
    # Mail account password
    password: ${MAIL_PASSWORD:}
    # Use SSL/TLS connection
    ssl: true
    # Mail folder to read from
    folder-name: INBOX
    # Delete messages after processing
    delete: false
    # Mark messages as seen after processing (false = peek mode, don't mark as read)
    seen: false
    # Only process unseen messages
    unseen: true
    # Polling delay in milliseconds (1 minute)
    delay: 60000
    # Max messages per poll
    max-messages-per-poll: 10
    # Output directory for processed attachments
    attachment-output-directory: /ted.europe/mail-attachments
    # Enable/disable MIME file input processing
    mime-input-enabled: true
    # Input directory for MIME files (.eml)
    mime-input-directory: /ted.europe/mime-input
    # File pattern for MIME files (regex)
    mime-input-pattern: .*\\.eml
    # Polling interval for MIME input directory (milliseconds)
    mime-input-poll-interval: 1000000

  # solution brief processing
  solution-brief:
    # Enable/disable Solution Brief processing
    enabled: false
    # Input directory for Solution Brief PDF files
    input-directory: C:/work/SolutionBrief
    # Output directory for Excel result files (relative to input or absolute)
    result-directory: ./result
    # Number of top similar documents to include
    top-k: 20
    # Minimum similarity threshold (0.0-1.0)
    similarity-threshold: 0.5
    # Polling interval in milliseconds (30 seconds)
    poll-interval: 30000
    # File pattern for PDF files (regex)
    file-pattern: .*\\.pdf
    # Process files only once (idempotent)
    idempotent: true
    # Idempotent repository file path
    idempotent-repository: ./solution-brief-processed.dat

  # Data cleanup configuration
  cleanup:
    # Enable automatic cleanup of old documents
    enabled: false
    # Retention period in years (default: 10)
    retention-years: 10
    # Cron expression for cleanup schedule (default: daily at 2 AM)
    cron: "0 0 2 * * *"

# Legacy runtime uses the existing ted.* property tree.
# Move old route/download/mail/vectorization/search settings here over time.
legacy:
  ted:
    vectorization:
      enabled: false
      use-http-api: false
      api-url: http://localhost:8001
      model-name: intfloat/multilingual-e5-large
      dimensions: 1024
      batch-size: 16
      thread-pool-size: 4
      max-text-length: 8192
      connect-timeout: 10000
      socket-timeout: 60000
      max-retries: 5
      generic-pipeline-enabled: true
      dual-write-legacy-ted-vectors: true
      generic-scheduler-period-ms: 6000
      primary-representation-builder-key: ted-phase2-primary-representation
      embedding-provider: http-embedding-service
