package ru.nbch.indicsearchservice.config.settings;

import java.io.File;
import java.nio.file.Path;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "app")
public class ApplicationSettings {
    @NestedConfigurationProperty
    private DataSourceSettings dataSource;

    private DataSourceSettings indicDataSource = new DataSourceSettings();

    private File storageDirectory = Path.of("/opt/app/indic-search-service-storage").toAbsolutePath().toFile();

    public DataSourceSettings getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSourceSettings dataSource) {
        this.dataSource = dataSource;
    }

    public DataSourceSettings getIndicDataSource() {
        return indicDataSource;
    }

    public void setIndicDataSource(DataSourceSettings indicDataSource) {
        this.indicDataSource = indicDataSource;
    }

    public File getStorageDirectory() {
        return storageDirectory;
    }

    public void setStorageDirectory(File storageDirectory) {
        this.storageDirectory = storageDirectory;
    }
}
