added xml comments to objects

This commit is contained in:
Frede Hundewadt 2022-07-01 10:02:29 +02:00
parent 647e37e539
commit 9d161671a0
94 changed files with 1241 additions and 486 deletions

View file

@ -20,7 +20,8 @@
<table class="table table-bordered d-print-table table-striped">
<thead>
<tr class="bg-black opacity-75 text-white border-bottom">
<th scope="col">Besøg</th>
<th scope="col">Kunde</th>
<th scope0="col">Bynavn</th>
<th scope="col">Demo</th>
<th scope="col">Salg</th>
<th scope="col">Notat</th>
@ -32,11 +33,11 @@
@foreach (var activity in Activities)
{
<tr>
<td>@activity.Company.Name, @activity.Company.ZipCity</td>
<td>@activity.ViewCompany.Name, @activity.ViewCompany.ZipCity</td>
<td>@activity.Demo</td>
<td>@activity.SalesResume</td>
<td>@activity.OfficeNote</td>
<td>@(activity.StatusTypeEnum == "Quote" ? "Tilbud" : "Salg")</td>
<td class="text-end">@activity.</td>
<td class="text-end">@(activity.Closed ? @activity.OrderAmount : 0)</td>
</tr>
}

View file

@ -5,5 +5,5 @@ namespace Wonky.Client.Components;
public partial class ActivityTableComponent
{
[Parameter] public List<NgActivityReportView> Activities { get; set; }
[Parameter] public List<ActivityReportView> Activities { get; set; }
}

View file

@ -1,4 +1,4 @@
@if (ReportList.Any())
@if (ReportList != null)
{
<div class="list-group list-group-flush">
<div class="list-group-item px-3 bg-black text-white opacity-75">
@ -65,9 +65,7 @@
}
else
{
<div class="row">
<div class="col">
Ingen data
</div>
<div>
Ingen data
</div>
}

View file

@ -5,7 +5,12 @@ namespace Wonky.Client.Components;
public partial class AdminReportTableComponent
{
[Parameter] public List<NgSalesReportListView> ReportList { get; set; } = new();
[Parameter] public List<NgSalesReportListView> ReportList { get; set; }
[Parameter] public string UserId { get; set; } = "";
[Parameter] public string CountryCode { get; set; } = "";
protected override void OnParametersSet()
{
base.OnParametersSet();
}
}

View file

@ -27,7 +27,9 @@ public partial class ItemGroupComponent
[Parameter] public EventCallback<string> OnChanged { get; set; }
private Dictionary<string, string> Items { get; set; } = new();
private Preferences _preferences = new();
private string? Selection { get; set; }
private async Task OnSelectionChanged(ChangeEventArgs e)
{
var val = e.Value.ToString();

View file

@ -15,7 +15,7 @@
//
*@
<select class="form-select" @bind-value="@Selection" @bind-value:event="oninput" @onchange="OnSelectChanged">
<select class="form-select" @bind-value="@_selectedItem" @bind-value:event="oninput" @onchange="OnSelectChanged">
<option value="-1" selected disabled>SØGNING</option>
<option value="name">Navn</option>
<option value="sku">Nummer</option>

View file

@ -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; }
/// <summary>
/// User preference service
/// </summary>
[Inject] private UserPreferenceService _preferenceService { get; set; }
/// <summary>
/// OnChanged event callback
/// </summary>
[Parameter] public EventCallback<string> OnChanged { get; set; }
private Dictionary<string, string> Items { get; set; } = new();
/// <summary>
/// User preferences
/// </summary>
private Preferences _preferences = new();
private string? Selection { get; set; }
/// <summary>
/// Selected item
/// </summary>
private string _selectedItem { get; set; } = "";
/// <summary>
/// Component initialization
/// </summary>
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;
}
/// <summary>
/// OnSelectChanged event handler
/// </summary>
/// <param name="e"></param>
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);
}
/// <summary>
/// Preference update from profile service
/// </summary>
/// <param name="newPreferences"></param>
private void ProfileServiceOnOnChange(Preferences newPreferences)
{
_preferences = newPreferences;
StateHasChanged();
}
/// <summary>
/// Component dispose
/// </summary>
public void Dispose()
{
UserPreferenceService.OnChange -= ProfileServiceOnOnChange;
_preferenceService.OnChange -= ProfileServiceOnOnChange;
}
}

View file

@ -15,7 +15,7 @@
//
*@
<select class="form-select" @bind-value="@Selection" @bind-value:event="oninput" @onchange="OnSelectChanged">
<select class="form-select" @bind-value="@_selectedItem" @bind-value:event="oninput" @onchange="OnSelectChanged">
<option value="-1" selected disabled>SORTERING</option>
<option value="name">Navn</option>
<option value="sku">Nummer</option>

View file

@ -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; }
/// <summary>
/// User preference service
/// </summary>
[Inject] private UserPreferenceService _preferenceService { get; set; }
/// <summary>
/// OnChanged callback function
/// </summary>
[Parameter] public EventCallback<string> OnChanged { get; set; }
private Dictionary<string, string> Items { get; set; } = new();
/// <summary>
/// User's preferences
/// </summary>
private Preferences _preferences = new();
private string? Selection { get; set; }
/// <summary>
/// Item selected by user
/// </summary>
private string? _selectedItem { get; set; }
/// <summary>
/// Component initialization
/// </summary>
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;
}
/// <summary>
/// OnSelectChanged trigger
/// </summary>
/// <param name="e"></param>
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);
}
/// <summary>
/// Get updated settings from preference service
/// </summary>
/// <param name="newPreferences"></param>
private void ProfileServiceOnOnChange(Preferences newPreferences)
{
_preferences = newPreferences;
StateHasChanged();
}
/// <summary>
/// Component dispose
/// </summary>
public void Dispose()
{
UserPreferenceService.OnChange -= ProfileServiceOnOnChange;
_preferenceService.OnChange -= ProfileServiceOnOnChange;
}
}

View file

@ -23,7 +23,7 @@ namespace Wonky.Client.Components;
public partial class ItemTableComponent
{
[Parameter] public List<NgSalesItemView> SalesItems { get; set; } = new();
[Parameter] public List<SalesItemView> SalesItems { get; set; } = new();
[Inject] private IToastService ToastService { get; set; }
private void AddToDraft()
{

View file

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.Components;

View file

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.Components;

View file

@ -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]
//
*@
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom">
<th></th>
<th class="text-center" colspan="2" scope="col">Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)</th>
<th class="text-center border-end" colspan="2" scope="col">Dagens Resultat</th>
<th class="text-center" colspan="4" scope="col">Måneds Resultat</th>
</tr>
</thead>
<tbody>
<tr class="bg-dark bg-opacity-50 border-bottom">
<td></td>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white border-end" scope="col">Beløb</th>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white" scope="col">Beløb</th>
</tr>
<tr>
<th scope="row">N</th>
<td class="text-end">@Report.NewVisitCount</td>
<td class="text-end">@Report.NewDemoCount</td>
<td class="text-end">@Report.NewSaleCount</td>
<td class="text-end border-end">@Report.NewTurnover</td>
<td class="text-end">@Report.NewVisitCountMonth</td>
<td class="text-end">@Report.NewDemoCountMonth</td>
<td class="text-end">@Report.NewSaleCountMonth</td>
<td class="text-end">@Report.NewTurnoverMonth</td>
</tr>
<tr>
<th scope="row">R</th>
<td class="text-end">@Report.RecallVisitCount</td>
<td class="text-end">@Report.RecallDemoCount</td>
<td class="text-end">@Report.RecallSaleCount</td>
<td class="text-end border-end">@Report.RecallTurnover</td>
<td class="text-end">@Report.RecallVisitCountMonth</td>
<td class="text-end">@Report.RecallDemoCountMonth</td>
<td class="text-end">@Report.RecallSaleCountMonth</td>
<td class="text-end">@Report.RecallTurnoverMonth</td>
</tr>
<tr>
<th scope="row">SAS</th>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end">@Report.SasCount</td>
<td class="text-end border-end">@Report.SasTurnover</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end">@Report.SasCountMonth</td>
<td class="text-end">@Report.SasTurnoverMonth</td>
</tr>
<tr>
<th scope="row">TOTAL</th>
<td class="text-end">@Report.TotalVisitCount</td>
<td class="text-end">@Report.TotalDemoCount</td>
<td class="text-end">@Report.TotalSaleCount</td>
<td class="text-end border-end">@Report.TotalTurnover</td>
<td class="text-end">@Report.TotalVisitCountMonth</td>
<td class="text-end">@Report.TotalDemoCountMonth</td>
<td class="text-end">@Report.TotalSaleCountMonth</td>
<td class="text-end">@Report.TotalTurnoverMonth</td>
</tr>
</tbody>
</table>

