package ru.nbch.credit_tracker;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import ru.nbch.credit_tracker.service.MonitoringService;
import ru.nbch.credit_tracker.service.UpdateProcessingPackagesService;
import ru.nbch.credit_tracker.service.UpdatingFlagsService;

@SpringBootApplication
public class CreditTrackerApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext ctx = SpringApplication.run(CreditTrackerApplication.class, args);
		UpdateProcessingPackagesService updateProcessingPackagesService = ctx.getBean(UpdateProcessingPackagesService.class);
		MonitoringService monitoringService = ctx.getBean(MonitoringService.class);
		UpdatingFlagsService updatingFlagsService = ctx.getBean(UpdatingFlagsService.class);
		updateProcessingPackagesService.run();
		monitoringService.run();
		updatingFlagsService.run();
	}

}
