diff --git a/Wonky.Client/Components/ActivityTableComponent.razor b/Wonky.Client/Components/ActivityTableComponent.razor index 9535f6c8..93b7912c 100644 --- a/Wonky.Client/Components/ActivityTableComponent.razor +++ b/Wonky.Client/Components/ActivityTableComponent.razor @@ -20,7 +20,8 @@ - + + @@ -32,11 +33,11 @@ @foreach (var activity in Activities) { - + - + } diff --git a/Wonky.Client/Components/ActivityTableComponent.razor.cs b/Wonky.Client/Components/ActivityTableComponent.razor.cs index fbc5262f..897bfac2 100644 --- a/Wonky.Client/Components/ActivityTableComponent.razor.cs +++ b/Wonky.Client/Components/ActivityTableComponent.razor.cs @@ -5,5 +5,5 @@ namespace Wonky.Client.Components; public partial class ActivityTableComponent { - [Parameter] public List Activities { get; set; } + [Parameter] public List Activities { get; set; } } \ No newline at end of file diff --git a/Wonky.Client/Components/AdminReportTableComponent.razor b/Wonky.Client/Components/AdminReportTableComponent.razor index d07598c4..1a23e87d 100644 --- a/Wonky.Client/Components/AdminReportTableComponent.razor +++ b/Wonky.Client/Components/AdminReportTableComponent.razor @@ -1,4 +1,4 @@ -@if (ReportList.Any()) +@if (ReportList != null) {
@@ -65,9 +65,7 @@ } else { -
-
- Ingen data -
+
+ Ingen data
} \ No newline at end of file diff --git a/Wonky.Client/Components/AdminReportTableComponent.razor.cs b/Wonky.Client/Components/AdminReportTableComponent.razor.cs index 1ea3922d..ba7bc525 100644 --- a/Wonky.Client/Components/AdminReportTableComponent.razor.cs +++ b/Wonky.Client/Components/AdminReportTableComponent.razor.cs @@ -5,7 +5,12 @@ namespace Wonky.Client.Components; public partial class AdminReportTableComponent { - [Parameter] public List ReportList { get; set; } = new(); + [Parameter] public List ReportList { get; set; } [Parameter] public string UserId { get; set; } = ""; [Parameter] public string CountryCode { get; set; } = ""; + + protected override void OnParametersSet() + { + base.OnParametersSet(); + } } \ No newline at end of file diff --git a/Wonky.Client/Components/ItemGroupComponent.razor.cs b/Wonky.Client/Components/ItemGroupComponent.razor.cs index 9fe0f6d4..081be31b 100644 --- a/Wonky.Client/Components/ItemGroupComponent.razor.cs +++ b/Wonky.Client/Components/ItemGroupComponent.razor.cs @@ -27,7 +27,9 @@ public partial class ItemGroupComponent [Parameter] public EventCallback OnChanged { get; set; } private Dictionary Items { get; set; } = new(); private Preferences _preferences = new(); + private string? Selection { get; set; } + private async Task OnSelectionChanged(ChangeEventArgs e) { var val = e.Value.ToString(); diff --git a/Wonky.Client/Components/ItemSearchComponent.razor b/Wonky.Client/Components/ItemSearchComponent.razor index 6f87b4a8..7a974bfa 100644 --- a/Wonky.Client/Components/ItemSearchComponent.razor +++ b/Wonky.Client/Components/ItemSearchComponent.razor @@ -15,7 +15,7 @@ // *@ - diff --git a/Wonky.Client/Components/ItemSearchComponent.razor.cs b/Wonky.Client/Components/ItemSearchComponent.razor.cs index 5b64e86a..aaf38ee8 100644 --- a/Wonky.Client/Components/ItemSearchComponent.razor.cs +++ b/Wonky.Client/Components/ItemSearchComponent.razor.cs @@ -21,32 +21,63 @@ namespace Wonky.Client.Components; public partial class ItemSearchComponent : IDisposable { - [Inject] private ILocalStorageService LocalStorage { get; set; } - [Inject] private UserPreferenceService UserPreferenceService { get; set; } + /// + /// User preference service + /// + [Inject] private UserPreferenceService _preferenceService { get; set; } + + /// + /// OnChanged event callback + /// [Parameter] public EventCallback OnChanged { get; set; } - private Dictionary Items { get; set; } = new(); + + /// + /// User preferences + /// private Preferences _preferences = new(); - private string? Selection { get; set; } + + /// + /// Selected item + /// + private string _selectedItem { get; set; } = ""; + + /// + /// Component initialization + /// protected override async Task OnInitializedAsync() { - UserPreferenceService.OnChange += ProfileServiceOnOnChange; - _preferences = await UserPreferenceService.GetPreferences(); - Selection = _preferences.ItemSearch; + _preferenceService.OnChange += ProfileServiceOnOnChange; + _preferences = await _preferenceService.GetPreferences(); + _selectedItem = _preferences.ItemSearch; } + + /// + /// OnSelectChanged event handler + /// + /// private async Task OnSelectChanged(ChangeEventArgs e) { var val = e.Value.ToString(); if (val == "-1") return; await OnChanged.InvokeAsync(val); - await UserPreferenceService.SetItemSearch(val); + await _preferenceService.SetItemSearch(val); } + + /// + /// Preference update from profile service + /// + /// private void ProfileServiceOnOnChange(Preferences newPreferences) { _preferences = newPreferences; StateHasChanged(); } + + /// + /// Component dispose + /// public void Dispose() { - UserPreferenceService.OnChange -= ProfileServiceOnOnChange; + _preferenceService.OnChange -= ProfileServiceOnOnChange; } } \ No newline at end of file diff --git a/Wonky.Client/Components/ItemSortComponent.razor b/Wonky.Client/Components/ItemSortComponent.razor index e9b02d57..b72bfd83 100644 --- a/Wonky.Client/Components/ItemSortComponent.razor +++ b/Wonky.Client/Components/ItemSortComponent.razor @@ -15,7 +15,7 @@ // *@ - diff --git a/Wonky.Client/Components/ItemSortComponent.razor.cs b/Wonky.Client/Components/ItemSortComponent.razor.cs index c8d84d75..01f3654e 100644 --- a/Wonky.Client/Components/ItemSortComponent.razor.cs +++ b/Wonky.Client/Components/ItemSortComponent.razor.cs @@ -21,32 +21,63 @@ namespace Wonky.Client.Components; public partial class ItemSortComponent : IDisposable { - [Inject] private ILocalStorageService LocalStorage { get; set; } - [Inject] private UserPreferenceService UserPreferenceService { get; set; } + /// + /// User preference service + /// + [Inject] private UserPreferenceService _preferenceService { get; set; } + + /// + /// OnChanged callback function + /// [Parameter] public EventCallback OnChanged { get; set; } - private Dictionary Items { get; set; } = new(); + + /// + /// User's preferences + /// private Preferences _preferences = new(); - private string? Selection { get; set; } + + /// + /// Item selected by user + /// + private string? _selectedItem { get; set; } + + /// + /// Component initialization + /// protected override async Task OnInitializedAsync() { - UserPreferenceService.OnChange += ProfileServiceOnOnChange; - _preferences = await UserPreferenceService.GetPreferences(); - Selection = _preferences.ItemSort; + _preferenceService.OnChange += ProfileServiceOnOnChange; + _preferences = await _preferenceService.GetPreferences(); + _selectedItem = _preferences.ItemSort; } + + /// + /// OnSelectChanged trigger + /// + /// private async Task OnSelectChanged(ChangeEventArgs e) { var val = e.Value.ToString(); if (val == "-1") return; await OnChanged.InvokeAsync(val); - await UserPreferenceService.SetItemSort(val); + await _preferenceService.SetItemSort(val); } + + /// + /// Get updated settings from preference service + /// + /// private void ProfileServiceOnOnChange(Preferences newPreferences) { _preferences = newPreferences; StateHasChanged(); } + + /// + /// Component dispose + /// public void Dispose() { - UserPreferenceService.OnChange -= ProfileServiceOnOnChange; + _preferenceService.OnChange -= ProfileServiceOnOnChange; } } \ No newline at end of file diff --git a/Wonky.Client/Components/ItemTableComponent.razor.cs b/Wonky.Client/Components/ItemTableComponent.razor.cs index 81ed3e2f..797f8b01 100644 --- a/Wonky.Client/Components/ItemTableComponent.razor.cs +++ b/Wonky.Client/Components/ItemTableComponent.razor.cs @@ -23,7 +23,7 @@ namespace Wonky.Client.Components; public partial class ItemTableComponent { - [Parameter] public List SalesItems { get; set; } = new(); + [Parameter] public List SalesItems { get; set; } = new(); [Inject] private IToastService ToastService { get; set; } private void AddToDraft() { diff --git a/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs b/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs index 513eece8..4140b25a 100644 --- a/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs +++ b/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Components; diff --git a/Wonky.Client/Components/ProductLineTableComponent.razor.cs b/Wonky.Client/Components/ProductLineTableComponent.razor.cs index 982446ff..b968d483 100644 --- a/Wonky.Client/Components/ProductLineTableComponent.razor.cs +++ b/Wonky.Client/Components/ProductLineTableComponent.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Components; diff --git a/Wonky.Client/Components/ReportActivityLedgerComponent.razor b/Wonky.Client/Components/ReportActivityLedgerComponent.razor new file mode 100644 index 00000000..5192b7bc --- /dev/null +++ b/Wonky.Client/Components/ReportActivityLedgerComponent.razor @@ -0,0 +1,84 @@ +@* +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// 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] +// +*@ + +
BesøgKundeBynavn Demo Salg Notat
@activity.Company.Name, @activity.Company.ZipCity@activity.ViewCompany.Name, @activity.ViewCompany.ZipCity @activity.Demo @activity.SalesResume @activity.OfficeNote@(activity.StatusTypeEnum == "Quote" ? "Tilbud" : "Salg")@activity. @(activity.Closed ? @activity.OrderAmount : 0)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)Dagens ResultatMåneds Resultat
BesøgDemoSalgBeløbBesøgDemoSalgBeløb
N@Report.NewVisitCount@Report.NewDemoCount@Report.NewSaleCount@Report.NewTurnover@Report.NewVisitCountMonth@Report.NewDemoCountMonth@Report.NewSaleCountMonth@Report.NewTurnoverMonth
R@Report.RecallVisitCount@Report.RecallDemoCount@Report.RecallSaleCount@Report.RecallTurnover@Report.RecallVisitCountMonth@Report.RecallDemoCountMonth@Report.RecallSaleCountMonth@Report.RecallTurnoverMonth
SAS@Report.SasCount@Report.SasTurnover@Report.SasCountMonth@Report.SasTurnoverMonth
TOTAL@Report.TotalVisitCount@Report.TotalDemoCount@Report.TotalSaleCount@Report.TotalTurnover@Report.TotalVisitCountMonth@Report.TotalDemoCountMonth@Report.TotalSaleCountMonth@Report.TotalTurnoverMonth
diff --git a/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs b/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs new file mode 100644 index 00000000..d0ccf0af --- /dev/null +++ b/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs @@ -0,0 +1,10 @@ +using Wonky.Entity.Views; +using Microsoft.AspNetCore.Components; + +namespace Wonky.Client.Components; + +public partial class ReportActivityLedgerComponent +{ + [Parameter] + public NgSalesReport Report { get; set; } +} \ No newline at end of file diff --git a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor new file mode 100644 index 00000000..d4269bee --- /dev/null +++ b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor @@ -0,0 +1,51 @@ +@* +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// 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] +// +*@ + + + + + + + + + + + + + + + + + + + + + + +
+ Km Aften + + Km Morgen + + Km Kørt Dag + + Km Kørt Md. + + Km Privat + + Km Privat Md. +
@Report.KmEvening@Report.KmMorning@Report.Distance@Report.DistanceMonth@Report.DistancePrivate@Report.DistancePrivateMonth
diff --git a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs new file mode 100644 index 00000000..05019f4b --- /dev/null +++ b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs @@ -0,0 +1,11 @@ +using Wonky.Entity.Views; +using Microsoft.AspNetCore.Components; + +namespace Wonky.Client.Components; + +public partial class ReportDistanceLedgerComponent +{ + [Parameter] + public NgSalesReport Report { get; set; } + +} \ No newline at end of file diff --git a/Wonky.Client/Components/ReportSummaryComponent.razor b/Wonky.Client/Components/ReportSummaryComponent.razor index e1dd7056..8d70c704 100644 --- a/Wonky.Client/Components/ReportSummaryComponent.razor +++ b/Wonky.Client/Components/ReportSummaryComponent.razor @@ -15,108 +15,6 @@ // *@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)Dagens ResultatMåneds Resultat
BesøgDemoSalgBeløbBesøgDemoSalgBeløb
N@Report.NewVisitCount@Report.NewDemoCount@Report.NewSaleCount@Report.NewTurnover@Report.NewVisitCountMonth@Report.NewDemoCountMonth@Report.NewSaleCountMonth@Report.NewTurnoverMonth
R@Report.RecallVisitCount@Report.RecallDemoCount@Report.RecallSaleCount@Report.RecallTurnover@Report.RecallVisitCountMonth@Report.RecallDemoCountMonth@Report.RecallSaleCountMonth@Report.RecallTurnoverMonth
SAS@Report.SasCount@Report.SasTurnover@Report.SasCountMonth@Report.SasTurnoverMonth
TOTAL@Report.TotalVisitCount@Report.TotalDemoCount@Report.TotalSaleCount@Report.TotalTurnover@Report.TotalVisitCountMonth@Report.TotalDemoCountMonth@Report.TotalSaleCountMonth@Report.TotalTurnoverMonth
- - - - - - - - - - - - - - - - - - - - - -
- Km Aften - - Km Morgen - - Km Kørt Dag - - Km Kørt Md. - - Km Privat - - Km Privat Md. -
@Report.KmEvening@Report.KmMorning@Report.Distance@Report.DistanceMonth@Report.DistancePrivate@Report.DistancePrivateMonth
- @@ -131,3 +29,4 @@
+ diff --git a/Wonky.Client/Components/SearchPhraseComponent.razor.cs b/Wonky.Client/Components/SearchPhraseComponent.razor.cs index ddd12074..e0ff7598 100644 --- a/Wonky.Client/Components/SearchPhraseComponent.razor.cs +++ b/Wonky.Client/Components/SearchPhraseComponent.razor.cs @@ -15,6 +15,7 @@ using System.Timers; using Microsoft.AspNetCore.Components; +using Microsoft.VisualBasic; using Timer = System.Timers.Timer; namespace Wonky.Client.Components @@ -24,7 +25,7 @@ namespace Wonky.Client.Components private Timer _timer = new(); private string SearchTerm { get; set; } = ""; [Parameter] public EventCallback OnChanged { get; set; } - [Parameter] public string SavedSearch { get; set; } = ""; + [Parameter] public string SavedSearch { get; set; } = string.Empty; protected override void OnParametersSet() { @@ -40,8 +41,8 @@ namespace Wonky.Client.Components private void ClearSearch() { - SavedSearch = ""; - SearchTerm = ""; + SavedSearch = string.Empty; + SearchTerm = string.Empty; OnChanged.InvokeAsync(SearchTerm); } diff --git a/Wonky.Client/Components/WorkDateComponent.razor b/Wonky.Client/Components/WorkDateComponent.razor index 7a1b4b0e..ba5b28ad 100644 --- a/Wonky.Client/Components/WorkDateComponent.razor +++ b/Wonky.Client/Components/WorkDateComponent.razor @@ -2,4 +2,4 @@ @using Wonky.Client.Services + @bind-Value="SelectedDate" @bind-Value:event="oninput" @onchange="OnDateChanged" /> diff --git a/Wonky.Client/Components/WorkDateComponent.razor.cs b/Wonky.Client/Components/WorkDateComponent.razor.cs index f49a620a..c2709678 100644 --- a/Wonky.Client/Components/WorkDateComponent.razor.cs +++ b/Wonky.Client/Components/WorkDateComponent.razor.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Blazored.LocalStorage; using Microsoft.AspNetCore.Components; using Wonky.Client.Services; @@ -6,23 +7,42 @@ namespace Wonky.Client.Components; public partial class WorkDateComponent : IDisposable { - [Inject] private ILocalStorageService LocalStorage { get; set; } + /// + /// User preference service + /// [Inject] private UserPreferenceService UserPrefs { get; set; } - [Parameter] public EventCallback OnChanged { get; set; } - - private Preferences _prefs = new(); - private string _selectedDate = $"{DateOnly.FromDateTime(DateTime.Now):yyyy-MM-dd}"; + /// + /// OnChanged callback function + /// + [Parameter] public EventCallback OnChanged { get; set; } + + /// + /// Selected data + /// + [Parameter] public string SelectedDate { get; set; } = $"{DateOnly.FromDateTime(DateTime.Now):yyyy-MM-dd}"; + + /// + /// user preferences + /// + private Preferences _prefs = new(); + + /// + /// Component Initialization + /// protected override async Task OnInitializedAsync() { UserPrefs.OnChange += ProfileServiceOnOnChange; _prefs = await UserPrefs.GetPreferences(); - _selectedDate = string.IsNullOrWhiteSpace(_prefs.WorkDate) - ? $"{DateOnly.FromDateTime(DateTime.Now):yyyy-MM-dd}" - : _prefs.WorkDate; + if (!string.IsNullOrWhiteSpace(_prefs.WorkDate)) + SelectedDate = _prefs.WorkDate; } + /// + /// OnDateChanged function call to invoke the event callback + /// + /// private async Task OnDateChanged(ChangeEventArgs e) { var val = $"{DateOnly.Parse(e.Value?.ToString()!):yyyy-MM-dd}"; @@ -30,12 +50,19 @@ public partial class WorkDateComponent : IDisposable await OnChanged.InvokeAsync(val); } + /// + /// + /// + /// private void ProfileServiceOnOnChange(Preferences newPreferences) { _prefs = newPreferences; StateHasChanged(); } + /// + /// Component dispose + /// public void Dispose() { UserPrefs.OnChange -= ProfileServiceOnOnChange; diff --git a/Wonky.Client/HttpRepository/ActivityHttpRepository.cs b/Wonky.Client/HttpRepository/ActivityHttpRepository.cs index 07f80b58..6761a891 100644 --- a/Wonky.Client/HttpRepository/ActivityHttpRepository.cs +++ b/Wonky.Client/HttpRepository/ActivityHttpRepository.cs @@ -54,46 +54,22 @@ public class ActivityHttpRepository : IActivityHttpRepository _apiConfig = configuration.Value; } - public async Task GetActivities(string activityDate) + public async Task GetActivities(string activityDate) { var response = await _client .GetAsync($"{_apiConfig.ActivityUri}/date/{activityDate}"); var content = await response.Content.ReadAsStringAsync(); return string.IsNullOrWhiteSpace(content) - ? new NgActivityListReportView() - : JsonSerializer.Deserialize(content, _options); + ? new ActivityListReportView() + : JsonSerializer.Deserialize(content, _options); } - public async Task> GetActivityPaged(ActivityPagingParams pagingParameters) - { - var queryString = new Dictionary - { - ["pageNumber"] = pagingParameters.PageNumber.ToString(), - ["pageSize"] = pagingParameters.PageSize.ToString(), - ["orderBy"] = pagingParameters.OrderBy, - ["searchColumn"] = pagingParameters.SearchColumn, - ["searchTerm"] = pagingParameters.SearchTerm, - }; - var response = await _client - .GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.ActivityUri}/page", queryString)); - var content = await response.Content.ReadAsStringAsync(); - if (!response.IsSuccessStatusCode) - _logger.LogInformation("GetActivityPages => {content}", content); - - var pagingResponse = new PagingResponse - { - Items = JsonSerializer.Deserialize>(content, _options), - MetaData = JsonSerializer.Deserialize( - response.Headers.GetValues("X-Pagination").First(), _options) - }; - return pagingResponse; - } - - public async Task CreateActivity(ActivityDto model) + + public async Task CreateActivity(ActivityDto model) { Console.WriteLine(JsonSerializer.Serialize(model, _options)); var response = await _client.PostAsJsonAsync($"{_apiConfig.ActivityUri}", model, _options); var content = await response.Content.ReadAsStringAsync(); - var result = JsonSerializer.Deserialize(content); + var result = JsonSerializer.Deserialize(content); return result!; } @@ -104,12 +80,12 @@ public class ActivityHttpRepository : IActivityHttpRepository return salesItem ?? new ActivityDto(); } - public async Task AcceptOffer(string id) + public async Task AcceptOffer(string id) { var response = await _client.PostAsJsonAsync($"{_apiConfig.ActivityUri}/{id}/accept", id) ; var content = await response.Content.ReadAsStringAsync(); - var result = JsonSerializer.Deserialize(content); + var result = JsonSerializer.Deserialize(content); return result!; } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/IActivityHttpRepository.cs b/Wonky.Client/HttpRepository/IActivityHttpRepository.cs index ed5a744b..d74ebed0 100644 --- a/Wonky.Client/HttpRepository/IActivityHttpRepository.cs +++ b/Wonky.Client/HttpRepository/IActivityHttpRepository.cs @@ -24,9 +24,8 @@ namespace Wonky.Client.HttpRepository; public interface IActivityHttpRepository { - Task> GetActivityPaged(ActivityPagingParams pagingParameters); Task GetActivity(string id); - Task CreateActivity(ActivityDto model); - Task AcceptOffer(string id); - Task GetActivities(string activityDate); + Task CreateActivity(ActivityDto model); + Task AcceptOffer(string id); + Task GetActivities(string activityDate); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/IHistoryHttpRepository.cs b/Wonky.Client/HttpRepository/IHistoryHttpRepository.cs index 3eb49857..b3e0dbb4 100644 --- a/Wonky.Client/HttpRepository/IHistoryHttpRepository.cs +++ b/Wonky.Client/HttpRepository/IHistoryHttpRepository.cs @@ -1,5 +1,6 @@ using Wonky.Client.Pages; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.HttpRepository; diff --git a/Wonky.Client/HttpRepository/IReportHttpRepository.cs b/Wonky.Client/HttpRepository/IReportHttpRepository.cs index aa0af04c..ad5b60b6 100644 --- a/Wonky.Client/HttpRepository/IReportHttpRepository.cs +++ b/Wonky.Client/HttpRepository/IReportHttpRepository.cs @@ -10,5 +10,5 @@ public interface IReportHttpRepository Task> GetReports(); Task GetReport(string workDate); Task InitializeReportData(string workDate); - Task PostReport(string workDate, ReportDto reportDto); + Task PostReport(string workDate, ReportDto reportDto); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/ISalesItemHttpRepository.cs b/Wonky.Client/HttpRepository/ISalesItemHttpRepository.cs index db570bc1..a9b5ccb7 100644 --- a/Wonky.Client/HttpRepository/ISalesItemHttpRepository.cs +++ b/Wonky.Client/HttpRepository/ISalesItemHttpRepository.cs @@ -23,6 +23,6 @@ namespace Wonky.Client.HttpRepository; public interface ISalesItemHttpRepository { - Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters); - Task GetSalesItem(string id); + Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters); + Task GetSalesItem(string id); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/IUserHttpRepository.cs b/Wonky.Client/HttpRepository/IUserHttpRepository.cs index de850a56..1cbb6498 100644 --- a/Wonky.Client/HttpRepository/IUserHttpRepository.cs +++ b/Wonky.Client/HttpRepository/IUserHttpRepository.cs @@ -1,14 +1,15 @@ using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.HttpRepository; public interface IUserHttpRepository { Task> GetAdvisers(); - Task GetAdviserInfo(string userId); + Task GetAdviserInfo(string userId); Task UpdateAdviser(string userId, UserUpdateDto model); Task> GetAdminUsers(); - Task GetAdminUserInfo(string userId); + Task GetAdminUserInfo(string userId); Task UpdateAdminUser(string userId, UserUpdateDto model); Task ResetUserPassword(string userId, string newPasswd, string confirmPasswd); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/ReportHttpRepository.cs b/Wonky.Client/HttpRepository/ReportHttpRepository.cs index aaf56907..2fc470b2 100644 --- a/Wonky.Client/HttpRepository/ReportHttpRepository.cs +++ b/Wonky.Client/HttpRepository/ReportHttpRepository.cs @@ -54,14 +54,14 @@ public class ReportHttpRepository :IReportHttpRepository return initData ?? new ReportInitDto(); } - public async Task PostReport(string workDate, ReportDto reportDto) + public async Task PostReport(string workDate, ReportDto reportDto) { var response = await _client .PostAsJsonAsync($"{_apiConfig.ReportUri}/{workDate}", reportDto, _options); var jsonDate = await response.Content.ReadAsStringAsync(); - var result = JsonSerializer.Deserialize(jsonDate); - return new ApiResponse + var result = JsonSerializer.Deserialize(jsonDate); + return new ApiResponseView { Code = result.Code, Id = result.Id, diff --git a/Wonky.Client/HttpRepository/SalesItemHttpRepository.cs b/Wonky.Client/HttpRepository/SalesItemHttpRepository.cs index 14016f3c..c061b05d 100644 --- a/Wonky.Client/HttpRepository/SalesItemHttpRepository.cs +++ b/Wonky.Client/HttpRepository/SalesItemHttpRepository.cs @@ -52,7 +52,7 @@ public class SalesItemHttpRepository : ISalesItemHttpRepository _apiConfig = configuration.Value; } - public async Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters) + public async Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters) { var queryString = new Dictionary { @@ -68,19 +68,19 @@ public class SalesItemHttpRepository : ISalesItemHttpRepository var content = await response.Content.ReadAsStringAsync(); - var pagingResponse = new PagingResponse + var pagingResponse = new PagingResponse { - Items = JsonSerializer.Deserialize>(content, _options), + Items = JsonSerializer.Deserialize>(content, _options), MetaData = JsonSerializer.Deserialize( response.Headers.GetValues("X-Pagination").First(), _options) }; return pagingResponse; } - public async Task GetSalesItem(string id) + public async Task GetSalesItem(string id) { var salesItem = await _client - .GetFromJsonAsync($"{_apiConfig.CatalogUri}/{id}"); - return salesItem ?? new NgSalesItemView(); + .GetFromJsonAsync($"{_apiConfig.CatalogUri}/{id}"); + return salesItem ?? new SalesItemView(); } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/UserHttpRepository.cs b/Wonky.Client/HttpRepository/UserHttpRepository.cs index bf073951..45ee1dd4 100644 --- a/Wonky.Client/HttpRepository/UserHttpRepository.cs +++ b/Wonky.Client/HttpRepository/UserHttpRepository.cs @@ -36,9 +36,9 @@ public class UserHttpRepository : IUserHttpRepository return await _client.GetFromJsonAsync>(_api.AdminAdviserUri); } - public async Task GetAdviserInfo(string userId) + public async Task GetAdviserInfo(string userId) { - return await _client.GetFromJsonAsync($"{_api.AdminAdviserUri}/{userId}"); + return await _client.GetFromJsonAsync($"{_api.AdminAdviserUri}/{userId}"); } public async Task UpdateAdviser(string userId, UserUpdateDto model) @@ -51,9 +51,9 @@ public class UserHttpRepository : IUserHttpRepository return await _client.GetFromJsonAsync>(_api.AdminUserUri); } - public async Task GetAdminUserInfo(string userId) + public async Task GetAdminUserInfo(string userId) { - return await _client.GetFromJsonAsync($"{_api.AdminUserUri}/{userId}"); + return await _client.GetFromJsonAsync($"{_api.AdminUserUri}/{userId}"); } public async Task UpdateAdminUser(string userId, UserUpdateDto model) diff --git a/Wonky.Client/Models/Draft.cs b/Wonky.Client/Models/Draft.cs index 6672150c..f8c6067b 100644 --- a/Wonky.Client/Models/Draft.cs +++ b/Wonky.Client/Models/Draft.cs @@ -6,7 +6,7 @@ namespace Wonky.Client.Models; public class DraftItem { public int Quantity { get; set; } - public NgSalesItemView Item { get; set; } + public SalesItemView Item { get; set; } public decimal Price { get; set; } public decimal Discount { get; set; } public bool Sas { get; set; } diff --git a/Wonky.Client/Pages/ActivityToday.razor.cs b/Wonky.Client/Pages/ActivityToday.razor.cs index 56135c8c..930d4932 100644 --- a/Wonky.Client/Pages/ActivityToday.razor.cs +++ b/Wonky.Client/Pages/ActivityToday.razor.cs @@ -17,7 +17,7 @@ public partial class ActivityToday [Inject] private IActivityHttpRepository _activityRepo { get; set; } [Inject] private IReportHttpRepository _reportRepo { get; set; } [Inject] private IToastService _toast { get; set; } - private NgActivityListReportView ReportView { get; set; } = new(); + private ActivityListReportView ReportView { get; set; } = new(); private Preferences _prefs { get; set; } = new(); private string _workDate { get; set; } = $"{DateTime.Now:yyyy-MM-dd}"; private bool _reportExist = false; @@ -38,7 +38,7 @@ public partial class ActivityToday { _toast.ShowInfo("Vent nogle sekunder for data"); _workDate = workDate; - ReportView = new NgActivityListReportView(); + ReportView = new ActivityListReportView(); ReportView = await _activityRepo.GetActivities(workDate); } diff --git a/Wonky.Client/Pages/ActivityVisitNew.razor.cs b/Wonky.Client/Pages/ActivityVisitNew.razor.cs index 3f8b5e9f..b118d569 100644 --- a/Wonky.Client/Pages/ActivityVisitNew.razor.cs +++ b/Wonky.Client/Pages/ActivityVisitNew.razor.cs @@ -49,8 +49,8 @@ public partial class ActivityVisitNew : IDisposable [Inject] private IReportHttpRepository _reportRepo { get; set; } // variables private readonly JsonSerializerOptions? _options = new JsonSerializerOptions{PropertyNameCaseInsensitive = true}; - private NgSalesItemView _selectedItem { get; set; } = new(); - private List _caltalog { get; set; } = new(); + private SalesItemView _selectedItem { get; set; } = new(); + private List _caltalog { get; set; } = new(); private MetaData _metaData { get; set; } = new(); private Preferences _prefs { get; set; } = new(); private ActivityDto _draft { get; set; } = new(); @@ -199,13 +199,13 @@ public partial class ActivityVisitNew : IDisposable Quantity = quantity; } - private async Task AddItem(NgSalesItemView ngSalesItem) + private async Task AddItem(SalesItemView salesItem) { ShowItem = false; // create a new cart item var item = new DraftItem { - Item = ngSalesItem, + Item = salesItem, Quantity = Convert.ToInt32(Quantity), Price = Convert.ToDecimal(Price, CultureInfo.InvariantCulture), Discount = Convert.ToDecimal(Discount, CultureInfo.InvariantCulture), @@ -230,14 +230,14 @@ public partial class ActivityVisitNew : IDisposable } private async Task SetItemGroup(string groupFilter) { - _caltalog = new List(); + _caltalog = new List(); _paging.PageNumber = 1; _paging.SelectGroup = groupFilter; await GetSalesItems(); } private async Task SetSearchCol(string columnName) { - _caltalog = new List(); + _caltalog = new List(); _paging.PageNumber = 1; _paging.SearchTerm = ""; _paging.SearchColumn = columnName; @@ -245,27 +245,27 @@ public partial class ActivityVisitNew : IDisposable } private async Task SetSortCol(string orderBy) { - _caltalog = new List(); + _caltalog = new List(); _paging.OrderBy = orderBy; await GetSalesItems(); } private async Task SetSearchPhrase(string searchTerm) { - _caltalog = new List(); + _caltalog = new List(); _paging.PageNumber = 1; _paging.SearchTerm = searchTerm; await GetSalesItems(); } private async Task SelectedPage(int page) { - _caltalog = new List(); + _caltalog = new List(); _paging.PageNumber = page; await GetSalesItems(); } private async Task SetPageSize(string pageSize) { - _caltalog = new List(); + _caltalog = new List(); _paging.PageSize = Convert.ToInt32(pageSize); _paging.PageNumber = 1; await GetSalesItems(); diff --git a/Wonky.Client/Pages/AdminAdviserCompanyList.razor b/Wonky.Client/Pages/AdminAdviserCompanyList.razor index 4a4a3a38..09936ac7 100644 --- a/Wonky.Client/Pages/AdminAdviserCompanyList.razor +++ b/Wonky.Client/Pages/AdminAdviserCompanyList.razor @@ -4,7 +4,7 @@
-

@_userInfo.FirstName @_userInfo.LastName Kunder

+

@AdminUserInfo.FirstName @AdminUserInfo.LastName Kunder

diff --git a/Wonky.Client/Pages/AdminAdviserCompanyList.razor.cs b/Wonky.Client/Pages/AdminAdviserCompanyList.razor.cs index 7bc1f8bd..8acfa1d4 100644 --- a/Wonky.Client/Pages/AdminAdviserCompanyList.razor.cs +++ b/Wonky.Client/Pages/AdminAdviserCompanyList.razor.cs @@ -21,7 +21,7 @@ public partial class AdminAdviserCompanyList : IDisposable private CompanyPagingParams _paging = new(); private Preferences _preferences { get; set; } = new(); private string _savedSearch { get; set; } = ""; - private UserInfoAdminView _userInfo { get; set; } = new(); + private AdminUserInfoDto AdminUserInfo { get; set; } = new(); private List _companyList { get; set; } = new(); protected override async Task OnInitializedAsync() @@ -39,7 +39,7 @@ public partial class AdminAdviserCompanyList : IDisposable _interceptor.RegisterEvent(); _interceptor.RegisterBeforeSendEvent(); - _userInfo = await _userRepo.GetAdviserInfo(UserId); + AdminUserInfo = await _userRepo.GetAdviserInfo(UserId); // get companies await GetCompanies(); } diff --git a/Wonky.Client/Pages/AdminAdviserUserList.razor.cs b/Wonky.Client/Pages/AdminAdviserUserList.razor.cs index be3c3c24..b2a5b0c5 100644 --- a/Wonky.Client/Pages/AdminAdviserUserList.razor.cs +++ b/Wonky.Client/Pages/AdminAdviserUserList.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Pages; diff --git a/Wonky.Client/Pages/AdminAdviserView.razor b/Wonky.Client/Pages/AdminAdviserView.razor index 1c618ffd..57d60eea 100644 --- a/Wonky.Client/Pages/AdminAdviserView.razor +++ b/Wonky.Client/Pages/AdminAdviserView.razor @@ -4,10 +4,10 @@
-

Sælger info

+

Bruger info

- @if (UserInfoAdmin != null) + @if (AdminUserInfo != null) { @@ -52,7 +52,7 @@ Sælgernr. - @UserInfoAdmin.Adviser + @AdminUserInfo.Adviser Landekode diff --git a/Wonky.Client/Pages/AdminAdviserView.razor.cs b/Wonky.Client/Pages/AdminAdviserView.razor.cs index de101b12..1d987086 100644 --- a/Wonky.Client/Pages/AdminAdviserView.razor.cs +++ b/Wonky.Client/Pages/AdminAdviserView.razor.cs @@ -18,7 +18,7 @@ public partial class AdminAdviserView : IDisposable [Inject] private ILogger _logger { get; set; } [Inject] private NavigationManager _navigator { get; set; } [Inject] private IToastService _toast { get; set; } - private UserInfoAdminView UserInfoAdmin { get; set; } = new(); + private AdminUserInfoDto AdminUserInfo { get; set; } = new(); private EditContext _editContext { get; set; } private UserUpdateDto _updateInfo { get; set; } = new(); private AdminResetPasswordDto _passwords { get; set; } = new(); @@ -38,14 +38,14 @@ public partial class AdminAdviserView : IDisposable _interceptor.RegisterEvent(); _interceptor.RegisterBeforeSendEvent(); - UserInfoAdmin = await _userRepo.GetAdviserInfo(UserId); + AdminUserInfo = await _userRepo.GetAdviserInfo(UserId); - _updateInfo.Email = UserInfoAdmin.Email; - _updateInfo.CountryCode = UserInfoAdmin.CountryCode; - _updateInfo.FirstName = UserInfoAdmin.FirstName; - _updateInfo.LastName = UserInfoAdmin.LastName; - _updateInfo.PhoneNumber = UserInfoAdmin.PhoneNumber; - _updateInfo.LockoutEnabled = UserInfoAdmin.LockoutEnabled; + _updateInfo.Email = AdminUserInfo.Email; + _updateInfo.CountryCode = AdminUserInfo.CountryCode; + _updateInfo.FirstName = AdminUserInfo.FirstName; + _updateInfo.LastName = AdminUserInfo.LastName; + _updateInfo.PhoneNumber = AdminUserInfo.PhoneNumber; + _updateInfo.LockoutEnabled = AdminUserInfo.LockoutEnabled; _passwdContext.OnFieldChanged += PwHandleFieldChanged; _passwdContext.OnValidationStateChanged += PwValidationChanged; diff --git a/Wonky.Client/Pages/AdminOfficeList.razor.cs b/Wonky.Client/Pages/AdminOfficeList.razor.cs index 898e6e39..fbbcc7b9 100644 --- a/Wonky.Client/Pages/AdminOfficeList.razor.cs +++ b/Wonky.Client/Pages/AdminOfficeList.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Pages; diff --git a/Wonky.Client/Pages/AdminOfficeView.razor b/Wonky.Client/Pages/AdminOfficeView.razor index f6c85646..efdc213c 100644 --- a/Wonky.Client/Pages/AdminOfficeView.razor +++ b/Wonky.Client/Pages/AdminOfficeView.razor @@ -4,10 +4,10 @@
-

Sælger info

+

Bruger info

- @if (UserInfoAdmin != null) + @if (AdminUserInfo != null) { @@ -47,20 +47,6 @@ - - - Sælgernr. - - - @UserInfoAdmin.Adviser - - - Landekode - - - @_updateInfo.CountryCode - - Spærret diff --git a/Wonky.Client/Pages/AdminOfficeView.razor.cs b/Wonky.Client/Pages/AdminOfficeView.razor.cs index b93d2073..8a7c1904 100644 --- a/Wonky.Client/Pages/AdminOfficeView.razor.cs +++ b/Wonky.Client/Pages/AdminOfficeView.razor.cs @@ -18,7 +18,7 @@ public partial class AdminOfficeView : IDisposable [Inject] private ILogger _logger { get; set; } [Inject] private NavigationManager _navigator { get; set; } [Inject] private IToastService _toast { get; set; } - private UserInfoAdminView UserInfoAdmin { get; set; } = new(); + private AdminUserInfoDto AdminUserInfo { get; set; } = new(); private EditContext _editContext { get; set; } private UserUpdateDto _updateInfo { get; set; } = new(); private AdminResetPasswordDto _passwords { get; set; } = new(); @@ -38,14 +38,14 @@ public partial class AdminOfficeView : IDisposable _interceptor.RegisterEvent(); _interceptor.RegisterBeforeSendEvent(); - UserInfoAdmin = await _userRepo.GetAdminUserInfo(UserId); + AdminUserInfo = await _userRepo.GetAdminUserInfo(UserId); - _updateInfo.Email = UserInfoAdmin.Email; - _updateInfo.CountryCode = UserInfoAdmin.CountryCode; - _updateInfo.FirstName = UserInfoAdmin.FirstName; - _updateInfo.LastName = UserInfoAdmin.LastName; - _updateInfo.PhoneNumber = UserInfoAdmin.PhoneNumber; - _updateInfo.LockoutEnabled = UserInfoAdmin.LockoutEnabled; + _updateInfo.Email = AdminUserInfo.Email; + _updateInfo.CountryCode = AdminUserInfo.CountryCode; + _updateInfo.FirstName = AdminUserInfo.FirstName; + _updateInfo.LastName = AdminUserInfo.LastName; + _updateInfo.PhoneNumber = AdminUserInfo.PhoneNumber; + _updateInfo.LockoutEnabled = AdminUserInfo.LockoutEnabled; _passwdContext.OnFieldChanged += PwHandleFieldChanged; _passwdContext.OnValidationStateChanged += PwValidationChanged; diff --git a/Wonky.Client/Pages/AdminSalesReportView.razor b/Wonky.Client/Pages/AdminSalesReportView.razor index 2bb43488..cb9ac4b0 100644 --- a/Wonky.Client/Pages/AdminSalesReportView.razor +++ b/Wonky.Client/Pages/AdminSalesReportView.razor @@ -25,7 +25,7 @@
-
+
@if (!string.IsNullOrWhiteSpace(ReportDate)) {

@DateTime.Parse(ReportDate).ToLongDateString()

@@ -34,6 +34,9 @@
+
+ +

@_report.Report.Name

diff --git a/Wonky.Client/Pages/CompanyView.razor.cs b/Wonky.Client/Pages/CompanyView.razor.cs index 491951b7..35c3e25e 100644 --- a/Wonky.Client/Pages/CompanyView.razor.cs +++ b/Wonky.Client/Pages/CompanyView.razor.cs @@ -86,7 +86,8 @@ public partial class CompanyView : IDisposable _enableActivity = _company.ValidVat; // override if canvas which has account property as empty string or "NY" - _enableActivity = _company.Account == "NY" || string.IsNullOrWhiteSpace(_company.Account) ? 1 : 0; + if (_company.Account == "NY" || string.IsNullOrWhiteSpace(_company.Account)) + _enableActivity = 1; vatAddress = PrepareVatAddress(_company); diff --git a/Wonky.Client/Pages/ItemCatalog.razor.cs b/Wonky.Client/Pages/ItemCatalog.razor.cs index 9d60cfc2..38ab8aff 100644 --- a/Wonky.Client/Pages/ItemCatalog.razor.cs +++ b/Wonky.Client/Pages/ItemCatalog.razor.cs @@ -34,7 +34,7 @@ public partial class ItemCatalog : IDisposable [Inject] private ISalesItemHttpRepository _itemRepo { get; set; } [Inject] private HttpInterceptorService _interceptor { get; set; } [Inject] private UserPreferenceService _preferenceService { get; set; } - private List _items { get; set; } = new(); + private List _items { get; set; } = new(); private MetaData? _metaDate { get; set; } = new(); private CatalogPagingParams _paging = new(); private Preferences _preferences = new(); @@ -53,7 +53,7 @@ public partial class ItemCatalog : IDisposable private async Task SelectedPage(int page) { - _items = new List(); + _items = new List(); _paging.PageNumber = page; await GetSalesItems(); } @@ -67,7 +67,7 @@ public partial class ItemCatalog : IDisposable private async Task SetPageSize(string pageSize) { - _items = new List(); + _items = new List(); _paging.PageSize = Convert.ToInt32(pageSize); _paging.PageNumber = 1; await GetSalesItems(); @@ -75,21 +75,21 @@ public partial class ItemCatalog : IDisposable private async Task SetItemGroup(string groupFilter) { - _items = new List(); + _items = new List(); _paging.PageNumber = 1; _paging.SelectGroup = groupFilter; await GetSalesItems(); } private async Task SetSearchCol(string columnName) { - _items = new List(); + _items = new List(); _paging.PageNumber = 1; _paging.SearchColumn = columnName; await GetSalesItems(); } private async Task SetSearchPhrase(string searchTerm) { - _items = new List(); + _items = new List(); _paging.PageNumber = 1; _paging.SearchTerm = searchTerm; await GetSalesItems(); @@ -97,7 +97,7 @@ public partial class ItemCatalog : IDisposable private async Task SetSortCol(string orderBy) { - _items = new List(); + _items = new List(); _paging.OrderBy = orderBy; await GetSalesItems(); } diff --git a/Wonky.Client/Pages/ItemView.razor.cs b/Wonky.Client/Pages/ItemView.razor.cs index a5693652..6bd8b3c7 100644 --- a/Wonky.Client/Pages/ItemView.razor.cs +++ b/Wonky.Client/Pages/ItemView.razor.cs @@ -26,7 +26,7 @@ namespace Wonky.Client.Pages; public partial class ItemView : IDisposable { [Parameter] public string SalesItemId { get; set; } = ""; - private NgSalesItemView _item { get; set; } = new (); + private SalesItemView _item { get; set; } = new (); [Inject] private ISalesItemHttpRepository _itemRepo { get; set; } [Inject] private HttpInterceptorService _interceptor { get; set; } diff --git a/Wonky.Client/Pages/ProductHistoryItem.razor.cs b/Wonky.Client/Pages/ProductHistoryItem.razor.cs index 333b0981..66b1695c 100644 --- a/Wonky.Client/Pages/ProductHistoryItem.razor.cs +++ b/Wonky.Client/Pages/ProductHistoryItem.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Pages; diff --git a/Wonky.Client/Pages/ProductHistoryList.razor.cs b/Wonky.Client/Pages/ProductHistoryList.razor.cs index 31efbd7a..ec2d8a1f 100644 --- a/Wonky.Client/Pages/ProductHistoryList.razor.cs +++ b/Wonky.Client/Pages/ProductHistoryList.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Pages; diff --git a/Wonky.Client/Pages/ProductInventory.razor.cs b/Wonky.Client/Pages/ProductInventory.razor.cs index f138f801..d0718fc3 100644 --- a/Wonky.Client/Pages/ProductInventory.razor.cs +++ b/Wonky.Client/Pages/ProductInventory.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Pages; diff --git a/Wonky.Client/Pages/SalesReportNew.razor b/Wonky.Client/Pages/SalesReportNew.razor index b248747c..13cd901b 100644 --- a/Wonky.Client/Pages/SalesReportNew.razor +++ b/Wonky.Client/Pages/SalesReportNew.razor @@ -233,7 +233,7 @@ @foreach (var activity in _activities) { - @activity.Company.Name - @activity.Company.ZipCity + @activity.ViewCompany.Name - @activity.ViewCompany.ZipCity @activity.Demo @activity.SalesResume @activity.OrderAmount diff --git a/Wonky.Client/Pages/SalesReportNew.razor.cs b/Wonky.Client/Pages/SalesReportNew.razor.cs index 39276b15..5f72a795 100644 --- a/Wonky.Client/Pages/SalesReportNew.razor.cs +++ b/Wonky.Client/Pages/SalesReportNew.razor.cs @@ -40,7 +40,7 @@ public partial class SalesReportNew : IDisposable [Inject] private IToastService _toast { get; set; } private EditContext _editContext { get; set; } private ReportDto _report { get; set; } = new(); - private List _activities { get; set; } = new(); + private List _activities { get; set; } = new(); private ReportFiguresDto _init { get; set; } private Preferences _prefs { get; set; } = new(); private bool _formInvalid = true; @@ -151,7 +151,7 @@ public partial class SalesReportNew : IDisposable _noFigures = true; _report.Figures = new ReportFiguresDto(); _init = new ReportFiguresDto(); - _activities = new List(); + _activities = new List(); _report.Figures.KmEvening = 0; _report.Figures.KmMorning = 0; _report.Figures.Distance = 0; diff --git a/Wonky.Client/Pages/SalesReportView.razor b/Wonky.Client/Pages/SalesReportView.razor index 1bdc19bd..d3e62206 100644 --- a/Wonky.Client/Pages/SalesReportView.razor +++ b/Wonky.Client/Pages/SalesReportView.razor @@ -25,7 +25,7 @@
-
+
@if (!string.IsNullOrWhiteSpace(ReportDate)) {

@DateTime.Parse(ReportDate).ToLongDateString()

@@ -34,6 +34,9 @@
+
+ +

@_report.Report.Name

diff --git a/Wonky.Client/Shared/AuthStateProvider.cs b/Wonky.Client/Shared/AuthStateProvider.cs index d542f0f5..e72be2ef 100644 --- a/Wonky.Client/Shared/AuthStateProvider.cs +++ b/Wonky.Client/Shared/AuthStateProvider.cs @@ -18,6 +18,7 @@ using System.Security.Claims; using Blazored.LocalStorage; using Microsoft.AspNetCore.Components.Authorization; using Wonky.Entity.DTO; +using Wonky.Entity.Views; namespace Wonky.Client.Shared { diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index a44d28a5..b21f8d81 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,7 +1,7 @@ { "appInfo": { "name": "Wonky Client", - "version": "0.8.66", + "version": "0.8.80", "isBeta": true, "image": "grumpy-coder.png" }, diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs index 5f33be71..46cc84e5 100644 --- a/Wonky.Entity/Configuration/ApiConfig.cs +++ b/Wonky.Entity/Configuration/ApiConfig.cs @@ -16,30 +16,102 @@ namespace Wonky.Entity.Configuration; public class ApiConfig { - // external service + /// + /// GLS tracking url + /// public string GlsTrackUrl { get; set; } = ""; + + /// + /// GLS customer entity + /// public string GlsId { get; set; } = ""; + + /// + /// VAT registrar url Denmark + /// public string VirkUrl { get; set; } = ""; + + /// + /// VAT registrar url Norway + /// public string BrRegUrl { get; set; } = ""; + + /// + /// VAT registrar url EU + /// public string ViesUrl { get; set; } = ""; - // api service + + /// + /// Application base url + /// public string InnoBaseUrl { get; set; } = ""; + + /// + /// Application uri for company information request + /// public string CompanyUri { get; set; } = ""; + + /// + /// Application uri for product catalog request + /// public string CatalogUri { get; set; } = ""; + + /// + /// Application uri for user information request + /// public string UserInfoUri { get; set; } = ""; + + /// + /// Application uri for token request + /// public string TokenUri { get; set; } = ""; + + /// + /// Application uri for activity request + /// public string ActivityUri { get; set; } = ""; + + /// + /// Application uri for sales report request + /// public string ReportUri { get; set; } = ""; + + /// + /// Application uri for task items request + /// public string TaskUri { get; set; } = ""; + + /// + /// Application uri for customer product inventory request + /// public string InventoryUri { get; set; } = ""; + + /// + /// Application uri for customer product sale request + /// public string ProductUri { get; set; } = ""; + + /// + /// Application uri for updating customer product sale request + /// public string SyncUri { get; set; } = ""; + + /// + /// Application uri for administration of sales representatives + /// public string AdminAdviserUri { get; set; } = ""; + + /// + /// Application uri for administration of administrative users + /// public string AdminUserUri { get; set; } = ""; + + /// + /// Application uri for administrative reset of user credentials + /// public string AdminPasswdUri { get; set; } = ""; - - + // public string KrvVariantsUri { get; set; } = ""; // public string KrvProductsUri { get; set; } = ""; // public string ImageUploadUri { get; set; } = ""; diff --git a/Wonky.Entity/Configuration/AppInfo.cs b/Wonky.Entity/Configuration/AppInfo.cs index f4ed7ce4..1cd39770 100644 --- a/Wonky.Entity/Configuration/AppInfo.cs +++ b/Wonky.Entity/Configuration/AppInfo.cs @@ -2,8 +2,23 @@ namespace Wonky.Entity.Configuration; public class AppInfo { + /// + /// Application version + /// public string Version { get; set; } + + /// + /// Application name + /// public string Name { get; set; } + + /// + /// Application picture name + /// public string Image { get; set; } + + /// + /// Application beta version flag + /// public bool IsBeta { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/ActivityDto.cs b/Wonky.Entity/DTO/ActivityDto.cs index 04006635..996f6ec2 100644 --- a/Wonky.Entity/DTO/ActivityDto.cs +++ b/Wonky.Entity/DTO/ActivityDto.cs @@ -20,149 +20,149 @@ namespace Wonky.Entity.DTO public class ActivityDto { /// - /// Sælger nummer + /// Sales representative identification /// public string SalesRep { get; set; } = ""; /// - /// Sælger Id + /// Sales representative entity Id /// public string SalesRepId { get; set; } = ""; /// - /// Kunde Id - ej konto + /// Company entity Id /// public string CompanyId { get; set; } = ""; /// - /// business central Id + /// Business Central entity Id /// public string BcId { get; set; } = ""; /// - /// konto + /// Customer account /// public string Account { get; set; } = ""; /// - /// moms nummer + /// VAT number /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string VatNumber { get; set; } = ""; /// - /// firma navn + /// Customer name /// [Required(ErrorMessage = "Navn skal udfyldes")] [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Name { get; set; } = ""; /// - /// firma adresse bynavn + /// Customer address city name /// [Required(ErrorMessage = "Byanvn skal udfyldes")] [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string City { get; set; }= ""; /// - /// firma adresse postnummer + /// Customer address postal code /// [Required(ErrorMessage = "Postnr. skal udfyldes")] [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ZipCode { get; set; } = ""; /// - /// firma adresse linje 1 + /// Customer address line 1 /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Address1 { get; set; } = ""; /// - /// firma adresse linje 2 + /// Customer address line 2 /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Address2 { get; set; } = ""; /// - /// firma telefon + /// Customer office phone /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = ""; /// - /// firma mobil telefon + /// Customer mobile phone /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = ""; /// - /// firma email + /// Customer office email /// [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string Email { get; set; } = ""; /// - /// firma attention + /// Customer attention description /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Attention { get; set; } = ""; // Form entries /// - /// aktivitetstype + /// Activity type enum as string /// [Required(ErrorMessage = "Vælg aktivitetstype")] public string ActivityTypeEnum { get; set; } = ""; /// - /// acktivitet status + /// Activity status enum as string /// [Required(ErrorMessage = "Vælg status for besøg ")] public string ActivityStatusEnum { get; set; } = ""; /// - /// besøg type + /// Visit type enum as string /// public string VisitTypeEnum { get; set; } = "recall"; /// - /// aktivitet dato + /// Activity date /// [Required(ErrorMessage = "Dato skal angives")] public string ActivityDate { get; set; } = ""; /// - /// produkt demo + /// Product demonstration /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Demo { get; set; } = ""; /// - /// vores ref sættes til B:Fornavn + /// Our reference - system generated /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string OurRef { get; set; } = ""; /// - /// Rekvisitions nummer + /// Customer reference number /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ReferenceNumber { get; set; } = ""; /// - /// kunde person reference + /// Customer reference description /// [MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")] public string YourRef { get; set; } = ""; /// - /// note til kontoret + /// Processing note to office /// [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string OrderMessage { get; set; } = ""; /// - /// crm note + /// CRM note for future reference /// [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string CrmNote { get; set; } = ""; @@ -170,38 +170,38 @@ namespace Wonky.Entity.DTO // Delivery address form entries /// - /// leveringsnavn + /// Customer delivery name /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvName { get; set; } = ""; /// - /// levering adresse 1 + /// Customer delivery address line 1 /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvAddress1 { get; set; } = ""; /// - /// levering adresse 2 + /// Customer delivery address line 2 /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string DlvAddress2 { get; set; } = ""; /// - /// levering postnummer + /// Customer delivery postal code /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string DlvZipCode { get; set; } = ""; /// - /// levering bynavn + /// Customer delivery city name /// [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string DlvCity { get; set; } = ""; // Lines /// - /// varelinjer + /// Order lines /// public List Lines { get; set; } = new(); } diff --git a/Wonky.Entity/DTO/ActivityLineDto.cs b/Wonky.Entity/DTO/ActivityLineDto.cs index 17b53da9..2c6b8d81 100644 --- a/Wonky.Entity/DTO/ActivityLineDto.cs +++ b/Wonky.Entity/DTO/ActivityLineDto.cs @@ -16,13 +16,48 @@ namespace Wonky.Entity.DTO; public class ActivityLineDto { + /// + /// Item Sku + /// public string Sku { get; set; } = ""; + + /// + /// Description + /// public string Text { get; set; } = ""; + + /// + /// ShortName + /// public string ShortName { get; set; } = ""; + + /// + /// Quantity + /// public int Qty { get; set; } + + /// + /// Line price + /// public decimal Price { get; set; } + + /// + /// Line discount + /// public decimal Discount { get; set; } + + /// + /// Line amount + /// public decimal LineAmount { get; set; } + + /// + /// Line number + /// public int LineNumber { get; set; } + + /// + /// Sas indicator + /// public bool Sas { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/ActivityViewReport.cs b/Wonky.Entity/DTO/ActivityViewReport.cs new file mode 100644 index 00000000..a5ccf64b --- /dev/null +++ b/Wonky.Entity/DTO/ActivityViewReport.cs @@ -0,0 +1,62 @@ +using Wonky.Entity.Views; + +namespace Wonky.Entity.DTO; + +public class ActivityViewReport +{ + /// + /// Company Info in listing + /// + public ActivityViewCompany ViewCompany { get; set; } = new(); + + /// + /// Total amount + /// + public decimal OrderAmount { get; set; } + + /// + /// Sas amount + /// + public decimal SasAmount { get; set; } + + /// + /// Sales head entity Id + /// + public string SalesHeadId { get; set; } = ""; + + /// + /// Flag indicating if activity is a sale or a quote + /// + public bool Closed { get; set; } + + /// + /// Document date + /// + public string OrderDate { get; set; } = ""; + + /// + /// Client reference number + /// + public string ReferenceNumber { get; set; } = ""; + + /// + /// Client reference name + /// + public string YourRef { get; set; } = ""; + + /// + /// Visit type enum as string + /// + public string VisitTypeEnum { get; set; } = ""; + + /// + /// Demonstration + /// + public string Demo { get; set; } = ""; + + /// + /// Sales resume + /// + public string SalesResume { get; set; } = ""; +} + diff --git a/Wonky.Entity/DTO/AdminResetPasswordDto.cs b/Wonky.Entity/DTO/AdminResetPasswordDto.cs index 585b55ee..8689c72d 100644 --- a/Wonky.Entity/DTO/AdminResetPasswordDto.cs +++ b/Wonky.Entity/DTO/AdminResetPasswordDto.cs @@ -4,9 +4,15 @@ namespace Wonky.Entity.DTO; public class AdminResetPasswordDto { + /// + /// New password + /// [Required(ErrorMessage = "Kode skal udfyldes")] public string NewPassword { get; set; } = ""; + /// + /// Password confirmation + /// [Compare(nameof(NewPassword), ErrorMessage = "Koderne er ikke ens.")] public string ConfirmPassword { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/DTO/UserInfoAdminView.cs b/Wonky.Entity/DTO/AdminUserInfoDto.cs similarity index 63% rename from Wonky.Entity/DTO/UserInfoAdminView.cs rename to Wonky.Entity/DTO/AdminUserInfoDto.cs index 429b0aca..81fb521a 100644 --- a/Wonky.Entity/DTO/UserInfoAdminView.cs +++ b/Wonky.Entity/DTO/AdminUserInfoDto.cs @@ -2,34 +2,76 @@ using System.ComponentModel.DataAnnotations; namespace Wonky.Entity.DTO; -public class UserInfoAdminView +public class AdminUserInfoDto { + /// + /// First name + /// [Required(ErrorMessage = "Fornavn skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")] public string FirstName { get; set; } = ""; + /// + /// Last name + /// [Required(ErrorMessage = "Efternavn skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")] public string LastName { get; set; } = ""; + /// + /// Country code + /// [Required(ErrorMessage = "Landekode skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 3 tegn.")] public string CountryCode { get; set; } = ""; + /// + /// Email + /// [Required(ErrorMessage = "Email skal angives.")] [MaxLength(50, ErrorMessage = "Der kan højst bruges 80 tegn.")] public string Email { get; set; } = ""; + /// + /// Phone number + /// [MaxLength(20, ErrorMessage = "Der kan højst bruges 20 tegn.")] public string PhoneNumber { get; set; } = ""; + /// + /// Sales representative identification + /// [Required(ErrorMessage = "Sælger identifikation skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 20 tegn.")] public string Adviser { get; set; } = ""; + + /// + /// Country name + /// public string CountryName { get; set; } = ""; + + /// + /// Lockout flag + /// public bool LockoutEnabled { get; set; } + + /// + /// Email confirmed flag + /// public bool EmailConfirmed { get; set; } + + /// + /// Adviser flag + /// public bool IsAdviser { get; set; } + + /// + /// Admin flag + /// public bool IsAdmin { get; set; } + + /// + /// User Id + /// public string UserId { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/DTO/CompanyDto.cs b/Wonky.Entity/DTO/CompanyDto.cs index 4e5433ce..33141bbe 100644 --- a/Wonky.Entity/DTO/CompanyDto.cs +++ b/Wonky.Entity/DTO/CompanyDto.cs @@ -21,69 +21,147 @@ namespace Wonky.Entity.DTO; public class CompanyDto { - [Required(ErrorMessage = "Navn skal udfyldes")] - [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] - public string Name { get; set; } - - [Required(ErrorMessage = "Postnummer skal udfyldes")] - [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] - public string ZipCode { get; set; } - - [Required(ErrorMessage = "Bynavn skal udfyldes")] - [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] - public string City { get; set; } + /// + /// Name + /// + [Required(ErrorMessage = "Navn skal udfyldes")] + [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] + public string Name { get; set; } = ""; + + /// + /// Postal code + /// + [Required(ErrorMessage = "Postnummer skal udfyldes")] + [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] + public string ZipCode { get; set; } = ""; + + /// + /// City name + /// + [Required(ErrorMessage = "Bynavn skal udfyldes")] + [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] + public string City { get; set; } = ""; + /// + /// VAT number + /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string VatNumber { get; set; } = ""; + /// + /// Company Id + /// public string CompanyId { get; set; } = ""; + /// + /// Sales representative entity Id + /// public string SalesRepId { get; set; } = ""; - + /// + /// Business Central entity Id + /// public string BcId { get; set; } = ""; + /// + /// Office address 1 + /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Address1 { get; set; } = ""; + /// + /// Office address 2 + /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Address2 { get; set; } = ""; + /// + /// Account number + /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Account { get; set; } = ""; + /// + /// Phone number + /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = ""; + /// + /// Mobile phone number + /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = ""; + /// + /// Office email + /// [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string Email { get; set; } = ""; + /// + /// Attention + /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Attention { get; set; } = ""; + /// + /// Country code ISO + /// public string CountryCode { get; set; } = ""; - public string LastVisit { get; set; } = "1970-01-01"; + /// + /// Last visit + /// + public string LastVisit { get; set; } = "2010-01-01"; - public string NextVisit { get; set; } = "1970-01-01"; + /// + /// Next visit + /// + public string NextVisit { get; set; } = "2010-01-01"; + /// + /// Interval between visits + /// + /// between 1 and 52 (inclusive) default value is 8 [Range(1, 52, ErrorMessage = "Angiv interval mellem 1 og 52 uger")] public int Interval { get; set; } = 8; + /// + /// Value indication if company has shutdown + /// + /// 0 or 1 public int HasFolded { get; set; } + /// + /// User value for hiding the company is out of business + /// + /// 0 or 1 public int IsHidden { get; set; } - - public int ValidVat { get; set; } - - public int UpdateErpVat { get; set; } - public string HistorySync { get; set; } + /// + /// Value indicating the VAT number is valid + /// + /// 0 or 1 + public int ValidVat { get; set; } + + /// + /// Value indicating if VAT number has changed and should be written to ERP record + /// + /// 0 or 1 + public int UpdateErpVat { get; set; } + + /// + /// Date for last sync of product history + /// + public string HistorySync { get; set; } = ""; + + /// + /// Virtual property indicating if timespan is within the defined interval + /// + /// true/false public virtual bool ValidDateSpan() { - var notAllowed = new List {"1970-01-01", "0001-01-01"}; + var notAllowed = new List {"2010-01-01", "1970-01-01", "0001-01-01"}; if (notAllowed.Contains(LastVisit) || notAllowed.Contains(NextVisit)) return false; return DateTime.Parse(LastVisit) < DateTime.Parse(NextVisit); diff --git a/Wonky.Entity/DTO/KrvProductDto.cs b/Wonky.Entity/DTO/KrvProductDto.cs index 0a7d4b91..58e8a6d5 100644 --- a/Wonky.Entity/DTO/KrvProductDto.cs +++ b/Wonky.Entity/DTO/KrvProductDto.cs @@ -19,8 +19,23 @@ namespace Wonky.Entity.DTO; public class KrvProductDto { + /// + /// Product entity Id + /// [Required] public string ProductId { get; set; } = ""; + + /// + /// Trading name + /// [Required] public string TradingName { get; set; } = ""; + + /// + /// Picture url + /// [Required] public string PictureLink { get; set; } = ""; + + /// + /// Product category enum as string + /// [Required] public string ProductCategoryEnum { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/DTO/KrvVariantDto.cs b/Wonky.Entity/DTO/KrvVariantDto.cs index 0b21fd3e..e0caa8c9 100644 --- a/Wonky.Entity/DTO/KrvVariantDto.cs +++ b/Wonky.Entity/DTO/KrvVariantDto.cs @@ -19,12 +19,43 @@ namespace Wonky.Entity.DTO; public class KrvVariantDto { + /// + /// Variant entity id + /// [Required] public string VariantId { get; set; } = ""; + + /// + /// Vendor variant name + /// [Required] public string Name { get; set; } = ""; + + /// + /// Vendor variant SKU + /// [Required] public string Sku { get; set; } = ""; + + /// + /// ERP variant SKU + /// [Required] public string ErpSku { get; set; } = ""; + + /// + /// ERP variant name + /// [Required] public string ErpName { get; set; } = ""; + + /// + /// Variant short name + /// [Required] public string ShortName { get; set; } = ""; + + /// + /// Link to variant safety data sheet + /// [Required] public string SdsLink { get; set; } = ""; + + /// + /// Picture link + /// public string PictureLink { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/DTO/ReportActivityDto.cs b/Wonky.Entity/DTO/ReportActivityDto.cs deleted file mode 100644 index 11df7df9..00000000 --- a/Wonky.Entity/DTO/ReportActivityDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Wonky.Entity.DTO; - -public class ReportActivityDto -{ - public VisitCompanyDto Company { get; set; } = new(); - public string SalesHeadId { get; set; } = ""; - public bool Closed { get; set; } - public string OrderDate { get; set; } = ""; - public string ReferenceNumber { get; set; } = ""; - public string YourRef { get; set; } = ""; - public decimal OrderAmount { get; set; } - public string VisitTypeEnum { get; set; } = ""; - public string Demo { get; set; } = ""; - public string SalesResume { get; set; } = ""; -} - diff --git a/Wonky.Entity/DTO/ReportDto.cs b/Wonky.Entity/DTO/ReportDto.cs index f96a481a..31697aae 100644 --- a/Wonky.Entity/DTO/ReportDto.cs +++ b/Wonky.Entity/DTO/ReportDto.cs @@ -4,19 +4,42 @@ namespace Wonky.Entity.DTO; public class ReportDto { + /// + /// Report name + /// + /// System generated public string Name { get; set; } = ""; + /// + /// Report description + /// [MaxLength(1000, ErrorMessage = "Du kan højst bruge 1000 tegn")] public string Description { get; set; } = ""; + /// + /// Supervisor + /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string SupervisedBy { get; set; } = ""; + /// + /// Day type enum as string + /// [Required(ErrorMessage = "Dagtype skal angives")] public string DayTypeEnum { get; set; } = ""; - // Date interval (used for leave, sickLeave and work hours + /// + /// Report timespan - start date time + /// public string FromDateTime { get; set; } = ""; + + /// + /// Report timespan - end date time + /// public string ToDateTime { get; set; } = ""; + + /// + /// Report figures + /// public ReportFiguresDto Figures { get; set; } = new(); } diff --git a/Wonky.Entity/DTO/ReportFiguresDto.cs b/Wonky.Entity/DTO/ReportFiguresDto.cs index 2ddb0498..f1696363 100644 --- a/Wonky.Entity/DTO/ReportFiguresDto.cs +++ b/Wonky.Entity/DTO/ReportFiguresDto.cs @@ -2,46 +2,178 @@ namespace Wonky.Entity.DTO; public class ReportFiguresDto { + /// + /// Sales day number + /// public int SalesDayNumber { get; set; } + + /// + /// Distance today + /// public int Distance { get; set; } + + /// + /// Distance private (for company cars) + /// public int DistancePrivate { get; set; } + + /// + /// Odometer value evening + /// public int KmEvening { get; set; } + + /// + /// Odometer value morning + /// public int KmMorning { get; set; } + /// + /// Counter for new visits + /// public int NewVisitCount { get; set; } + + /// + /// Counter for product demonstration at new visit + /// public int NewDemoCount { get; set; } - public int RecallVisitCount { get; set; } - public int RecallDemoCount { get; set; } + + /// + /// Counter for product sale at new visit + /// public int NewSaleCount { get; set; } + + /// + /// Counter for recall visits + /// + public int RecallVisitCount { get; set; } + + /// + /// Counter for product demonstration at recall visit + /// + public int RecallDemoCount { get; set; } + + /// + /// Counter for product sale at recall visit + /// public int RecallSaleCount { get; set; } + /// + /// Counter for total number of visits for workday + /// public int TotalVisitCount { get; set; } + + /// + /// Counter for total number of product demonstration + /// public int TotalDemoCount { get; set; } + + /// + /// Count for total number of product sale + /// public int TotalSaleCount { get; set; } + + /// + /// Counter for the number of safe seal sale + /// public int SasCount { get; set; } - // turnover day + + /// + /// Turnover for new sale + /// public decimal NewTurnover { get; set; } + + /// + /// Turnover for recall sale + /// public decimal RecallTurnover { get; set; } + + /// + /// Turnover for safe seal sale + /// public decimal SasTurnover { get; set; } + + /// + /// Total turnover for work day + /// public decimal TotalTurnover { get; set; } - // month distance + + /// + /// Total distance for month + /// public int DistanceMonth { get; set; } + + /// + /// Total private distance for month (company cars) + /// public int DistancePrivateMonth { get; set; } - // mont counters + + /// + /// Counter for new visits month + /// public int NewVisitCountMonth { get; set; } + + /// + /// Counter for product demonstration at new visit month + /// public int NewDemoCountMonth { get; set; } + + /// + /// Counter for product sale at new visit month + /// public int NewSaleCountMonth { get; set; } + + /// + /// Counter for recall visit month + /// public int RecallVisitCountMonth { get; set; } + + /// + /// Counter for product demonstration at recall visit month + /// public int RecallDemoCountMonth { get; set; } + + /// + /// Counter for product sale at recall visit month + /// public int RecallSaleCountMonth { get; set; } - // month total counter + + /// + /// Counter for total number of visit month + /// public int TotalVisitCountMonth { get; set; } + + /// + /// Counter for total number of product demo month + /// public int TotalDemoCountMonth { get; set; } + + /// + /// Counter for total number of product sale month + /// public int TotalSaleCountMonth { get; set; } + + /// + /// Counter for total number safe seal sale month + /// public int SasCountMonth { get; set; } - // month turnover + + /// + /// Turnover total for new sale month + /// public decimal NewTurnoverMonth { get; set; } + + /// + /// Turnover total for recall sale month + /// public decimal RecallTurnoverMonth { get; set; } + + /// + /// Turnover total for safe seal sale month + /// public decimal SasTurnoverMonth { get; set; } + + /// + /// Turnover total for all sale month + /// public decimal TotalTurnoverMonth { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/ReportInitDto.cs b/Wonky.Entity/DTO/ReportInitDto.cs index b1545645..c9198cde 100644 --- a/Wonky.Entity/DTO/ReportInitDto.cs +++ b/Wonky.Entity/DTO/ReportInitDto.cs @@ -4,8 +4,19 @@ namespace Wonky.Entity.DTO; public class ReportInitDto { + /// + /// Flag to prevent activity to be added to report + /// public bool Closed { get; set; } + + /// + /// Report figures + /// public ReportFiguresDto Figures { get; set; } - public List Activities { get; set; } + + /// + /// List of activities for report + /// + public List Activities { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/TaskItemDto.cs b/Wonky.Entity/DTO/TaskItemDto.cs index e7a0cc22..8f257e33 100644 --- a/Wonky.Entity/DTO/TaskItemDto.cs +++ b/Wonky.Entity/DTO/TaskItemDto.cs @@ -2,13 +2,49 @@ namespace Wonky.Entity.DTO; public class TaskItemDto { + /// + /// Task item entity Id + /// public string TaskItemId { get; set; } = ""; + + /// + /// User entity Id + /// public string ErpUserId { get; set; } = ""; + + /// + /// Task name + /// public string Name { get; set; } = ""; + + /// + /// Task description + /// public string Text { get; set; } = ""; + + /// + /// Task due date + /// public string DueTimestamp { get; set; } = ""; + + /// + /// Task interval + /// public int Interval { get; set; } + + /// + /// Flag completed + /// public bool IsCompleted { get; set; } + + /// + /// Flag overdue + /// public bool OverDue { get; set; } - public bool Recurring { get; set; } + + /// + /// Recurring flag + /// + /// Interval != 0 + public virtual bool Recurring { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/UserAuthenticationDto.cs b/Wonky.Entity/DTO/UserAuthenticationDto.cs index 75af07a6..7c22135f 100644 --- a/Wonky.Entity/DTO/UserAuthenticationDto.cs +++ b/Wonky.Entity/DTO/UserAuthenticationDto.cs @@ -19,6 +19,12 @@ namespace Wonky.Entity.DTO; public class UserAuthenticationDto { + /// + /// User identification + /// [Required(ErrorMessage = "Email skal angives")] public string Email { get; set; } = ""; + /// + /// User passphrase + /// [Required(ErrorMessage = "Password skal angives")] public string Password { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/DTO/UserUpdateDto.cs b/Wonky.Entity/DTO/UserUpdateDto.cs index a22a7a01..02d1dc84 100644 --- a/Wonky.Entity/DTO/UserUpdateDto.cs +++ b/Wonky.Entity/DTO/UserUpdateDto.cs @@ -4,24 +4,42 @@ namespace Wonky.Entity.DTO; public class UserUpdateDto { + /// + /// User firstname + /// [Required(ErrorMessage = "Fornavn skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")] public string FirstName { get; set; } = ""; + /// + /// User lastname + /// [Required(ErrorMessage = "Efternavn skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")] public string LastName { get; set; } = ""; + /// + /// User Country Code + /// [Required(ErrorMessage = "Landekode skal angives.")] [MaxLength(50,ErrorMessage = "Der kan højst bruges 3 tegn.")] public string CountryCode { get; set; } = ""; + /// + /// User email - used for login + /// [Required(ErrorMessage = "Email skal angives.")] [MaxLength(50, ErrorMessage = "Der kan højst bruges 80 tegn.")] public string Email { get; set; } = ""; + /// + /// User phone number + /// [MaxLength(20, ErrorMessage = "Der kan højst bruges 20 tegn.")] public string PhoneNumber { get; set; } = ""; + /// + /// Lock user + /// [Required] public bool LockoutEnabled { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/DTO/VisitCompanyDto.cs b/Wonky.Entity/DTO/VisitCompanyDto.cs deleted file mode 100644 index bbbdede4..00000000 --- a/Wonky.Entity/DTO/VisitCompanyDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Wonky.Entity.DTO; - -public class VisitCompanyDto -{ - public string CompanyId { get; set; } = ""; - public string Account { get; set; } = ""; - public string Name { get; set; } = ""; - public string ZipCity { get; set; } = ""; - public string Phone { get; set; } = ""; - public string VatNumber { get; set; } = ""; -} \ No newline at end of file diff --git a/Wonky.Entity/Models/TimeFrame.cs b/Wonky.Entity/Models/TimeFrame.cs index 9fbaf338..d2c295a0 100644 --- a/Wonky.Entity/Models/TimeFrame.cs +++ b/Wonky.Entity/Models/TimeFrame.cs @@ -16,6 +16,13 @@ namespace Wonky.Entity.Models; public class TimeFrame { + /// + /// Start date + /// public string StartDate { get; set; } = ""; + + /// + /// End date + /// public string EndDate { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/Models/VatLifeCycle.cs b/Wonky.Entity/Models/VatLifeCycle.cs index ba94b0e5..8ff39248 100644 --- a/Wonky.Entity/Models/VatLifeCycle.cs +++ b/Wonky.Entity/Models/VatLifeCycle.cs @@ -2,7 +2,14 @@ namespace Wonky.Entity.Models; public class VatLifeCycle { + /// + /// Last update of the lifecycle + /// public string LastUpdate { get; set; } = ""; + + /// + /// Time frame of lifecycle + /// public TimeFrame TimeFrame { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Entity/Models/VatRegState.cs b/Wonky.Entity/Models/VatRegState.cs index 89dcff1d..fb4e5184 100644 --- a/Wonky.Entity/Models/VatRegState.cs +++ b/Wonky.Entity/Models/VatRegState.cs @@ -16,7 +16,18 @@ namespace Wonky.Entity.Models; public class VatRegState { + /// + /// VAT number state + /// public string State { get; set; } = "UKENDT"; + + /// + /// Last update of VAT state + /// public string LastUpdate { get; set; } = ""; + + /// + /// Timeframe for VAT state + /// public TimeFrame TimeFrame { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Entity/Models/VirkRegInfo.cs b/Wonky.Entity/Models/VirkRegInfo.cs index 8e43709e..578d040a 100644 --- a/Wonky.Entity/Models/VirkRegInfo.cs +++ b/Wonky.Entity/Models/VirkRegInfo.cs @@ -19,13 +19,47 @@ namespace Wonky.Entity.Models; public class VirkRegInfo { + /// + /// VAT number + /// public string VatNumber { get; set; } = ""; + + /// + /// Entity registration name + /// public string Name { get; set; } = ""; + /// + /// Entity address C/O name + /// public string CoName { get; set; } = ""; + + /// + /// Entity address line + /// public string Address { get; set; } = ""; + + /// + /// Entity address city name + /// public string City { get; set; } = ""; + + /// + /// Entity address postal code + /// public string ZipCode { get; set; } = ""; + + /// + /// List of VAT entity states + /// public List States { get; set; } = new (); + + /// + /// List of VAT entity lifecycles + /// public List LifeCycles { get; set; } = new (); + + /// + /// Date for last request of entity VAT state + /// public string RequestDate { get; set; } = "" ; } \ No newline at end of file diff --git a/Wonky.Entity/Requests/ActivityPagingParams.cs b/Wonky.Entity/Requests/ActivityPagingParams.cs deleted file mode 100644 index 0b4833c3..00000000 --- a/Wonky.Entity/Requests/ActivityPagingParams.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// 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.Requests; - -public class ActivityPagingParams -{ - private int _pageSize = 5; - private const int MaxPageSize = 50; - public int PageNumber { get; set; } = 1; - public int PageSize - { - get => _pageSize; - set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value; - } - public string SearchTerm { get; set; } = ""; - public string SearchColumn { get; set; } = "name"; - public string OrderBy { get; set; } = "name"; -} \ No newline at end of file diff --git a/Wonky.Entity/Requests/CatalogPagingParams.cs b/Wonky.Entity/Requests/CatalogPagingParams.cs index 4ed8d661..a3eee238 100644 --- a/Wonky.Entity/Requests/CatalogPagingParams.cs +++ b/Wonky.Entity/Requests/CatalogPagingParams.cs @@ -16,16 +16,47 @@ namespace Wonky.Entity.Requests; public class CatalogPagingParams { + /// + /// internal default page size + /// private int _pageSize = 5; + + /// + /// internal max page size + /// private const int MaxPageSize = 50; + + /// + /// Set the page number to return + /// public int PageNumber { get; set; } = 1; + + /// + /// Set the page size to return + /// public int PageSize { get => _pageSize; set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value; } + + /// + /// Set the search term to use + /// public string SearchTerm { get; set; } = ""; + + /// + /// Set the column used for search + /// public string SearchColumn { get; set; } = "name"; + + /// + /// Set column used to order the result + /// public string OrderBy { get; set; } = "name"; + + /// + /// Set product group filter + /// public string SelectGroup { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/Requests/CompanyPagingParams.cs b/Wonky.Entity/Requests/CompanyPagingParams.cs index 31ac49eb..4d65f6ff 100644 --- a/Wonky.Entity/Requests/CompanyPagingParams.cs +++ b/Wonky.Entity/Requests/CompanyPagingParams.cs @@ -16,19 +16,58 @@ namespace Wonky.Entity.Requests; public class CompanyPagingParams { + /// + /// internal default page size + /// private int _pageSize = 5; + + /// + /// internal max page size + /// private const int MaxPageSize = 50; + + /// + /// Set the page number to return + /// public int PageNumber { get; set; } = 1; + + /// + /// Set the page size to return + /// public int PageSize { get => _pageSize; set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value; } + + /// + /// Set the search term to use + /// public string SearchTerm { get; set; } = ""; + + /// + /// Set the column to use for searching + /// public string SearchColumn { get; set; } = "name"; + + /// + /// Set the column for ordering the result + /// public string OrderBy { get; set; } = "name"; + + /// + /// Optional limit the result + /// public string FromDate { get; set; } = ""; + + /// + /// Set a flag to include hidden entities + /// public int IsHidden { get; set; } + + /// + /// Set a flag to include entities which has gone out of business + /// public int HasFolded { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/Requests/MetaData.cs b/Wonky.Entity/Requests/MetaData.cs index 6469741e..a6bc1865 100644 --- a/Wonky.Entity/Requests/MetaData.cs +++ b/Wonky.Entity/Requests/MetaData.cs @@ -16,10 +16,33 @@ namespace Wonky.Entity.Requests; public class MetaData { + /// + /// The current page number + /// public int CurrentPage { get; set; } + + /// + /// The current total number of pages + /// public int TotalPages { get; set; } + + /// + /// The current page size + /// public int PageSize { get; set; } + + /// + /// The total count of entities available + /// public int TotalCount { get; set; } + + /// + /// Navigation flag - move previous + /// public bool HasPrevious => CurrentPage > 1; + + /// + /// Navigation flag - move next + /// public bool HasNext => CurrentPage < TotalPages; } \ No newline at end of file diff --git a/Wonky.Entity/Requests/ReportPagingParams.cs b/Wonky.Entity/Requests/ReportPagingParams.cs deleted file mode 100644 index 14fa749b..00000000 --- a/Wonky.Entity/Requests/ReportPagingParams.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// 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.Requests; - -public class ReportPagingParams -{ - private int _pageSize = 5; - private const int MaxPageSize = 50; - public int PageNumber { get; set; } = 1; - public int PageSize - { - get => _pageSize; - set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value; - } - public string SearchTerm { get; set; } = ""; - public string SearchColumn { get; set; } = "name"; - public string OrderBy { get; set; } = "name"; -} \ No newline at end of file diff --git a/Wonky.Entity/Requests/VirkParams.cs b/Wonky.Entity/Requests/VirkParams.cs index e837fb90..19f7ba15 100644 --- a/Wonky.Entity/Requests/VirkParams.cs +++ b/Wonky.Entity/Requests/VirkParams.cs @@ -16,8 +16,31 @@ namespace Wonky.Entity.Requests; public class VirkParams { + /// + /// Entity VAT number search + /// public string VatNumber { get; set; } = ""; + + /// + /// Address search - street name + /// + /// StreetName, HouseNumber, ZipCode are required for address search public string StreetName { get; set; } = ""; + + /// + /// Address search house number + /// + /// StreetName, HouseNumber, ZipCode are required for address search public string HouseNumber { get; set; } = ""; + + /// + /// Address search postal code + /// + /// StreetName, HouseNumber, ZipCode are required for address search public string ZipCode { get; set; } = ""; + + /// + /// Entity name search + /// + public string EntityName { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/Views/ActivityListReportView.cs b/Wonky.Entity/Views/ActivityListReportView.cs new file mode 100644 index 00000000..da01fa06 --- /dev/null +++ b/Wonky.Entity/Views/ActivityListReportView.cs @@ -0,0 +1,7 @@ +namespace Wonky.Entity.Views; + +public class ActivityListReportView +{ + public bool ReportClosed { get; set; } + public List Activities { get; set; } = new(); +} \ No newline at end of file diff --git a/Wonky.Entity/Views/NgActivityReportView.cs b/Wonky.Entity/Views/ActivityReportView.cs similarity index 79% rename from Wonky.Entity/Views/NgActivityReportView.cs rename to Wonky.Entity/Views/ActivityReportView.cs index 73d421a6..4c7ecef9 100644 --- a/Wonky.Entity/Views/NgActivityReportView.cs +++ b/Wonky.Entity/Views/ActivityReportView.cs @@ -1,8 +1,8 @@ namespace Wonky.Entity.Views; -public class NgActivityReportView +public class ActivityReportView { - public ActivityCompanyView Company { get; set; } = new(); + public ActivityViewCompany ViewCompany { get; set; } = new(); public string SalesHeadId { get; set; } = ""; public string OfficeNote { get; set; } = ""; public string StatusTypeEnum { get; set; } = ""; @@ -11,6 +11,7 @@ public class NgActivityReportView public string ReferenceNumber { get; set; } = ""; public string YourRef { get; set; } = ""; public decimal OrderAmount { get; set; } + public decimal SasAmount { get; set; } public string VisitTypeEnum { get; set; } = ""; public string Demo { get; set; } = ""; public string SalesResume { get; set; } = ""; diff --git a/Wonky.Entity/Views/ActivityCompanyView.cs b/Wonky.Entity/Views/ActivityViewCompany.cs similarity index 90% rename from Wonky.Entity/Views/ActivityCompanyView.cs rename to Wonky.Entity/Views/ActivityViewCompany.cs index 9c4b15a8..7017a90b 100644 --- a/Wonky.Entity/Views/ActivityCompanyView.cs +++ b/Wonky.Entity/Views/ActivityViewCompany.cs @@ -1,6 +1,6 @@ namespace Wonky.Entity.Views; -public class ActivityCompanyView +public class ActivityViewCompany { public string CompanyId { get; set; } = ""; public string Account { get; set; } = ""; diff --git a/Wonky.Entity/Views/ApiResponse.cs b/Wonky.Entity/Views/ApiResponse.cs deleted file mode 100644 index 45fca035..00000000 --- a/Wonky.Entity/Views/ApiResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// 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] -// - -using System.Net; - -namespace Wonky.Entity.Views; - -public class ApiResponse -{ - public bool IsSuccess { get; set; } - public HttpStatusCode Code { get; set; } - public string Message { get; set; } = ""; - public string Id { get; set; } = ""; -} \ No newline at end of file diff --git a/Wonky.Entity/Views/ApiResponseView.cs b/Wonky.Entity/Views/ApiResponseView.cs index 650d9a81..9556dfed 100644 --- a/Wonky.Entity/Views/ApiResponseView.cs +++ b/Wonky.Entity/Views/ApiResponseView.cs @@ -13,10 +13,14 @@ // along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] // +using System.Net; + namespace Wonky.Entity.Views; public class ApiResponseView { public bool IsSuccess { get; set; } - public IEnumerable? Errors { get; set; } + public HttpStatusCode Code { get; set; } + public string Message { get; set; } = ""; + public string Id { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Entity/Views/CreateCompanyResponseView.cs b/Wonky.Entity/Views/CreateCompanyResponseView.cs deleted file mode 100644 index 64773270..00000000 --- a/Wonky.Entity/Views/CreateCompanyResponseView.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// 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.Views; - -public class CreateCompanyResponseView -{ - -} \ No newline at end of file diff --git a/Wonky.Entity/Views/NgActivityListReportView.cs b/Wonky.Entity/Views/NgActivityListReportView.cs deleted file mode 100644 index 00bef826..00000000 --- a/Wonky.Entity/Views/NgActivityListReportView.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Wonky.Entity.Views; - -public class NgActivityListReportView -{ - public bool ReportClosed { get; set; } - public List Activities { get; set; } = new(); -} \ No newline at end of file diff --git a/Wonky.Entity/Views/NgSalesReportView.cs b/Wonky.Entity/Views/NgSalesReportView.cs index 1d8a287b..d18c2d0b 100644 --- a/Wonky.Entity/Views/NgSalesReportView.cs +++ b/Wonky.Entity/Views/NgSalesReportView.cs @@ -3,5 +3,5 @@ namespace Wonky.Entity.Views; public class NgSalesReportView { public NgSalesReport Report { get; set; } = new(); - public List Activities { get; set; } = new (); + public List Activities { get; set; } = new (); } \ No newline at end of file diff --git a/Wonky.Entity/DTO/ProductHistoryView.cs b/Wonky.Entity/Views/ProductHistoryView.cs similarity index 90% rename from Wonky.Entity/DTO/ProductHistoryView.cs rename to Wonky.Entity/Views/ProductHistoryView.cs index d76d2fdf..f14104bc 100644 --- a/Wonky.Entity/DTO/ProductHistoryView.cs +++ b/Wonky.Entity/Views/ProductHistoryView.cs @@ -1,4 +1,4 @@ -namespace Wonky.Entity.DTO; +namespace Wonky.Entity.Views; public class ProductHistoryView { diff --git a/Wonky.Entity/DTO/ProductInventoryView.cs b/Wonky.Entity/Views/ProductInventoryView.cs similarity index 71% rename from Wonky.Entity/DTO/ProductInventoryView.cs rename to Wonky.Entity/Views/ProductInventoryView.cs index e203b2e4..401d2081 100644 --- a/Wonky.Entity/DTO/ProductInventoryView.cs +++ b/Wonky.Entity/Views/ProductInventoryView.cs @@ -1,6 +1,4 @@ -using System.Text.Json.Serialization; - -namespace Wonky.Entity.DTO; +namespace Wonky.Entity.Views; public class ProductInventoryView { diff --git a/Wonky.Entity/Views/NgSalesItemView.cs b/Wonky.Entity/Views/SalesItemView.cs similarity index 92% rename from Wonky.Entity/Views/NgSalesItemView.cs rename to Wonky.Entity/Views/SalesItemView.cs index 82103490..dacdcdf4 100644 --- a/Wonky.Entity/Views/NgSalesItemView.cs +++ b/Wonky.Entity/Views/SalesItemView.cs @@ -15,7 +15,7 @@ namespace Wonky.Entity.Views; -public class NgSalesItemView +public class SalesItemView { public string ItemId { get; set; } = ""; public string Name { get; set; } = ""; @@ -23,5 +23,5 @@ public class NgSalesItemView public string ShortName { get; set; } = ""; public string ProductGroup { get; set; } = ""; public string PictureLink { get; set; } = ""; - public List Rates { get; set; } = new(); + public List Rates { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Entity/Views/NgSalesRateView.cs b/Wonky.Entity/Views/SalesRateView.cs similarity index 96% rename from Wonky.Entity/Views/NgSalesRateView.cs rename to Wonky.Entity/Views/SalesRateView.cs index 0403a584..c0abbb8a 100644 --- a/Wonky.Entity/Views/NgSalesRateView.cs +++ b/Wonky.Entity/Views/SalesRateView.cs @@ -14,7 +14,7 @@ // namespace Wonky.Entity.Views; -public class NgSalesRateView +public class SalesRateView { public string Quantity { get; set; } = ""; public string Rate { get; set; } = ""; diff --git a/Wonky.Entity/DTO/UserInfoDto.cs b/Wonky.Entity/Views/UserInfoView.cs similarity index 98% rename from Wonky.Entity/DTO/UserInfoDto.cs rename to Wonky.Entity/Views/UserInfoView.cs index 66166e71..46fa0017 100644 --- a/Wonky.Entity/DTO/UserInfoDto.cs +++ b/Wonky.Entity/Views/UserInfoView.cs @@ -15,7 +15,7 @@ using System.Text.Json.Serialization; -namespace Wonky.Entity.DTO; +namespace Wonky.Entity.Views; public class UserInfoView { diff --git a/Wonky.Entity/DTO/UserListAdminView.cs b/Wonky.Entity/Views/UserListAdminView.cs similarity index 91% rename from Wonky.Entity/DTO/UserListAdminView.cs rename to Wonky.Entity/Views/UserListAdminView.cs index fa70f123..95399589 100644 --- a/Wonky.Entity/DTO/UserListAdminView.cs +++ b/Wonky.Entity/Views/UserListAdminView.cs @@ -1,4 +1,4 @@ -namespace Wonky.Entity.DTO; +namespace Wonky.Entity.Views; public class UserListAdminView {