package com.sn.sowsysrestapi.core.email;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

@Validated
@Getter
@Setter
@Component
@ConfigurationProperties("sowapp.email")
public class EmailProperties {

    @NotNull
    private String sender;

    private Sandbox sandbox = new Sandbox();

    // FAKE is set as default
    // This avoids the problem of actually sending emails in case you forget to set the property
    private Implementation impl = Implementation.FAKE;

    public enum Implementation {
        SMTP, FAKE, SANDBOX
    }

    @Getter
    @Setter
    public class Sandbox {

        private String recipient;

    }

}
