package pl.polskalokalnie.mailconfig;

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

/**
 * Konfiguracja bramki SMS (SoftSPM) - pojedynczy rekord (id = 1). Klucz API trzymany w bazie,
 * nigdy zwracany w odpowiedziach API (maskowany) ani logowany.
 */
@Entity
@Table(name = "sms_gateway_config")
public class SmsGatewayConfig {

    @Id
    private Long id = 1L;

    @Column(length = 400)
    private String endpointUrl;

    @Column(length = 400)
    private String apiKey;

    // Pole "creator" bramki - znacznik zrodla wiadomosci, max 50 znakow.
    @Column(length = 50)
    private String creator;

    private Integer timeoutSeconds = 10;

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

    public Long getId() {
        return id;
    }

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

    public String getEndpointUrl() {
        return endpointUrl;
    }

    public void setEndpointUrl(String endpointUrl) {
        this.endpointUrl = endpointUrl;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Integer getTimeoutSeconds() {
        return timeoutSeconds;
    }

    public void setTimeoutSeconds(Integer timeoutSeconds) {
        this.timeoutSeconds = timeoutSeconds;
    }

    public boolean isEnabled() {
        return enabled;
    }

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