View file

@ -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; }
}

View file

@ -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]
//
*@
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom-0">
<th scope="col">
Km Aften
</th>
<th scope="col">
Km Morgen
</th>
<th scope="col">
Km Kørt Dag
</th>
<th scope="col">
Km Kørt Md.
</th>
<th scope="col">
Km Privat
</th>
<th scope="col">
Km Privat Md.
</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Report.KmEvening</td>
<td>@Report.KmMorning</td>
<td>@Report.Distance</td>
<td>@Report.DistanceMonth</td>
<td>@Report.DistancePrivate</td>
<td>@Report.DistancePrivateMonth</td>
</tr>
</tbody>
</table>

View file

@ -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; }
}

View file

@ -15,108 +15,6 @@
//
*@
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom">
<th></th>
<th class="text-center" colspan="2" scope="col">Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)</th>
<th class="text-center border-end" colspan="2" scope="col">Dagens Resultat</th>
<th class="text-center" colspan="4" scope="col">Måneds Resultat</th>
</tr>
</thead>
<tbody>
<tr class="bg-dark bg-opacity-50 border-bottom">
<td></td>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white border-end" scope="col">Beløb</th>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white" scope="col">Beløb</th>
</tr>
<tr>
<th scope="row">N</th>
<td class="text-end">@Report.NewVisitCount</td>
<td class="text-end">@Report.NewDemoCount</td>
<td class="text-end">@Report.NewSaleCount</td>
<td class="text-end border-end">@Report.NewTurnover</td>
<td class="text-end">@Report.NewVisitCountMonth</td>
<td class="text-end">@Report.NewDemoCountMonth</td>
<td class="text-end">@Report.NewSaleCountMonth</td>
<td class="text-end">@Report.NewTurnoverMonth</td>
</tr>
<tr>
<th scope="row">R</th>
<td class="text-end">@Report.RecallVisitCount</td>
<td class="text-end">@Report.RecallDemoCount</td>
<td class="text-end">@Report.RecallSaleCount</td>
<td class="text-end border-end">@Report.RecallTurnover</td>
<td class="text-end">@Report.RecallVisitCountMonth</td>
<td class="text-end">@Report.RecallDemoCountMonth</td>
<td class="text-end">@Report.RecallSaleCountMonth</td>
<td class="text-end">@Report.RecallTurnoverMonth</td>
</tr>
<tr>
<th scope="row">SAS</th>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end">@Report.SasCount</td>
<td class="text-end border-end">@Report.SasTurnover</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end">@Report.SasCountMonth</td>
<td class="text-end">@Report.SasTurnoverMonth</td>
</tr>
<tr>
<th scope="row">TOTAL</th>
<td class="text-end">@Report.TotalVisitCount</td>
<td class="text-end">@Report.TotalDemoCount</td>
<td class="text-end">@Report.TotalSaleCount</td>
<td class="text-end border-end">@Report.TotalTurnover</td>
<td class="text-end">@Report.TotalVisitCountMonth</td>
<td class="text-end">@Report.TotalDemoCountMonth</td>
<td class="text-end">@Report.TotalSaleCountMonth</td>
<td class="text-end">@Report.TotalTurnoverMonth</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom-0">
<th scope="col">
Km Aften
</th>
<th scope="col">
Km Morgen
</th>
<th scope="col">
Km Kørt Dag
</th>
<th scope="col">
Km Kørt Md.
</th>
<th scope="col">
Km Privat
</th>
<th scope="col">
Km Privat Md.
</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Report.KmEvening</td>
<td>@Report.KmMorning</td>
<td>@Report.Distance</td>
<td>@Report.DistanceMonth</td>
<td>@Report.DistancePrivate</td>
<td>@Report.DistancePrivateMonth</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-black text-white opacity-75 border-bottom">
@ -131,3 +29,4 @@
</tr>
</tbody>
</table>

View file

@ -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<string> 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);
}

View file

@ -2,4 +2,4 @@
@using Wonky.Client.Services
<input type="date" class="form-control"
@bind-Value="_selectedDate" @bind-Value:event="oninput" @onchange="OnDateChanged" />
@bind-Value="SelectedDate" @bind-Value:event="oninput" @onchange="OnDateChanged" />

View file

@ -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; }
/// <summary>
/// User preference service
/// </summary>
[Inject] private UserPreferenceService UserPrefs { get; set; }
[Parameter] public EventCallback<string> OnChanged { get; set; }
private Preferences _prefs = new();
private string _selectedDate = $"{DateOnly.FromDateTime(DateTime.Now):yyyy-MM-dd}";
/// <summary>
/// OnChanged callback function
/// </summary>
[Parameter] public EventCallback<string> OnChanged { get; set; }
/// <summary>
/// Selected data
/// </summary>
[Parameter] public string SelectedDate { get; set; } = $"{DateOnly.FromDateTime(DateTime.Now):yyyy-MM-dd}";
/// <summary>
/// user preferences
/// </summary>
private Preferences _prefs = new();
/// <summary>
/// Component Initialization
/// </summary>
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;
}
/// <summary>
/// OnDateChanged function call to invoke the event callback
/// </summary>
/// <param name="e"></param>
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);
}
/// <summary>
///
/// </summary>
/// <param name="newPreferences"></param>
private void ProfileServiceOnOnChange(Preferences newPreferences)
{
_prefs = newPreferences;
StateHasChanged();
}
/// <summary>
/// Component dispose
/// </summary>
public void Dispose()
{
UserPrefs.OnChange -= ProfileServiceOnOnChange;

View file

@ -54,46 +54,22 @@ public class ActivityHttpRepository : IActivityHttpRepository
_apiConfig = configuration.Value;
}
public async Task<NgActivityListReportView> GetActivities(string activityDate)
public async Task<ActivityListReportView> 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<NgActivityListReportView>(content, _options);
? new ActivityListReportView()
: JsonSerializer.Deserialize<ActivityListReportView>(content, _options);
}
public async Task<PagingResponse<ActivityDto>> GetActivityPaged(ActivityPagingParams pagingParameters)
{
var queryString = new Dictionary<string, string>
{
["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<ActivityDto>
{
Items = JsonSerializer.Deserialize<List<ActivityDto>>(content, _options),
MetaData = JsonSerializer.Deserialize<MetaData>(
response.Headers.GetValues("X-Pagination").First(), _options)
};
return pagingResponse;
}
public async Task<ApiResponse> CreateActivity(ActivityDto model)
public async Task<ApiResponseView> 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<ApiResponse>(content);
var result = JsonSerializer.Deserialize<ApiResponseView>(content);
return result!;
}
@ -104,12 +80,12 @@ public class ActivityHttpRepository : IActivityHttpRepository
return salesItem ?? new ActivityDto();
}
public async Task<ApiResponse> AcceptOffer(string id)
public async Task<ApiResponseView> AcceptOffer(string id)
{
var response = await _client.PostAsJsonAsync($"{_apiConfig.ActivityUri}/{id}/accept", id)
;
var content = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<ApiResponse>(content);
var result = JsonSerializer.Deserialize<ApiResponseView>(content);
return result!;
}
}

