[feature] add new mock client

This commit is contained in:
m.zare
2026-04-16 19:47:19 +03:30
parent 77ca6c34a3
commit cbd5ba232a
5 changed files with 39 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
package mail
import (
"github.com/rs/zerolog"
"base/pkg/email"
)
type client struct {
logger zerolog.Logger
}
func New(logger zerolog.Logger) email.Email {
return &client{logger: logger}
}

16
internal/pkg/mail/mail.go Normal file
View File

@@ -0,0 +1,16 @@
package mail
import (
"context"
"github.com/google/uuid"
"base/pkg/email"
)
func (c client) Send(ctx context.Context, params email.Request) (*email.Response, error) {
return &email.Response{
ID: uuid.NewString(),
Status: "Success",
}, nil
}

View File

@@ -3,18 +3,18 @@ package pkg
import (
"go.uber.org/fx"
"github.com/rs/zerolog"
"gorm.io/gorm"
"base/internal/dto"
"base/internal/pkg/azure/azbus"
"base/internal/pkg/azure/communication"
"base/internal/pkg/database"
"base/internal/pkg/logger"
"base/internal/pkg/mail"
"base/internal/pkg/oauth"
"base/pkg/cache"
"base/pkg/metrics"
"base/pkg/store"
"github.com/rs/zerolog"
"gorm.io/gorm"
)
func NewLandingCache(db *gorm.DB, lg zerolog.Logger, m *metrics.Metrics) cache.Cache[dto.Landing] {
@@ -26,7 +26,7 @@ var Module = fx.Module(
fx.Provide(
logger.New,
database.NewRWDatabaseConnection,
communication.New,
mail.New,
oauth.New,
azbus.New,
fx.Annotate(store.NewPostgresStore[string], fx.ResultTags(`name:"verification_store"`)),