package net.siegeln.cameleer.saas.certificate;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class CertificateStartupListener {

    private final CertificateService certificateService;

    public CertificateStartupListener(CertificateService certificateService) {
        this.certificateService = certificateService;
    }

    @EventListener(ApplicationReadyEvent.class)
    public void onReady() {
        certificateService.seedFromFilesystem();
    }
}
