Files
FA_WEB/OrdersManagement/Services/WarehouseService.cs
Piotr Kus da1eae8ca9 * Added new Controllers to API
* Added methods to get WZs for specific client
2025-05-08 20:44:20 +02:00

21 lines
748 B
C#

using SytelineSaAppEfDataModel.Dtos;
namespace OrdersManagement.Services;
public class WarehouseService
{
private readonly HttpClient _httpClient;
public WarehouseService(IHttpClientFactory httpClientFactory)
{
_httpClient = httpClientFactory.CreateClient("FaKrosnoApi");
}
public async Task<IEnumerable<MaterialTransactionDto>> GetAllClientWzsAsync(string customerNumber, int customerSequence)
{
var response = await _httpClient.GetAsync(
$"api/WzHeader/by-customer-number?customerNumber={customerNumber}&customerSequence={customerSequence}");
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<IEnumerable<MaterialTransactionDto>>();
}
}