using SumaTube.Domain.Entities.UserPlan;
using SumaTube.Infra.Contracts.Repositories.UserPlan;
using SumaTube.Infra.MongoDB.Mappers.UserPlan;

namespace SumaTube.Application.UserPlan.ApplicationServices
{
    public class PersonUserAppService
    {
        private readonly IPersonUserRepository _personUserRepository;

        public PersonUserAppService(IPersonUserRepository personUserRepository)
        {
            _personUserRepository = personUserRepository;
        }

        public async Task<PersonUser> GetPersonUserByEmailAsync(string email)
        {
            var document = await _personUserRepository.GetByEmailAsync(email);

            return document.ToDomain();
        }
    }
}
