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

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

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

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