package services

import (
	"context"
	"git.sch9.ru/new_gate/ms-tester/internal/models"
)

type UserStorage interface {
	CreateUser(ctx context.Context, user *models.User) error
	ReadUserById(ctx context.Context, userId int32) (*models.User, error)
}

type UserService struct {
	userStorage UserStorage
}

func NewUserService(userStorage UserStorage) *UserService {
	return &UserService{
		userStorage: userStorage,
	}
}

func (s *UserService) CreateUser(ctx context.Context, user *models.User) error {
	return s.userStorage.CreateUser(ctx, user)
}

func (s *UserService) ReadUserById(ctx context.Context, userId int32) (*models.User, error) {
	return s.userStorage.ReadUserById(ctx, userId)
}
