package dto

import "time"

// EmailTemplateDTO represents an email template for API responses
type EmailTemplateDTO struct {
	ID        string    `json:"id"`
	Slug      string    `json:"slug"`
	Subject   string    `json:"subject"`
	BodyHTML  string    `json:"body_html"`
	Variables []string  `json:"variables"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

// CreateEmailTemplateRequest for creating new templates
type CreateEmailTemplateRequest struct {
	Slug      string   `json:"slug"`
	Subject   string   `json:"subject"`
	BodyHTML  string   `json:"body_html"`
	Variables []string `json:"variables"`
}

// UpdateEmailTemplateRequest for updating existing templates
type UpdateEmailTemplateRequest struct {
	Subject   *string   `json:"subject,omitempty"`
	BodyHTML  *string   `json:"body_html,omitempty"`
	Variables *[]string `json:"variables,omitempty"`
}

// EmailSettingsDTO represents email settings for API responses
type EmailSettingsDTO struct {
	ID          string    `json:"id"`
	Provider    string    `json:"provider"`
	SMTPHost    *string   `json:"smtp_host,omitempty"`
	SMTPPort    *int      `json:"smtp_port,omitempty"`
	SMTPUser    *string   `json:"smtp_user,omitempty"`
	SMTPPass    *string   `json:"smtp_pass,omitempty"` // Should be masked in responses
	SMTPSecure  bool      `json:"smtp_secure"`
	SenderName  string    `json:"sender_name"`
	SenderEmail string    `json:"sender_email"`
	AMQPURL     *string   `json:"amqp_url,omitempty"` // LavinMQ connection
	IsActive    bool      `json:"is_active"`
	UpdatedAt   time.Time `json:"updated_at"`
}

// UpdateEmailSettingsRequest for updating email settings
type UpdateEmailSettingsRequest struct {
	Provider    *string `json:"provider,omitempty"`
	SMTPHost    *string `json:"smtp_host,omitempty"`
	SMTPPort    *int    `json:"smtp_port,omitempty"`
	SMTPUser    *string `json:"smtp_user,omitempty"`
	SMTPPass    *string `json:"smtp_pass,omitempty"`
	SMTPSecure  *bool   `json:"smtp_secure,omitempty"`
	SenderName  *string `json:"sender_name,omitempty"`
	SenderEmail *string `json:"sender_email,omitempty"`
	AMQPURL     *string `json:"amqp_url,omitempty"`
}
