using Domain.Entities;
using System.Net.Http.Json;

namespace phronCare.UIBlazor.Services.Sales
{
    public class TaxConditionService
    {
        private readonly HttpClient _httpClient;

        public TaxConditionService(HttpClient httpClient)
        {
            _httpClient = httpClient;
        }

        public async Task<List<ETaxCondition>> GetAllAsync()
        {
            var result = await _httpClient.GetFromJsonAsync<List<ETaxCondition>>("/api/TaxCondition/GetAll");
            return result ?? new List<ETaxCondition>();
        }
    }
}
