package integration

import (
	"gitea.pena/PenaSide/customer/internal/interface/client"
	"gitea.pena/PenaSide/customer/internal/models"
	"github.com/gofiber/fiber/v2"
	"github.com/stretchr/testify/assert"
	"go.uber.org/zap"
	"testing"
)

func TestSendMessage(t *testing.T) {
	sender := "noreply@mailing.pena.digital"
	apiKey := "P0YsjUB137upXrr1NiJefHmXVKW1hmBWlpev"

	mailClient := client.NewMailClient(models.MailClientCfg{
		ApiURL:      "https://api.smtp.bz/v1/smtp/send",
		Sender:      sender,
		ApiKey:      apiKey,
		FiberClient: fiber.AcquireClient(),
		MailAddress: "pashamullin2001@gmail.com",
	}, zap.NewExample())

	userEmail := "test@example.com"
	verification := &models.Verification{
		UserID: "test",
		Files: []models.VerificationFile{
			{Name: "file1", URL: "http://test/file1"},
			{Name: "file2", URL: "http://test/file2"},
		},
	}

	err := mailClient.SendMessage(userEmail, verification, 10)
	assert.NoError(t, err, "successful")
}
