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

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

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

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