package ru.shine.promo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import ru.shine.promo.config.AppProperties;

@SpringBootApplication
public class ShinePromoSolanaDevnetApplication {

    private static final Logger log = LoggerFactory.getLogger(ShinePromoSolanaDevnetApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ShinePromoSolanaDevnetApplication.class, args);
    }

    @Bean
    CommandLineRunner startupLogger(AppProperties appProperties) {
        return args -> log.info(
                "SHiNE promo app started. RPC: {}, promoCodesFile: {}, usedFile: {}, transferAmountSol: {}",
                appProperties.getSolanaRpcUrl(),
                appProperties.getPromoCodesFile(),
                appProperties.getPromoUsedFile(),
                appProperties.getPromoTransferAmountSol()
        );
    }
}
