package admin

import (
	"context"
	"github.com/go-nunu/nunu-layout-advanced/internal/model"
	"github.com/go-nunu/nunu-layout-advanced/internal/repository/admin"
	"github.com/go-nunu/nunu-layout-advanced/internal/service"
)

type UserService interface {
	GetUser(ctx context.Context, id int64) (*model.User, error)
}

func NewUserService(
	service *service.Service,
	userRepository admin.UserRepository,
) UserService {
	return &userService{
		Service:        service,
		userRepository: userRepository,
	}
}

type userService struct {
	*service.Service
	userRepository admin.UserRepository
}

func (s *userService) GetUser(ctx context.Context, id int64) (*model.User, error) {
	return s.userRepository.GetUser(ctx, id)
}