View file

@ -24,9 +24,8 @@ namespace Wonky.Client.HttpRepository;
public interface IActivityHttpRepository
{
Task<PagingResponse<ActivityDto>> GetActivityPaged(ActivityPagingParams pagingParameters);
Task<ActivityDto> GetActivity(string id);
Task<ApiResponse> CreateActivity(ActivityDto model);
Task<ApiResponse> AcceptOffer(string id);
Task<NgActivityListReportView> GetActivities(string activityDate);
Task<ApiResponseView> CreateActivity(ActivityDto model);
Task<ApiResponseView> AcceptOffer(string id);
Task<ActivityListReportView> GetActivities(string activityDate);
}

View file

@ -1,5 +1,6 @@
using Wonky.Client.Pages;
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.HttpRepository;

View file

@ -10,5 +10,5 @@ public interface IReportHttpRepository
Task<List<NgSalesReportListView>> GetReports();
Task<NgSalesReportView> GetReport(string workDate);
Task<ReportInitDto> InitializeReportData(string workDate);
Task<ApiResponse> PostReport(string workDate, ReportDto reportDto);
Task<ApiResponseView> PostReport(string workDate, ReportDto reportDto);
}

View file

@ -23,6 +23,6 @@ namespace Wonky.Client.HttpRepository;
public interface ISalesItemHttpRepository
{
Task<PagingResponse<NgSalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters);
Task<NgSalesItemView> GetSalesItem(string id);
Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters);
Task<SalesItemView> GetSalesItem(string id);
}

View file

@ -1,14 +1,15 @@
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.HttpRepository;
public interface IUserHttpRepository
{
Task<List<UserListAdminView>> GetAdvisers();
Task<UserInfoAdminView> GetAdviserInfo(string userId);
Task<AdminUserInfoDto> GetAdviserInfo(string userId);
Task UpdateAdviser(string userId, UserUpdateDto model);
Task<List<UserListAdminView>> GetAdminUsers();
Task<UserInfoAdminView> GetAdminUserInfo(string userId);
Task<AdminUserInfoDto> GetAdminUserInfo(string userId);
Task UpdateAdminUser(string userId, UserUpdateDto model);
Task ResetUserPassword(string userId, string newPasswd, string confirmPasswd);
}

View file

@ -54,14 +54,14 @@ public class ReportHttpRepository :IReportHttpRepository
return initData ?? new ReportInitDto();
}
public async Task<ApiResponse> PostReport(string workDate, ReportDto reportDto)
public async Task<ApiResponseView> 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<ApiResponse>(jsonDate);
return new ApiResponse
var result = JsonSerializer.Deserialize<ApiResponseView>(jsonDate);
return new ApiResponseView
{
Code = result.Code,
Id = result.Id,

View file

@ -52,7 +52,7 @@ public class SalesItemHttpRepository : ISalesItemHttpRepository
_apiConfig = configuration.Value;
}
public async Task<PagingResponse<NgSalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters)
public async Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters)
{
var queryString = new Dictionary<string, string>
{
@ -68,19 +68,19 @@ public class SalesItemHttpRepository : ISalesItemHttpRepository
var content = await response.Content.ReadAsStringAsync();
var pagingResponse = new PagingResponse<NgSalesItemView>
var pagingResponse = new PagingResponse<SalesItemView>
{
Items = JsonSerializer.Deserialize<List<NgSalesItemView>>(content, _options),
Items = JsonSerializer.Deserialize<List<SalesItemView>>(content, _options),
MetaData = JsonSerializer.Deserialize<MetaData>(
response.Headers.GetValues("X-Pagination").First(), _options)
};
return pagingResponse;
}
public async Task<NgSalesItemView> GetSalesItem(string id)
public async Task<SalesItemView> GetSalesItem(string id)
{
var salesItem = await _client
.GetFromJsonAsync<NgSalesItemView>($"{_apiConfig.CatalogUri}/{id}");
return salesItem ?? new NgSalesItemView();
.GetFromJsonAsync<SalesItemView>($"{_apiConfig.CatalogUri}/{id}");
return salesItem ?? new SalesItemView();
}
}

View file

@ -36,9 +36,9 @@ public class UserHttpRepository : IUserHttpRepository
return await _client.GetFromJsonAsync<List<UserListAdminView>>(_api.AdminAdviserUri);
}
public async Task<UserInfoAdminView> GetAdviserInfo(string userId)
public async Task<AdminUserInfoDto> GetAdviserInfo(string userId)
{
return await _client.GetFromJsonAsync<UserInfoAdminView>($"{_api.AdminAdviserUri}/{userId}");
return await _client.GetFromJsonAsync<AdminUserInfoDto>($"{_api.AdminAdviserUri}/{userId}");
}
public async Task UpdateAdviser(string userId, UserUpdateDto model)
@ -51,9 +51,9 @@ public class UserHttpRepository : IUserHttpRepository
return await _client.GetFromJsonAsync<List<UserListAdminView>>(_api.AdminUserUri);
}
public async Task<UserInfoAdminView> GetAdminUserInfo(string userId)
public async Task<AdminUserInfoDto> GetAdminUserInfo(string userId)
{
return await _client.GetFromJsonAsync<UserInfoAdminView>($"{_api.AdminUserUri}/{userId}");
return await _client.GetFromJsonAsync<AdminUserInfoDto>($"{_api.AdminUserUri}/{userId}");
}
public async Task UpdateAdminUser(string userId, UserUpdateDto model)

View file

@ -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; }

View file

@ -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);
}

View file

@ -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<NgSalesItemView> _caltalog { get; set; } = new();
private SalesItemView _selectedItem { get; set; } = new();
private List<SalesItemView> _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<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SelectGroup = groupFilter;
await GetSalesItems();
}
private async Task SetSearchCol(string columnName)
{
_caltalog = new List<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_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<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_paging.OrderBy = orderBy;
await GetSalesItems();
}
private async Task SetSearchPhrase(string searchTerm)
{
_caltalog = new List<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchTerm = searchTerm;
await GetSalesItems();
}
private async Task SelectedPage(int page)
{
_caltalog = new List<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_paging.PageNumber = page;
await GetSalesItems();
}
private async Task SetPageSize(string pageSize)
{
_caltalog = new List<NgSalesItemView>();
_caltalog = new List<SalesItemView>();
_paging.PageSize = Convert.ToInt32(pageSize);
_paging.PageNumber = 1;
await GetSalesItems();

View file

@ -4,7 +4,7 @@
<div class="card">
<div class="card-header bg-dark text-white">
<div class="card-title">
<h3>@_userInfo.FirstName @_userInfo.LastName Kunder</h3>
<h3>@AdminUserInfo.FirstName @AdminUserInfo.LastName Kunder</h3>
</div>
</div>
<div class="card-body">

View file

@ -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<CompanyDto> _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();
}

View file

@ -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;

View file

