package at.procon.dip.domain.time.config;

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

@Configuration
@ConfigurationProperties(prefix = "dip.time")
@Data
public class TimeDomainProperties {

    private boolean enabled = false;
    private LeitstandProperties leitstand = new LeitstandProperties();
    private SourceProperties togglTrack = new SourceProperties();

    @Data
    public static class SourceProperties {
        private boolean enabled = false;
        private String importBatchId;
        private int reconcileLookbackDays = 7;
    }

    @Data
    public static class LeitstandProperties extends SourceProperties {
        private boolean startupSyncEnabled = false;
        private boolean createCanonicalTimeEntries = true;
        private boolean incrementalEnabled = true;
        private boolean buildSearchProjection = true;
        private boolean buildRepresentations = true;
        private boolean queueEmbeddings = true;
        private boolean startupProjectionRebuildEnabled = false;
        private boolean startupSelectiveMaterializationEnabled = false;
        private String selectiveMaterializationPersonDbk;
        private Integer selectiveMaterializationPersonNumber;
        private boolean selectiveMaterializationBuildProjection = true;
        private String representationLanguageCode = "de";
        private String scopeKey = "leitstand-default";
        private JdbcProperties jdbc = new JdbcProperties();
    }

    @Data
    public static class JdbcProperties {
        private String url;
        private String username;
        private String password;
        private String driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        private int fetchSize = 500;
        private int queryTimeoutSeconds = 300;
    }
}
