using System.Net.Http; using System.Net.Http.Json; using System.Threading.Tasks; using TIAMWebApp.Shared.Application.Models; using TIAMWebApp.Shared.Application.Models.ClientSide; namespace TIAMWebApp.Shared.Application.Services { public class SmartyStreetsService { private readonly HttpClient _httpClient; public SmartyStreetsService(HttpClient httpClient) { _httpClient = httpClient; } public async Task ValidateAddressAsync(string address) { var url = $"{Setting.ApiBaseUrl}/{APIUrls.SmartyValidateAddress}"; return await _httpClient.GetFromJsonAsync(url); } public async Task SetExchangeRateAsync(ExchangeRate rate) { var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateExchangeRate}"; await _httpClient.PostAsJsonAsync(url, rate); } } }