@ -4,10 +4,10 @@
<div class="card">
<div class="card-header bg-dark text-white">
<h3>Sælger info</h3>
<h3>Bruger info</h3>
</div>
<div class="card-body">
@if (UserInfoAdmin != null)
@if (AdminUserInfo != null)
{
<EditForm EditContext="_editContext" OnValidSubmit="UpdateAdviser">
<DataAnnotationsValidator/>
@ -52,7 +52,7 @@
Sælgernr.
</th>
<td>
@UserInfoAdmin.Adviser
@AdminUserInfo.Adviser
</td>
<th scope="col">
Landekode

View file

@ -18,7 +18,7 @@ public partial class AdminAdviserView : IDisposable
[Inject] private ILogger<AdminAdviserView> _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;

View file

@ -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;

View file

@ -4,10 +4,10 @@
<div class="card">
<div class="card-header bg-dark text-white">
<h3>Sælger info</h3>
<h3>Bruger info</h3>
</div>
<div class="card-body">
@if (UserInfoAdmin != null)
@if (AdminUserInfo != null)
{
<EditForm EditContext="_editContext" OnValidSubmit="UpdateUser">
<DataAnnotationsValidator/>
@ -47,20 +47,6 @@
<ValidationMessage For="@(() => _updateInfo.PhoneNumber)"></ValidationMessage>
</td>
</tr>
<tr class="align-middle">
<th scope="col">
Sælgernr.
</th>
<td>
@UserInfoAdmin.Adviser
</td>
<th scope="col">
Landekode
</th>
<td>
@_updateInfo.CountryCode
</td>
</tr>
<tr class="align-middle">
<th scope="col">
Spærret

View file

@ -18,7 +18,7 @@ public partial class AdminOfficeView : IDisposable
[Inject] private ILogger<AdminAdviserView> _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;

View file

@ -25,7 +25,7 @@
<div class="card">
<div class="card-header bg-dark text-white">
<div class="row">
<div class="col d-print-none justify-content-center">
<div class="col w-75 d-print-none justify-content-center">
@if (!string.IsNullOrWhiteSpace(ReportDate))
{
<h2 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h2>
@ -34,6 +34,9 @@
<div class="col d-print-none justify-content-center">
<WorkDateComponent OnChanged="GetReport"></WorkDateComponent>
</div>
<div class="col col-sm-1 d-print-none">
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
</div>
<div class="col d-none d-print-block text-end">
<h3>@_report.Report.Name</h3>
</div>

View file

@ -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);

View file

@ -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<NgSalesItemView> _items { get; set; } = new();
private List<SalesItemView> _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<NgSalesItemView>();
_items = new List<SalesItemView>();
_paging.PageNumber = page;
await GetSalesItems();
}
@ -67,7 +67,7 @@ public partial class ItemCatalog : IDisposable
private async Task SetPageSize(string pageSize)
{
_items = new List<NgSalesItemView>();
_items = new List<SalesItemView>();
_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<NgSalesItemView>();
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SelectGroup = groupFilter;
await GetSalesItems();
}
private async Task SetSearchCol(string columnName)
{
_items = new List<NgSalesItemView>();
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchColumn = columnName;
await GetSalesItems();
}
private async Task SetSearchPhrase(string searchTerm)
{
_items = new List<NgSalesItemView>();
_items = new List<SalesItemView>();
_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<NgSalesItemView>();
_items = new List<SalesItemView>();
_paging.OrderBy = orderBy;
await GetSalesItems();
}

View file

@ -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; }

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -233,7 +233,7 @@
@foreach (var activity in _activities)
{
<tr>
<td>@activity.Company.Name - @activity.Company.ZipCity</td>
<td>@activity.ViewCompany.Name - @activity.ViewCompany.ZipCity</td>
<td>@activity.Demo</td>
<td>@activity.SalesResume</td>
<td class="align-content-end">@activity.OrderAmount</td>

View file

@ -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<ReportActivityDto> _activities { get; set; } = new();
private List<ActivityViewReport> _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<ReportActivityDto>();
_activities = new List<ActivityViewReport>();
_report.Figures.KmEvening = 0;
_report.Figures.KmMorning = 0;
_report.Figures.Distance = 0;

View file

@ -25,7 +25,7 @@
<div class="card">
<div class="card-header bg-dark text-white">
<div class="row">
<div class="col d-print-none justify-content-center">
<div class="col w-75 d-print-none justify-content-center">
@if (!string.IsNullOrWhiteSpace(ReportDate))
{
<h2 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h2>
@ -34,6 +34,9 @@
<div class="col d-print-none justify-content-center">
<WorkDateComponent OnChanged="GetReport"></WorkDateComponent>
</div>
<div class="col col-sm-1 d-print-none">
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
</div>
<div class="col d-none d-print-block text-end">
<h3>@_report.Report.Name</h3>
</div>

View file

@ -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
{

View file

@ -1,7 +1,7 @@
{
"appInfo": {
"name": "Wonky Client",
"version": "0.8.66",
"version": "0.8.80",
"isBeta": true,
"image": "grumpy-coder.png"
},

View file

@ -16,30 +16,102 @@ namespace Wonky.Entity.Configuration;
public class ApiConfig
{
// external service
/// <summary>
/// GLS tracking url
/// </summary>
public string GlsTrackUrl { get; set; } = "";
/// <summary>
/// GLS customer entity
/// </summary>
public string GlsId { get; set; } = "";
/// <summary>
/// VAT registrar url Denmark
/// </summary>
public string VirkUrl { get; set; } = "";
/// <summary>
/// VAT registrar url Norway
/// </summary>
public string BrRegUrl { get; set; } = "";
/// <summary>
/// VAT registrar url EU
/// </summary>
public string ViesUrl { get; set; } = "";
// api service
/// <summary>
/// Application base url
/// </summary>
public string InnoBaseUrl { get; set; } = "";
/// <summary>
/// Application uri for company information request
/// </summary>
public string CompanyUri { get; set; } = "";
/// <summary>
/// Application uri for product catalog request
/// </summary>
public string CatalogUri { get; set; } = "";
/// <summary>
/// Application uri for user information request
/// </summary>
public string UserInfoUri { get; set; } = "";
/// <summary>
/// Application uri for token request
/// </summary>
public string TokenUri { get; set; } = "";
/// <summary>
/// Application uri for activity request
/// </summary>
public string ActivityUri { get; set; } = "";
/// <summary>
/// Application uri for sales report request
/// </summary>
public string ReportUri { get; set; } = "";
/// <summary>
/// Application uri for task items request
/// </summary>
public string TaskUri { get; set; } = "";
/// <summary>
/// Application uri for customer product inventory request
/// </summary>
public string InventoryUri { get; set; } = "";
/// <summary>
/// Application uri for customer product sale request
/// </summary>
public string ProductUri { get; set; } = "";
/// <summary>
/// Application uri for updating customer product sale request
/// </summary>
public string SyncUri { get; set; } = "";
/// <summary>
/// Application uri for administration of sales representatives
/// </summary>
public string AdminAdviserUri { get; set; } = "";
/// <summary>
/// Application uri for administration of administrative users
/// </summary>
public string AdminUserUri { get; set; } = "";
/// <summary>
/// Application uri for administrative reset of user credentials
/// </summary>
public string AdminPasswdUri { get; set; } = "";
// public string KrvVariantsUri { get; set; } = "";
// public string KrvProductsUri { get; set; } = "";
// public string ImageUploadUri { get; set; } = "";

View file

@ -2,8 +2,23 @@ namespace Wonky.Entity.Configuration;
public class AppInfo
{
/// <summary>
/// Application version
/// </summary>
public string Version { get; set; }
/// <summary>
/// Application name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Application picture name
/// </summary>
public string Image { get; set; }
/// <summary>
/// Application beta version flag
/// </summary>
public bool IsBeta { get; set; }
}

View file

@ -20,149 +20,149 @@ namespace Wonky.Entity.DTO
public class ActivityDto
{
/// <summary>
/// Sælger nummer
/// Sales representative identification
/// </summary>
public string SalesRep { get; set; } = "";
/// <summary>
/// Sælger Id
/// Sales representative entity Id
/// </summary>
public string SalesRepId { get; set; } = "";
/// <summary>
/// Kunde Id - ej konto
/// Company entity Id
/// </summary>
public string CompanyId { get; set; } = "";
/// <summary>
/// business central Id
/// Business Central entity Id
/// </summary>
public string BcId { get; set; } = "";
/// <summary>
/// konto
/// Customer account
/// </summary>
public string Account { get; set; } = "";
/// <summary>
/// moms nummer
/// VAT number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string VatNumber { get; set; } = "";
/// <summary>
/// firma navn
/// Customer name
/// </summary>
[Required(ErrorMessage = "Navn skal udfyldes")]
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Name { get; set; } = "";
/// <summary>
/// firma adresse bynavn
/// Customer address city name
/// </summary>
[Required(ErrorMessage = "Byanvn skal udfyldes")]
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string City { get; set; }= "";
/// <summary>
/// firma adresse postnummer
/// Customer address postal code
/// </summary>
[Required(ErrorMessage = "Postnr. skal udfyldes")]
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ZipCode { get; set; } = "";
/// <summary>
/// firma adresse linje 1
/// Customer address line 1
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Address1 { get; set; } = "";
/// <summary>
/// firma adresse linje 2
/// Customer address line 2
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Address2 { get; set; } = "";
/// <summary>
/// firma telefon
/// Customer office phone
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Phone { get; set; } = "";
/// <summary>
/// firma mobil telefon
/// Customer mobile phone
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Mobile { get; set; } = "";
/// <summary>
/// firma email
/// Customer office email
/// </summary>
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
public string Email { get; set; } = "";
/// <summary>
/// firma attention
/// Customer attention description
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Attention { get; set; } = "";
// Form entries
/// <summary>
/// aktivitetstype
/// Activity type enum as string
/// </summary>
[Required(ErrorMessage = "Vælg aktivitetstype")]
public string ActivityTypeEnum { get; set; } = "";
/// <summary>
/// acktivitet status
/// Activity status enum as string
/// </summary>
[Required(ErrorMessage = "Vælg status for besøg ")]
public string ActivityStatusEnum { get; set; } = "";
/// <summary>
/// besøg type
/// Visit type enum as string
/// </summary>
public string VisitTypeEnum { get; set; } = "recall";
/// <summary>
/// aktivitet dato
/// Activity date
/// </summary>
[Required(ErrorMessage = "Dato skal angives")]
public string ActivityDate { get; set; } = "";
/// <summary>
/// produkt demo
/// Product demonstration
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Demo { get; set; } = "";
/// <summary>
/// vores ref sættes til B:Fornavn
/// Our reference - system generated
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string OurRef { get; set; } = "";
/// <summary>
/// Rekvisitions nummer
/// Customer reference number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ReferenceNumber { get; set; } = "";
/// <summary>
/// kunde person reference
/// Customer reference description
/// </summary>
[MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")]
public string YourRef { get; set; } = "";
/// <summary>
/// note til kontoret
/// Processing note to office
/// </summary>
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
public string OrderMessage { get; set; } = "";
/// <summary>
/// crm note
/// CRM note for future reference
/// </summary>
[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
/// <summary>
/// leveringsnavn
/// Customer delivery name
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvName { get; set; } = "";
/// <summary>
/// levering adresse 1
/// Customer delivery address line 1
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvAddress1 { get; set; } = "";
/// <summary>
/// levering adresse 2
/// Customer delivery address line 2
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string DlvAddress2 { get; set; } = "";
/// <summary>
/// levering postnummer
/// Customer delivery postal code
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string DlvZipCode { get; set; } = "";
/// <summary>
/// levering bynavn
/// Customer delivery city name
/// </summary>
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string DlvCity { get; set; } = "";
// Lines
/// <summary>
/// varelinjer
/// Order lines
/// </summary>
public List<ActivityLineDto> Lines { get; set; } = new();
}

View file

@ -16,13 +16,48 @@ namespace Wonky.Entity.DTO;
public class ActivityLineDto
{
/// <summary>
/// Item Sku
/// </summary>
public string Sku { get; set; } = "";
/// <summary>
/// Description
/// </summary>
public string Text { get; set; } = "";
/// <summary>
/// ShortName
/// </summary>
public string ShortName { get; set; } = "";
/// <summary>
/// Quantity
/// </summary>
public int Qty { get; set; }
/// <summary>
/// Line price
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// Line discount
/// </summary>
public decimal Discount { get; set; }
/// <summary>
/// Line amount
/// </summary>
public decimal LineAmount { get; set; }
/// <summary>
/// Line number
/// </summary>
public int LineNumber { get; set; }
/// <summary>
/// Sas indicator
/// </summary>
public bool Sas { get; set; }
}

View file

@ -0,0 +1,62 @@
using Wonky.Entity.Views;
namespace Wonky.Entity.DTO;
public class ActivityViewReport
{
/// <summary>
/// Company Info in listing
/// </summary>
public ActivityViewCompany ViewCompany { get; set; } = new();
/// <summary>
/// Total amount
/// </summary>
public decimal OrderAmount { get; set; }
/// <summary>
/// Sas amount
/// </summary>
public decimal SasAmount { get; set; }
/// <summary>
/// Sales head entity Id
/// </summary>
public string SalesHeadId { get; set; } = "";
/// <summary>
/// Flag indicating if activity is a sale or a quote
/// </summary>
public bool Closed { get; set; }
/// <summary>
/// Document date
/// </summary>
public string OrderDate { get; set; } = "";
/// <summary>
/// Client reference number
/// </summary>
public string ReferenceNumber { get; set; } = "";
/// <summary>
/// Client reference name
/// </summary>
public string YourRef { get; set; } = "";
/// <summary>
/// Visit type enum as string
/// </summary>
public string VisitTypeEnum { get; set; } = "";
/// <summary>
/// Demonstration
/// </summary>
public string Demo { get; set; } = "";
/// <summary>
/// Sales resume
/// </summary>
public string SalesResume { get; set; } = "";
}

View file

@ -4,9 +4,15 @@ namespace Wonky.Entity.DTO;
public class AdminResetPasswordDto
{
/// <summary>
/// New password
/// </summary>
[Required(ErrorMessage = "Kode skal udfyldes")]
public string NewPassword { get; set; } = "";
/// <summary>
/// Password confirmation
/// </summary>
[Compare(nameof(NewPassword), ErrorMessage = "Koderne er ikke ens.")]
public string ConfirmPassword { get; set; } = "";
}

View file

@ -2,34 +2,76 @@ using System.ComponentModel.DataAnnotations;
namespace Wonky.Entity.DTO;
public class UserInfoAdminView
public class AdminUserInfoDto
{
/// <summary>
/// First name
/// </summary>
[Required(ErrorMessage = "Fornavn skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")]
public string FirstName { get; set; } = "";
/// <summary>
/// Last name
/// </summary>
[Required(ErrorMessage = "Efternavn skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")]
public string LastName { get; set; } = "";
/// <summary>
/// Country code
/// </summary>
[Required(ErrorMessage = "Landekode skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 3 tegn.")]
public string CountryCode { get; set; } = "";
/// <summary>
/// Email
/// </summary>
[Required(ErrorMessage = "Email skal angives.")]
[MaxLength(50, ErrorMessage = "Der kan højst bruges 80 tegn.")]
public string Email { get; set; } = "";
/// <summary>
/// Phone number
/// </summary>
[MaxLength(20, ErrorMessage = "Der kan højst bruges 20 tegn.")]
public string PhoneNumber { get; set; } = "";
/// <summary>
/// Sales representative identification
/// </summary>
[Required(ErrorMessage = "Sælger identifikation skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 20 tegn.")]
public string Adviser { get; set; } = "";
/// <summary>
/// Country name
/// </summary>
public string CountryName { get; set; } = "";
/// <summary>
/// Lockout flag
/// </summary>
public bool LockoutEnabled { get; set; }
/// <summary>
/// Email confirmed flag
/// </summary>
public bool EmailConfirmed { get; set; }
/// <summary>
/// Adviser flag
/// </summary>
public bool IsAdviser { get; set; }
/// <summary>
/// Admin flag
/// </summary>
public bool IsAdmin { get; set; }
/// <summary>
/// User Id
/// </summary>
public string UserId { get; set; } = "";
}

View file

@ -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; }
/// <summary>
/// Name
/// </summary>
[Required(ErrorMessage = "Navn skal udfyldes")]
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Name { get; set; } = "";
/// <summary>
/// Postal code
/// </summary>
[Required(ErrorMessage = "Postnummer skal udfyldes")]
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ZipCode { get; set; } = "";
/// <summary>
/// City name
/// </summary>
[Required(ErrorMessage = "Bynavn skal udfyldes")]
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string City { get; set; } = "";
/// <summary>
/// VAT number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string VatNumber { get; set; } = "";
/// <summary>
/// Company Id
/// </summary>
public string CompanyId { get; set; } = "";
/// <summary>
/// Sales representative entity Id
/// </summary>
public string SalesRepId { get; set; } = "";
/// <summary>
/// Business Central entity Id
/// </summary>
public string BcId { get; set; } = "";
/// <summary>
/// Office address 1
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Address1 { get; set; } = "";
/// <summary>
/// Office address 2
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Address2 { get; set; } = "";
/// <summary>
/// Account number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Account { get; set; } = "";
/// <summary>
/// Phone number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Phone { get; set; } = "";
/// <summary>
/// Mobile phone number
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Mobile { get; set; } = "";
/// <summary>
/// Office email
/// </summary>
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
public string Email { get; set; } = "";
/// <summary>
/// Attention
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Attention { get; set; } = "";
/// <summary>
/// Country code ISO
/// </summary>
public string CountryCode { get; set; } = "";
public string LastVisit { get; set; } = "1970-01-01";
/// <summary>
/// Last visit
/// </summary>
public string LastVisit { get; set; } = "2010-01-01";
public string NextVisit { get; set; } = "1970-01-01";
/// <summary>
/// Next visit
/// </summary>
public string NextVisit { get; set; } = "2010-01-01";
/// <summary>
/// Interval between visits
/// </summary>
/// <value>between 1 and 52 (inclusive) default value is 8</value>
[Range(1, 52, ErrorMessage = "Angiv interval mellem 1 og 52 uger")]
public int Interval { get; set; } = 8;
/// <summary>
/// Value indication if company has shutdown
/// </summary>
/// <value>0 or 1</value>
public int HasFolded { get; set; }
/// <summary>
/// User value for hiding the company is out of business
/// </summary>
/// <value>0 or 1</value>
public int IsHidden { get; set; }
public int ValidVat { get; set; }
public int UpdateErpVat { get; set; }
public string HistorySync { get; set; }
/// <summary>
/// Value indicating the VAT number is valid
/// </summary>
/// <value>0 or 1</value>
public int ValidVat { get; set; }
/// <summary>
/// Value indicating if VAT number has changed and should be written to ERP record
/// </summary>
/// <value>0 or 1</value>
public int UpdateErpVat { get; set; }
/// <summary>
/// Date for last sync of product history
/// </summary>
public string HistorySync { get; set; } = "";
/// <summary>
/// Virtual property indicating if timespan is within the defined interval
/// </summary>
/// <returns>true/false</returns>
public virtual bool ValidDateSpan()
{
var notAllowed = new List<string> {"1970-01-01", "0001-01-01"};
var notAllowed = new List<string> {"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);

View file

@ -19,8 +19,23 @@ namespace Wonky.Entity.DTO;
public class KrvProductDto
{
/// <summary>
/// Product entity Id
/// </summary>
[Required] public string ProductId { get; set; } = "";
/// <summary>
/// Trading name
/// </summary>
[Required] public string TradingName { get; set; } = "";
/// <summary>
/// Picture url
/// </summary>
[Required] public string PictureLink { get; set; } = "";
/// <summary>
/// Product category enum as string
/// </summary>
[Required] public string ProductCategoryEnum { get; set; } = "";
}

View file

@ -19,12 +19,43 @@ namespace Wonky.Entity.DTO;
public class KrvVariantDto
{
/// <summary>
/// Variant entity id
/// </summary>
[Required] public string VariantId { get; set; } = "";
/// <summary>
/// Vendor variant name
/// </summary>
[Required] public string Name { get; set; } = "";
/// <summary>
/// Vendor variant SKU
/// </summary>
[Required] public string Sku { get; set; } = "";
/// <summary>
/// ERP variant SKU
/// </summary>
[Required] public string ErpSku { get; set; } = "";
/// <summary>
/// ERP variant name
/// </summary>
[Required] public string ErpName { get; set; } = "";
/// <summary>
/// Variant short name
/// </summary>
[Required] public string ShortName { get; set; } = "";
/// <summary>
/// Link to variant safety data sheet
/// </summary>
[Required] public string SdsLink { get; set; } = "";
/// <summary>
/// Picture link
/// </summary>
public string PictureLink { get; set; } = "";
}

View file

@ -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; } = "";
}

View file

@ -4,19 +4,42 @@ namespace Wonky.Entity.DTO;
public class ReportDto
{
/// <summary>
/// Report name
/// </summary>
/// <remarks>System generated</remarks>
public string Name { get; set; } = "";
/// <summary>
/// Report description
/// </summary>
[MaxLength(1000, ErrorMessage = "Du kan højst bruge 1000 tegn")]
public string Description { get; set; } = "";
/// <summary>
/// Supervisor
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string SupervisedBy { get; set; } = "";
/// <summary>
/// Day type enum as string
/// </summary>
[Required(ErrorMessage = "Dagtype skal angives")]
public string DayTypeEnum { get; set; } = "";
// Date interval (used for leave, sickLeave and work hours
/// <summary>
/// Report timespan - start date time
/// </summary>
public string FromDateTime { get; set; } = "";
/// <summary>
/// Report timespan - end date time
/// </summary>
public string ToDateTime { get; set; } = "";
/// <summary>
/// Report figures
/// </summary>
public ReportFiguresDto Figures { get; set; } = new();
}

View file

@ -2,46 +2,178 @@ namespace Wonky.Entity.DTO;
public class ReportFiguresDto
{
/// <summary>
/// Sales day number
/// </summary>
public int SalesDayNumber { get; set; }
/// <summary>
/// Distance today
/// </summary>
public int Distance { get; set; }
/// <summary>
/// Distance private (for company cars)
/// </summary>
public int DistancePrivate { get; set; }
/// <summary>
/// Odometer value evening
/// </summary>
public int KmEvening { get; set; }
/// <summary>
/// Odometer value morning
/// </summary>
public int KmMorning { get; set; }
/// <summary>
/// Counter for new visits
/// </summary>
public int NewVisitCount { get; set; }
/// <summary>
/// Counter for product demonstration at new visit
/// </summary>
public int NewDemoCount { get; set; }
public int RecallVisitCount { get; set; }
public int RecallDemoCount { get; set; }
/// <summary>
/// Counter for product sale at new visit
/// </summary>
public int NewSaleCount { get; set; }
/// <summary>
/// Counter for recall visits
/// </summary>
public int RecallVisitCount { get; set; }
/// <summary>
/// Counter for product demonstration at recall visit
/// </summary>
public int RecallDemoCount { get; set; }
/// <summary>
/// Counter for product sale at recall visit
/// </summary>
public int RecallSaleCount { get; set; }
/// <summary>
/// Counter for total number of visits for workday
/// </summary>
public int TotalVisitCount { get; set; }
/// <summary>
/// Counter for total number of product demonstration
/// </summary>
public int TotalDemoCount { get; set; }
/// <summary>
/// Count for total number of product sale
/// </summary>
public int TotalSaleCount { get; set; }
/// <summary>
/// Counter for the number of safe seal sale
/// </summary>
public int SasCount { get; set; }
// turnover day
/// <summary>
/// Turnover for new sale
/// </summary>
public decimal NewTurnover { get; set; }
/// <summary>
/// Turnover for recall sale
/// </summary>
public decimal RecallTurnover { get; set; }
/// <summary>
/// Turnover for safe seal sale
/// </summary>
public decimal SasTurnover { get; set; }
/// <summary>
/// Total turnover for work day
/// </summary>
public decimal TotalTurnover { get; set; }
// month distance
/// <summary>
/// Total distance for month
/// </summary>
public int DistanceMonth { get; set; }
/// <summary>
/// Total private distance for month (company cars)
/// </summary>
public int DistancePrivateMonth { get; set; }
// mont counters
/// <summary>
/// Counter for new visits month
/// </summary>
public int NewVisitCountMonth { get; set; }
/// <summary>
/// Counter for product demonstration at new visit month
/// </summary>
public int NewDemoCountMonth { get; set; }
/// <summary>
/// Counter for product sale at new visit month
/// </summary>
public int NewSaleCountMonth { get; set; }
/// <summary>
/// Counter for recall visit month
/// </summary>
public int RecallVisitCountMonth { get; set; }
/// <summary>
/// Counter for product demonstration at recall visit month
/// </summary>
public int RecallDemoCountMonth { get; set; }
/// <summary>
/// Counter for product sale at recall visit month
/// </summary>
public int RecallSaleCountMonth { get; set; }
// month total counter
/// <summary>
/// Counter for total number of visit month
/// </summary>
public int TotalVisitCountMonth { get; set; }
/// <summary>
/// Counter for total number of product demo month
/// </summary>
public int TotalDemoCountMonth { get; set; }
/// <summary>
/// Counter for total number of product sale month
/// </summary>
public int TotalSaleCountMonth { get; set; }
/// <summary>
/// Counter for total number safe seal sale month
/// </summary>
public int SasCountMonth { get; set; }
// month turnover
/// <summary>
/// Turnover total for new sale month
/// </summary>
public decimal NewTurnoverMonth { get; set; }
/// <summary>
/// Turnover total for recall sale month
/// </summary>
public decimal RecallTurnoverMonth { get; set; }
/// <summary>
/// Turnover total for safe seal sale month
/// </summary>
public decimal SasTurnoverMonth { get; set; }
/// <summary>
/// Turnover total for all sale month
/// </summary>
public decimal TotalTurnoverMonth { get; set; }
}

View file

@ -4,8 +4,19 @@ namespace Wonky.Entity.DTO;
public class ReportInitDto
{
/// <summary>
/// Flag to prevent activity to be added to report
/// </summary>
public bool Closed { get; set; }
/// <summary>
/// Report figures
/// </summary>
public ReportFiguresDto Figures { get; set; }
public List<ReportActivityDto> Activities { get; set; }
/// <summary>
/// List of activities for report
/// </summary>
public List<ActivityViewReport> Activities { get; set; }
}

View file

@ -2,13 +2,49 @@ namespace Wonky.Entity.DTO;
public class TaskItemDto
{
/// <summary>
/// Task item entity Id
/// </summary>
public string TaskItemId { get; set; } = "";
/// <summary>
/// User entity Id
/// </summary>
public string ErpUserId { get; set; } = "";
/// <summary>
/// Task name
/// </summary>
public string Name { get; set; } = "";
/// <summary>
/// Task description
/// </summary>
public string Text { get; set; } = "";
/// <summary>
/// Task due date
/// </summary>
public string DueTimestamp { get; set; } = "";
/// <summary>
/// Task interval
/// </summary>
public int Interval { get; set; }
/// <summary>
/// Flag completed
/// </summary>
public bool IsCompleted { get; set; }
/// <summary>
/// Flag overdue
/// </summary>
public bool OverDue { get; set; }
public bool Recurring { get; set; }
/// <summary>
/// Recurring flag
/// </summary>
/// <value>Interval != 0</value>
public virtual bool Recurring { get; set; }
}

View file

@ -19,6 +19,12 @@ namespace Wonky.Entity.DTO;
public class UserAuthenticationDto
{
/// <summary>
/// User identification
/// </summary>
[Required(ErrorMessage = "Email skal angives")] public string Email { get; set; } = "";
/// <summary>
/// User passphrase
/// </summary>
[Required(ErrorMessage = "Password skal angives")] public string Password { get; set; } = "";
}

View file

@ -4,24 +4,42 @@ namespace Wonky.Entity.DTO;
public class UserUpdateDto
{
/// <summary>
/// User firstname
/// </summary>
[Required(ErrorMessage = "Fornavn skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")]
public string FirstName { get; set; } = "";
/// <summary>
/// User lastname
/// </summary>
[Required(ErrorMessage = "Efternavn skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 50 tegn.")]
public string LastName { get; set; } = "";
/// <summary>
/// User Country Code
/// </summary>
[Required(ErrorMessage = "Landekode skal angives.")]
[MaxLength(50,ErrorMessage = "Der kan højst bruges 3 tegn.")]
public string CountryCode { get; set; } = "";
/// <summary>
/// User email - used for login
/// </summary>
[Required(ErrorMessage = "Email skal angives.")]
[MaxLength(50, ErrorMessage = "Der kan højst bruges 80 tegn.")]
public string Email { get; set; } = "";
/// <summary>
/// User phone number
/// </summary>
[MaxLength(20, ErrorMessage = "Der kan højst bruges 20 tegn.")]
public string PhoneNumber { get; set; } = "";
/// <summary>
/// Lock user
/// </summary>
[Required] public bool LockoutEnabled { get; set; }
}

View file

@ -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; } = "";
}

View file

@ -16,6 +16,13 @@ namespace Wonky.Entity.Models;
public class TimeFrame
{
/// <summary>
/// Start date
/// </summary>
public string StartDate { get; set; } = "";
/// <summary>
/// End date
/// </summary>
public string EndDate { get; set; } = "";
}

View file

@ -2,7 +2,14 @@ namespace Wonky.Entity.Models;
public class VatLifeCycle
{
/// <summary>
/// Last update of the lifecycle
/// </summary>
public string LastUpdate { get; set; } = "";
/// <summary>
/// Time frame of lifecycle
/// </summary>
public TimeFrame TimeFrame { get; set; } = new();
}

View file

@ -16,7 +16,18 @@ namespace Wonky.Entity.Models;
public class VatRegState
{
/// <summary>
/// VAT number state
/// </summary>
public string State { get; set; } = "UKENDT";
/// <summary>
/// Last update of VAT state
/// </summary>
public string LastUpdate { get; set; } = "";
/// <summary>
/// Timeframe for VAT state
/// </summary>
public TimeFrame TimeFrame { get; set; } = new();
}

View file

@ -19,13 +19,47 @@ namespace Wonky.Entity.Models;
public class VirkRegInfo
{
/// <summary>
/// VAT number
/// </summary>
public string VatNumber { get; set; } = "";
/// <summary>
/// Entity registration name
/// </summary>
public string Name { get; set; } = "";
/// <summary>
/// Entity address C/O name
/// </summary>
public string CoName { get; set; } = "";
/// <summary>
/// Entity address line
/// </summary>
public string Address { get; set; } = "";
/// <summary>
/// Entity address city name
/// </summary>
public string City { get; set; } = "";
/// <summary>
/// Entity address postal code
/// </summary>
public string ZipCode { get; set; } = "";
/// <summary>
/// List of VAT entity states
/// </summary>
public List<VatRegState> States { get; set; } = new ();
/// <summary>
/// List of VAT entity lifecycles
/// </summary>
public List<VatLifeCycle> LifeCycles { get; set; } = new ();
/// <summary>
/// Date for last request of entity VAT state
/// </summary>
public string RequestDate { get; set; } = "" ;
}

View file

@ -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";
}

View file

@ -16,16 +16,47 @@ namespace Wonky.Entity.Requests;
public class CatalogPagingParams
{
/// <summary>
/// internal default page size
/// </summary>
private int _pageSize = 5;
/// <summary>
/// internal max page size
/// </summary>
private const int MaxPageSize = 50;
/// <summary>
/// Set the page number to return
/// </summary>
public int PageNumber { get; set; } = 1;
/// <summary>
/// Set the page size to return
/// </summary>
public int PageSize
{
get => _pageSize;
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
}
/// <summary>
/// Set the search term to use
/// </summary>
public string SearchTerm { get; set; } = "";
/// <summary>
/// Set the column used for search
/// </summary>
public string SearchColumn { get; set; } = "name";
/// <summary>
/// Set column used to order the result
/// </summary>
public string OrderBy { get; set; } = "name";
/// <summary>
/// Set product group filter
/// </summary>
public string SelectGroup { get; set; } = "";
}

View file

@ -16,19 +16,58 @@ namespace Wonky.Entity.Requests;
public class CompanyPagingParams
{
/// <summary>
/// internal default page size
/// </summary>
private int _pageSize = 5;
/// <summary>
/// internal max page size
/// </summary>
private const int MaxPageSize = 50;
/// <summary>
/// Set the page number to return
/// </summary>
public int PageNumber { get; set; } = 1;
/// <summary>
/// Set the page size to return
/// </summary>
public int PageSize
{
get => _pageSize;
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
}
/// <summary>
/// Set the search term to use
/// </summary>
public string SearchTerm { get; set; } = "";
/// <summary>
/// Set the column to use for searching
/// </summary>
public string SearchColumn { get; set; } = "name";
/// <summary>
/// Set the column for ordering the result
/// </summary>
public string OrderBy { get; set; } = "name";
/// <summary>
/// Optional limit the result
/// </summary>
public string FromDate { get; set; } = "";
/// <summary>
/// Set a flag to include hidden entities
/// </summary>
public int IsHidden { get; set; }
/// <summary>
/// Set a flag to include entities which has gone out of business
/// </summary>
public int HasFolded { get; set; }
}

View file

@ -16,10 +16,33 @@ namespace Wonky.Entity.Requests;
public class MetaData
{
/// <summary>
/// The current page number
/// </summary>
public int CurrentPage { get; set; }
/// <summary>
/// The current total number of pages
/// </summary>
public int TotalPages { get; set; }
/// <summary>
/// The current page size
/// </summary>
public int PageSize { get; set; }
/// <summary>
/// The total count of entities available
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Navigation flag - move previous
/// </summary>
public bool HasPrevious => CurrentPage > 1;
/// <summary>
/// Navigation flag - move next
/// </summary>
public bool HasNext => CurrentPage < TotalPages;
}

View file

@ -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";
}

View file

@ -16,8 +16,31 @@ namespace Wonky.Entity.Requests;
public class VirkParams
{
/// <summary>
/// Entity VAT number search
/// </summary>
public string VatNumber { get; set; } = "";
/// <summary>
/// Address search - street name
/// </summary>
/// <remarks>StreetName, HouseNumber, ZipCode are required for address search</remarks>
public string StreetName { get; set; } = "";
/// <summary>
/// Address search house number
/// </summary>
/// <remarks>StreetName, HouseNumber, ZipCode are required for address search</remarks>
public string HouseNumber { get; set; } = "";
/// <summary>
/// Address search postal code
/// </summary>
/// <remarks>StreetName, HouseNumber, ZipCode are required for address search</remarks>
public string ZipCode { get; set; } = "";
/// <summary>
/// Entity name search
/// </summary>
public string EntityName { get; set; } = "";
}

View file

@ -0,0 +1,7 @@
namespace Wonky.Entity.Views;
public class ActivityListReportView
{
public bool ReportClosed { get; set; }
public List<ActivityReportView> Activities { get; set; } = new();
}

View file

@ -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; } = "";

View file

@ -1,6 +1,6 @@
namespace Wonky.Entity.Views;
public class ActivityCompanyView
public class ActivityViewCompany
{
public string CompanyId { get; set; } = "";
public string Account { get; set; } = "";

View file

@ -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; } = "";
}

