package pl.polskalokalnie.mailconfig;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

/**
 * Konfiguracja konta e-mail (SMTP) - pojedynczy rekord (id = 1). Haslo trzymane w bazie, nigdy
 * zwracane w odpowiedziach API (maskowane) ani logowane.
 */
@Entity
@Table(name = "smtp_config")
public class SmtpConfig {

    @Id
    private Long id = 1L;

    @Column(length = 200)
    private String host;

    private Integer port;

    @Column(nullable = false)
    private boolean sslEnabled = true;

    // Login SMTP = adres nadawcy.
    @Column(length = 200)
    private String username;

    @Column(length = 160)
    private String fromName;

    @Column(length = 400)
    private String password;

    @Column(length = 200)
    private String contactFormRecipient;

    @Column(nullable = false)
    private boolean enabled = false;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public boolean isSslEnabled() {
        return sslEnabled;
    }

    public void setSslEnabled(boolean sslEnabled) {
        this.sslEnabled = sslEnabled;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getFromName() {
        return fromName;
    }

    public void setFromName(String fromName) {
        this.fromName = fromName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getContactFormRecipient() {
        return contactFormRecipient;
    }

    public void setContactFormRecipient(String contactFormRecipient) {
        this.contactFormRecipient = contactFormRecipient;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
}
