diff --git a/Wonky.Client.sln.DotSettings b/Wonky.Client.sln.DotSettings index 559779d8..9438812a 100644 --- a/Wonky.Client.sln.DotSettings +++ b/Wonky.Client.sln.DotSettings @@ -1,4 +1,5 @@  + True True True True diff --git a/Wonky.Client/App.razor b/Wonky.Client/App.razor index edc683e8..11ead806 100644 --- a/Wonky.Client/App.razor +++ b/Wonky.Client/App.razor @@ -27,7 +27,7 @@ Checker autorisation ... - + diff --git a/Wonky.Client/Program.cs b/Wonky.Client/Program.cs index 74c60f25..dbce13b4 100644 --- a/Wonky.Client/Program.cs +++ b/Wonky.Client/Program.cs @@ -36,12 +36,12 @@ builder.RootComponents.Add("head::after"); builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); builder.Services.AddScoped(sp => - sp.GetService().CreateClient("InnoAPI")); + sp.GetService().CreateClient("backend")); -builder.Services.AddHttpClient("InnoAPI", (sp, cl) => +builder.Services.AddHttpClient("backend", (sp, cl) => { var apiConfig = sp.GetRequiredService>(); - cl.BaseAddress = new Uri(apiConfig.Value.ApiBaseUrl); + cl.BaseAddress = new Uri(apiConfig.Value.BaseUrl); cl.DefaultRequestHeaders.CacheControl = CacheControlHeaderValue.Parse("no-cache, no-store, must-revalidate"); cl.DefaultRequestHeaders.Add("Pragma", "no-cache"); cl.EnableIntercept(sp); @@ -49,37 +49,45 @@ builder.Services.AddHttpClient("InnoAPI", (sp, cl) => builder.Services.AddBlazoredToast(); builder.Services.AddHttpClientInterceptor(); - +// api config object builder.Services.Configure(builder.Configuration.GetSection("ApiConfig")); +// app info object builder.Services.Configure(builder.Configuration.GetSection("AppInfo")); - -builder.Services.AddScoped(); - -builder.Services.AddScoped(); +// crm repositories builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); - +// administrative repositories builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); - - +// warehouse repository builder.Services.AddScoped(); +// catalog repository +builder.Services.AddScoped(); +// mail service builder.Services.AddScoped(); - +// interceptor builder.Services.AddScoped(); +// storage builder.Services.AddBlazoredLocalStorage(); +// authorization builder.Services.AddAuthorizationCore(); - +// authentication state provider builder.Services.AddScoped(); +// authentication service builder.Services.AddScoped(); +// refresh token service builder.Services.AddScoped(); +// vat registry service builder.Services.AddScoped(); +// preference service builder.Services.AddScoped(); +// activity draft service builder.Services.AddScoped(); diff --git a/Wonky.Client/Services/AuthenticationService.cs b/Wonky.Client/Services/AuthenticationService.cs index ef6e524e..b58c6032 100644 --- a/Wonky.Client/Services/AuthenticationService.cs +++ b/Wonky.Client/Services/AuthenticationService.cs @@ -56,7 +56,7 @@ namespace Wonky.Client.Services }; var response = await _client - .PostAsync(_apiConfig.Value.Token, new FormUrlEncodedContent(credForm)); + .PostAsync(_apiConfig.Value.ServicesAuth, new FormUrlEncodedContent(credForm)); var resContent = await response.Content.ReadAsStringAsync(); @@ -91,7 +91,7 @@ namespace Wonky.Client.Services ["grant_type"] = "refresh_token", ["refresh_token"] = refreshToken }; - var response = await _client.PostAsync(_apiConfig.Value.Token, new FormUrlEncodedContent(credentials)); + var response = await _client.PostAsync(_apiConfig.Value.ServicesAuth, new FormUrlEncodedContent(credentials)); if (!response.IsSuccessStatusCode) return string.Empty; diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 415b10e8..6bf41381 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,13 +1,13 @@ { "appInfo": { "name": "Wonky Client", - "version": "0.53.2", + "version": "0.60.1", "rc": true, - "sandBox": false, + "sandBox": true, "image": "grumpy-coder.png" }, "apiConfig": { - "apiBaseUrl": "https://zeta.innotec.dk", + "baseUrl": "https://dev.innotec.dk", "catalog": "api/v2/catalog", "crmCustomers": "api/v2/crm/companies", "crmInventoryExt": "history/inventory", @@ -15,7 +15,7 @@ "crmReports": "api/v2/crm/advisors/reports", "crmActivities": "api/v2/crm/advisors/activities", "crmRpcSyncExt": "invoices/sync", - "crmBaseTasks": "api/v2/crm/advisors/tasks", + "crmTasks": "api/v2/crm/advisors/tasks", "crmWorkplaceExt": "workplaces", "officeAdvisors": "api/v2/office/users/advisors", "officeCustomers": "api/v2/office/customers", @@ -28,7 +28,7 @@ "servicesVatDk": "api/v2/services/virk", "serviceVatEu": "api/v2/services/vies", "servicesVatNo": "api/v2/services/brReg", - "token": "token", + "servicesAuth": "token", "userInfo": "api/auth/userinfo", "warehouse": "api/v2/warehouse/packages" }, diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs index 68383d8c..ad07c6f0 100644 --- a/Wonky.Entity/Configuration/ApiConfig.cs +++ b/Wonky.Entity/Configuration/ApiConfig.cs @@ -19,42 +19,7 @@ public class ApiConfig /// /// Application base url /// - public string ApiBaseUrl { get; set; } = ""; - - /// - /// GLS tracking url - /// - public string ServicesGlsTrackUrl { get; set; } = ""; - - /// - /// GLS customer entity - /// - public string ServicesGlsId { 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; } = ""; - - /// - /// Application uri for token request - /// - public string Token { get; set; } = ""; - - /// - /// Application uri for user information request - /// - public string UserInfo { get; set; } = ""; + public string BaseUrl { get; set; } = ""; /// /// Application uri for product catalog request @@ -127,27 +92,48 @@ public class ApiConfig public string OfficeReports { get; set; } = ""; /// - /// Uri for warehouse requests + /// Application uri for token request /// - public string Warehouse { get; set; } = ""; - + 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; } = ""; - // /// - // /// Application uri for reading salesReports - // /// - // public string AdminReport { get; set; } = ""; - // - // /// - // /// Application uri for handling external customer login - // /// - // public string AdminCompany { get; set; } = ""; - - // public string KrvVariantsUri { get; set; } = ""; - // public string KrvProductsUri { get; set; } = ""; - // public string ImageUploadUri { get; set; } = ""; - // public string UserRegistrationUri { 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; } = ""; + + /// + /// 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