View file

@ -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<string>? Errors { get; set; }
public HttpStatusCode Code { get; set; }
public string Message { get; set; } = "";
public string Id { get; set; } = "";
}

View file

@ -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
{
}

View file

@ -1,7 +0,0 @@
namespace Wonky.Entity.Views;
public class NgActivityListReportView
{
public bool ReportClosed { get; set; }
public List<NgActivityReportView> Activities { get; set; } = new();
}

View file

@ -3,5 +3,5 @@ namespace Wonky.Entity.Views;
public class NgSalesReportView
{
public NgSalesReport Report { get; set; } = new();
public List<NgActivityReportView> Activities { get; set; } = new ();
public List<ActivityReportView> Activities { get; set; } = new ();
}

View file

@ -1,4 +1,4 @@
namespace Wonky.Entity.DTO;
namespace Wonky.Entity.Views;
public class ProductHistoryView
{

View file

@ -1,6 +1,4 @@
using System.Text.Json.Serialization;
namespace Wonky.Entity.DTO;
namespace Wonky.Entity.Views;
public class ProductInventoryView
{

View file

@ -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<NgSalesRateView> Rates { get; set; } = new();
public List<SalesRateView> Rates { get; set; } = new();
}

View file

@ -14,7 +14,7 @@
//
namespace Wonky.Entity.Views;
public class NgSalesRateView
public class SalesRateView
{
public string Quantity { get; set; } = "";
public string Rate { get; set; } = "";

View file

@ -15,7 +15,7 @@
using System.Text.Json.Serialization;
namespace Wonky.Entity.DTO;
namespace Wonky.Entity.Views;
public class UserInfoView
{

View file

@ -1,4 +1,4 @@
namespace Wonky.Entity.DTO;
namespace Wonky.Entity.Views;
public class UserListAdminView
{