package user

import (
	"Yimaru-Backend/internal/config"
	"Yimaru-Backend/internal/ports"
	"Yimaru-Backend/internal/services/messenger"
	"time"
)

const (
	OtpExpiry = 5 * time.Minute
)

type Service struct {
	tokenStore   ports.TokenStore
	userStore    ports.UserStore
	otpStore     ports.OtpStore
	messengerSvc *messenger.Service
	config       *config.Config
}

func NewService(
	tokenStore ports.TokenStore,
	userStore ports.UserStore,
	otpStore ports.OtpStore,
	messengerSvc *messenger.Service,
	cfg *config.Config,
) *Service {
	return &Service{
		tokenStore:   tokenStore,
		userStore:    userStore,
		otpStore:     otpStore,
		messengerSvc: messengerSvc,
		config:       cfg,
	}
}
