package sms

import (
	"context"

	"go.uber.org/zap"
)

type MockProvider struct {
	log *zap.Logger
}

func NewMockProvider(log *zap.Logger) *MockProvider {
	return &MockProvider{log: log}
}

func (p *MockProvider) SendLoginCode(ctx context.Context, phone string, code string) error {
	if err := ctx.Err(); err != nil {
		return err
	}
	if p.log != nil {
		p.log.Info("mock sms code generated", zap.String("phone", phone), zap.String("code", code))
	}
	return nil
}
