From be52137c15f1f048bc9bc8d925f38354e3da9035 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Thu, 12 Jan 2023 18:09:18 +0100 Subject: [PATCH] WIP - admin office front end --- .../InfoColorCustomerComponent.razor.css | 6 ++- .../InfoColorPackageComponent.razor.css | 6 ++- .../IAdvisorCustomerHistoryRepository.cs | 2 +- .../ICountryCustomerHistoryRepository.cs | 2 +- .../AdvisorCustomerHistoryRepository.cs | 4 +- .../CountryCustomerHistoryRepository.cs | 4 +- .../Pages/AdvisorCreateActivityPage.razor.cs | 2 +- .../Pages/AdvisorCustomerViewPage.razor.cs | 2 +- .../Pages/CountryCreateNewOrderPage.razor.cs | 2 +- Wonky.Client/wwwroot/appsettings.json | 6 ++- Wonky.Entity/Configuration/ApiConfig.cs | 50 +++++++++++-------- 11 files changed, 51 insertions(+), 35 deletions(-) diff --git a/Wonky.Client/Components/InfoColorCustomerComponent.razor.css b/Wonky.Client/Components/InfoColorCustomerComponent.razor.css index 002017f5..d28e2116 100644 --- a/Wonky.Client/Components/InfoColorCustomerComponent.razor.css +++ b/Wonky.Client/Components/InfoColorCustomerComponent.razor.css @@ -1,4 +1,6 @@ - +.pictogram { + max-width: 30px; +} .color-code { - max-width: 40px; + max-width: 30px; } \ No newline at end of file diff --git a/Wonky.Client/Components/InfoColorPackageComponent.razor.css b/Wonky.Client/Components/InfoColorPackageComponent.razor.css index 002017f5..d28e2116 100644 --- a/Wonky.Client/Components/InfoColorPackageComponent.razor.css +++ b/Wonky.Client/Components/InfoColorPackageComponent.razor.css @@ -1,4 +1,6 @@ - +.pictogram { + max-width: 30px; +} .color-code { - max-width: 40px; + max-width: 30px; } \ No newline at end of file diff --git a/Wonky.Client/HttpInterfaces/IAdvisorCustomerHistoryRepository.cs b/Wonky.Client/HttpInterfaces/IAdvisorCustomerHistoryRepository.cs index b02c3ae5..8233c00d 100644 --- a/Wonky.Client/HttpInterfaces/IAdvisorCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpInterfaces/IAdvisorCustomerHistoryRepository.cs @@ -66,5 +66,5 @@ public interface IAdvisorCustomerHistoryRepository /// /// /// - Task ErpInvoiceToCrmRpc(string companyId, string syncDate); + Task InvoiceErpToCrmRpc(string companyId, string syncDate); } \ No newline at end of file diff --git a/Wonky.Client/HttpInterfaces/ICountryCustomerHistoryRepository.cs b/Wonky.Client/HttpInterfaces/ICountryCustomerHistoryRepository.cs index f6cc466d..1fa695b4 100644 --- a/Wonky.Client/HttpInterfaces/ICountryCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpInterfaces/ICountryCustomerHistoryRepository.cs @@ -66,5 +66,5 @@ public interface ICountryCustomerHistoryRepository /// /// /// - Task ErpInvoiceToCrmRpc(string countryCode, string companyId, string syncDate); + Task InvoiceErpToCrmRpc(string countryCode, string companyId, string syncDate); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/AdvisorCustomerHistoryRepository.cs b/Wonky.Client/HttpRepository/AdvisorCustomerHistoryRepository.cs index 3024b837..fc292b80 100644 --- a/Wonky.Client/HttpRepository/AdvisorCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpRepository/AdvisorCustomerHistoryRepository.cs @@ -128,9 +128,9 @@ public class AdvisorCustomerHistoryRepository : IAdvisorCustomerHistoryRepositor /// /// /// - public async Task ErpInvoiceToCrmRpc(string companyId, string syncDate) + public async Task InvoiceErpToCrmRpc(string companyId, string syncDate) { - var x = await _client.GetAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}"); + var x = await _client.GetAsync($"{_api.SyncRpc}/companies/{companyId}/{_api.SyncRpcInvoiceExt}/{syncDate}"); if (!x.IsSuccessStatusCode) return string.Empty; var content = await x.Content.ReadAsStringAsync(); diff --git a/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs b/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs index 93e9aa77..5b3a9e54 100644 --- a/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs @@ -134,9 +134,9 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor /// /// /// - public async Task ErpInvoiceToCrmRpc(string countryCode, string companyId, string syncDate) + public async Task InvoiceErpToCrmRpc(string countryCode, string companyId, string syncDate) { - var x = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}"); + var x = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.SyncRpcInvoiceExt}/{syncDate}"); if (!x.IsSuccessStatusCode) return string.Empty; var content = await x.Content.ReadAsStringAsync(); diff --git a/Wonky.Client/Pages/AdvisorCreateActivityPage.razor.cs b/Wonky.Client/Pages/AdvisorCreateActivityPage.razor.cs index e8a016c8..8ffd4d04 100644 --- a/Wonky.Client/Pages/AdvisorCreateActivityPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCreateActivityPage.razor.cs @@ -182,7 +182,7 @@ public partial class AdvisorCreateActivityPage : IDisposable // product inventory has not been updated // send rpc call to sync ERP to CRM Toast.ShowInfo("Vent mens data synkroniseres ...", "ERP til CRM ..."); - var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, _company.HistorySync); + var ts = await HistoryRepo.InvoiceErpToCrmRpc(CompanyId, _company.HistorySync); while (string.IsNullOrWhiteSpace(ts)) await Task.Delay(500); // save pDate diff --git a/Wonky.Client/Pages/AdvisorCustomerViewPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewPage.razor.cs index 87ee73fc..00cab0be 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerViewPage.razor.cs @@ -139,7 +139,7 @@ public partial class AdvisorCustomerViewPage : IDisposable await FetchContacts(CompanyId); - var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync); + var ts = await HistoryRepo.InvoiceErpToCrmRpc(CompanyId, Company.HistorySync); // remove loading image Working = false; diff --git a/Wonky.Client/Pages/CountryCreateNewOrderPage.razor.cs b/Wonky.Client/Pages/CountryCreateNewOrderPage.razor.cs index 028a50e6..ba4edabd 100644 --- a/Wonky.Client/Pages/CountryCreateNewOrderPage.razor.cs +++ b/Wonky.Client/Pages/CountryCreateNewOrderPage.razor.cs @@ -70,7 +70,7 @@ public partial class CountryCreateNewOrderPage : IDisposable var today = $"{DateTime.Now:yyyy-MM-dd}"; var ts = _company.HistorySync; if (ts != today) - ts = await InventoryRepo.ErpInvoiceToCrmRpc(CountryCode, CompanyId, ts); + ts = await InventoryRepo.InvoiceErpToCrmRpc(CountryCode, CompanyId, ts); while (ts != today) await Task.Delay(500); // raise flag if report is closed diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index fba26895..4a8f02b8 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -7,16 +7,16 @@ "image": "grumpy-coder.png" }, "apiConfig": { - "baseUrl": "https://zeta.innotec.dk", + "baseUrl": "https://eta.innotec.dk", "catalog": "api/v2/catalog", "crmCustomers": "api/v2/crm/companies", "crmInventoryExt": "history/inventory", "crmProductExt": "history/products", "crmReports": "api/v2/crm/advisors/reports", "crmActivities": "api/v2/crm/advisors/activities", - "crmRpcSyncExt": "invoices/rpc", "crmTasks": "api/v2/crm/advisors/tasks", "crmWorkplaceExt": "workplaces", + "officeBase": "api/v2/office", "officeAdvisors": "api/v2/office/users/advisors", "officeCustomers": "api/v2/office/customers", "officeReports": "api/v2/office/reports", @@ -29,6 +29,8 @@ "serviceVatEu": "api/v2/services/vies", "servicesVatNo": "api/v2/services/brReg", "servicesAuth": "token", + "syncRpc": "api/v2/rpc", + "syncRpcInvoiceExt": "invoices/rpc", "userInfo": "api/auth/userinfo", "warehouse": "api/v2/warehouse/packages" }, diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs index ad07c6f0..a6c20ae9 100644 --- a/Wonky.Entity/Configuration/ApiConfig.cs +++ b/Wonky.Entity/Configuration/ApiConfig.cs @@ -12,6 +12,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] // + namespace Wonky.Entity.Configuration; public class ApiConfig @@ -20,7 +21,7 @@ public class ApiConfig /// Application base url /// public string BaseUrl { get; set; } = ""; - + /// /// Application uri for product catalog request /// @@ -45,37 +46,37 @@ public class ApiConfig /// Application uri for customer information request /// public string CrmCustomers { get; set; } = ""; - + /// /// Application uri for customer product inventory request /// public string CrmInventoryExt { get; set; } = ""; - + /// /// Application uri for customer product sale request /// public string CrmProductExt { get; set; } = ""; - - /// - /// Application uri for updating customer product sale request - /// - public string CrmRpcSyncExt { get; set; } = ""; /// /// Application uri for getting workplace(s) /// public string CrmWorkplaceExt { get; set; } = ""; - + + /// + /// Office base url + /// + public string OfficeBase { get; set; } = ""; + /// /// Application uri for administration of sales representatives /// public string OfficeAdvisors { get; set; } = ""; - + /// /// Application uri for administration of administrative users /// public string OfficeUsers { get; set; } = ""; - + /// /// Application uri for administrative reset of user credentials /// @@ -95,45 +96,54 @@ public class ApiConfig /// Application uri for token request /// public string ServicesAuth { get; set; } = ""; - + /// /// GLS tracking url /// public string ServicesGlsTrackUrl { get; set; } = ""; - + /// /// GLS customer entity /// public string ServicesGlsId { get; set; } = ""; - + /// /// url for sending mail message /// public string ServicesMail { get; set; } = ""; - + /// /// VAT registrar url Denmark /// public string ServicesVatDk { get; set; } = ""; - + /// /// VAT registrar url Norway /// public string ServicesVatNo { get; set; } = ""; - + /// /// VAT registrar url EU /// public string ServicesVatEu { get; set; } = ""; - + + /// + /// Base sync url + /// + public string SyncRpc { get; set; } = ""; + + /// + /// Application uri for updating customer product sale request + /// + public string SyncRpcInvoiceExt { get; set; } = ""; + /// /// Application uri for user information request /// public string UserInfo { get; set; } = ""; - + /// /// Uri for warehouse requests /// public string Warehouse { get; set; } = ""; - } \ No newline at end of file