prueba tecnica

This commit is contained in:
Alejandro
2025-06-15 18:29:25 +02:00
parent 9758ee0bc6
commit d97e55a83f
127 changed files with 6488 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
using AutoMapper;
using ProximaContracts.Domain.Rates.DTOs.Responses;
using ProximaContracts.Infrastructure.Rpositories.Rates;
using ProximaContracts.Shared.Exceptions.Repositories.Rates;
namespace ProximaContracts.Application.Rates.Services
{
public class RateService(IRateRepository repository, IMapper mapper) : IRateService
{
private readonly IRateRepository _repository = repository;
private readonly IMapper _mapper = mapper;
public async Task<bool> CheckIfExists(int id)
{
return await _repository.CheckIfExists(id);
}
public async Task<IEnumerable<GetAllRatesDto>> GetRates()
{
var response = await _repository.GetRates();
if (!response.Any())
{
throw new GetAllRates404Exception("No Rates found");
}
return _mapper.Map<List<GetAllRatesDto>>(response);
}
}
}