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 CheckIfExists(int id) { return await _repository.CheckIfExists(id); } public async Task> GetRates() { var response = await _repository.GetRates(); if (!response.Any()) { throw new GetAllRates404Exception("No Rates found"); } return _mapper.Map>(response); } } }