WIP: office reorder customer products

This commit is contained in:
Frede Hundewadt 2023-02-10 17:54:03 +01:00
parent c13252da37
commit 0ac35a1f10
2 changed files with 4 additions and 4 deletions

View file

@ -91,7 +91,7 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor
/// <returns></returns> /// <returns></returns>
public async Task<List<ProductInventoryView>> FetchInventory(string countryCode, string companyId) public async Task<List<ProductInventoryView>> FetchInventory(string countryCode, string companyId)
{ {
var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.CrmInventoryExt}"); var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/history/inventory");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
return new List<ProductInventoryView>(); return new List<ProductInventoryView>();
var content = await response.Content.ReadAsStringAsync(); var content = await response.Content.ReadAsStringAsync();
@ -108,7 +108,7 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor
/// <returns></returns> /// <returns></returns>
public async Task<List<ProductHistoryView>> FetchHistory(string countryCode, string companyId) public async Task<List<ProductHistoryView>> FetchHistory(string countryCode, string companyId)
{ {
var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.CrmProductExt}"); var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/history/products");
if (!response.IsSuccessStatusCode) return new List<ProductHistoryView>(); if (!response.IsSuccessStatusCode) return new List<ProductHistoryView>();
@ -127,7 +127,7 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor
/// <returns></returns> /// <returns></returns>
public async Task<List<ProductHistoryView>> FetchHistory(string countryCode, string companyId, string sku) public async Task<List<ProductHistoryView>> FetchHistory(string countryCode, string companyId, string sku)
{ {
var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.CrmProductExt}/{sku}"); var response = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/history/products/{sku}");
if (!response.IsSuccessStatusCode) if (!response.IsSuccessStatusCode)
return new List<ProductHistoryView>(); return new List<ProductHistoryView>();
var content = await response.Content.ReadAsStringAsync(); var content = await response.Content.ReadAsStringAsync();

View file

@ -27,7 +27,7 @@ public partial class OfficeCustomerInventoryReorderOverlay
{ {
[Parameter] public string CompanyId { get; set; } = ""; [Parameter] public string CompanyId { get; set; } = "";
[Parameter] public SalesItemView SalesItem { get; set; } = new(); [Parameter] public SalesItemView SalesItem { get; set; } = new();
[Inject] private IAdvisorCustomerHistoryRepository HistoryRepo { get; set; } [Inject] public ICountryCustomerHistoryRepository HistoryRepo { get; set; }
[Parameter] public EventCallback<DraftItem> OnSelected { get; set; } [Parameter] public EventCallback<DraftItem> OnSelected { get; set; }
private List<ProductHistoryView>? History { get; set; } = new(); private List<ProductHistoryView>? History { get; set; } = new();
private DraftItem SelectedItem { get; set; } = new(); private DraftItem SelectedItem { get; set; } = new();