package at.procon.dip.migration.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

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

    /** Enable the TED legacy -> DOC/projection backfill subsystem. */
    private boolean enabled = false;

    /** Run the backfill automatically on application startup in NEW runtime. */
    private boolean startupEnabled = false;

    /** Number of legacy TED documents to process per fetch batch. */
    private int batchSize = 100;

    /**
     * Optional cap for a single run. 0 or negative means unlimited until the full legacy set is backfilled.
     * Useful to migrate incrementally in controlled slices.
     */
    private long maxDocumentsPerRun = 0;

    /** Resume the latest STOPPED/FAILED run from its persisted cursor. */
    private boolean resumeLatestIncompleteRun = true;

    /** Import batch id written to DOC.doc_source rows created by the migration. */
    private String importBatchId = "legacy-ted-backfill";

    /** Queue fresh embeddings for migrated TED representations after the DOC/projection backfill. */
    private boolean queueEmbeddings = false;

    /** Migrate existing legacy TED content vectors into DOC.doc_embedding for the primary representation. */
    private boolean migrateEmbeddings = false;

    /** Build CHUNK representations during migration. Disable for a faster structural-only backfill. */
    private boolean buildChunkRepresentations = true;
}

