package initialize

import (
	"context"
	"gitea.pena/SQuiz/common/dal"
	"gitea.pena/SQuiz/core/internal/clients/auth"
)

type Clients struct {
	AuthClient auth.IAuthClient
	//TgClient   *telegram.TelegramClient
}

func NewClients(ctx context.Context, cfg Config, pgDAL *dal.DAL) (*Clients, error) {
	//tgClient, err := telegram.NewTelegramClient(ctx, pgDAL)
	//if err != nil {
	//	return nil, err
	//}

	var authClient auth.IAuthClient
	if cfg.IsTest {
		authClient = &auth.MockAuthClient{}
	} else {
		authClient = auth.NewAuthClient(cfg.AuthMicroserviceURL)
	}

	return &Clients{
		//TgClient:   tgClient,
		AuthClient: authClient,
	}, nil
}
