package com.iqser.red.service.persistence.service.v1.api.shared.model;

import java.util.Optional;
import java.util.Set;

import io.swagger.v3.oas.annotations.media.Schema;

public record ReanalysisSettings(
        @Schema(description = "Provide a list of dossierIds to filter for. If the list is empty, every dossier is selected for reanalysis.", defaultValue = "[]") Set<String> dossierIds,
        @Schema(description = "Provide a list of fileIds to filter for. If the list is empty, every file is selected for reanalysis.", defaultValue = "[]") Set<String> fileIds,
        @Schema(description = "If set to true, layout parsing and named entity recognition will be repeated.", defaultValue = "false") boolean repeatStructureAnalysis,
        @Schema(description = "If set to true, ocr will be repeated and therefore also layout parsing and named entity recognition.", defaultValue = "false") boolean runOcr,
        @Schema(description = "Use this to create a filter for files to reanalyse. Matches anything if set to null.", defaultValue = "{}") FileStatusFilter fileStatusFilter
) {

    public FileStatusFilter fileStatusFilter() {

        return Optional.ofNullable(fileStatusFilter)
                .orElse(new FileStatusFilter());
    }

}
