package org.ros.chatto.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import lombok.Getter;

@Component
@EnableConfigurationProperties
@PropertySource(value = "classpath:queries.properties")
@Getter
public class DBInitializerConfig {

    private final String dbName;

    private final String numTablesQuery;

    private final String resetSessionsQuery;

    private final String clearTokensQuery;

    public DBInitializerConfig(@Value("${chatto.datasource.database-name}") String dbName,
            @Value("${num-tables}") String numTablesQuery, @Value("${reset-sessions}") String resetSessionsQuery,
            @Value("${clear-tokens}") String clearTokensQuery) {
        this.dbName = dbName;
        this.numTablesQuery = numTablesQuery;
        this.resetSessionsQuery = resetSessionsQuery;
        this.clearTokensQuery = clearTokensQuery;
    }

}