}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/CrmActivityCreate.razor.cs b/Wonky.Client/Pages/CrmActivityCreate.razor.cs
index 0ba110cb..7f93e683 100644
--- a/Wonky.Client/Pages/CrmActivityCreate.razor.cs
+++ b/Wonky.Client/Pages/CrmActivityCreate.razor.cs
@@ -43,7 +43,7 @@ public partial class CrmActivityCreate : IDisposable
private List SalesItems { get; set; } = new();
// private MetaData _meta { get; set; } = new();
private Preferences _prefs { get; set; } = new();
- private DtoNgSalesRepActivity _poDraft { get; set; } = new();
+ private DtoNgActivity _poDraft { get; set; } = new();
private DtoNgCompany NgCompany = new();
private CatalogPagingParams _paging = new();
private EditContext DraftContext { get; set; }
@@ -60,6 +60,7 @@ public partial class CrmActivityCreate : IDisposable
private bool InvalidCanvas { get; set; } = true;
private bool InvalidDate { get; set; } = true;
private UserInfoView Ux { get; set; } = new();
+ private VatUtils _vatUtils { get; set; }
protected override void OnParametersSet()
{
@@ -68,6 +69,7 @@ public partial class CrmActivityCreate : IDisposable
protected override async Task OnInitializedAsync()
{
+ _vatUtils = new VatUtils();
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
_prefs = await UserPrefs.GetPreferences();
@@ -100,7 +102,7 @@ public partial class CrmActivityCreate : IDisposable
_poDraft.City = NgCompany.City;
_poDraft.DlvName = NgCompany.Name;
- _poDraft.DlvAddress1 = NgCompany.Address1;
+ _poDraft.DlvAddress = NgCompany.Address1;
_poDraft.DlvAddress2 = NgCompany.Address2;
_poDraft.DlvZipCode = NgCompany.ZipCode;
_poDraft.DlvCity = NgCompany.City;
@@ -232,14 +234,18 @@ public partial class CrmActivityCreate : IDisposable
{
_poFormInvalid = !DraftContext.Validate();
InvalidCanvas = InvalidActivityType || InvalidDate;
- InvalidActivity = InvalidActivityType || _poFormInvalid || DraftStateProvider.Draft.Items.Count == 0 || InvalidDate;
+ InvalidActivity = InvalidActivityType
+ || _poFormInvalid
+ || DraftStateProvider.Draft.Items.Count == 0
+ || InvalidDate
+ || (_poDraft.ActivityStatusEnum == "offer" && string.IsNullOrWhiteSpace(_poDraft.EMail));
StateHasChanged();
}
private void ValidationChanged(object sender, ValidationStateChangedEventArgs e)
{
if (!string.IsNullOrEmpty(_poDraft.VatNumber))
{
- if(!VatUtils.ValidateFormat(NgCompany.CountryCode, _poDraft.VatNumber))
+ if(!_vatUtils.ValidateFormat(NgCompany.CountryCode, _poDraft.VatNumber))
ToastService.ShowWarning("CVR / ORG nummer er ikke et gyldigt registreringsnummer");
}
if (string.IsNullOrEmpty(_poDraft.ActivityTypeEnum))
diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs
index 6d3a8f91..f30c79dc 100644
--- a/Wonky.Entity/Configuration/ApiConfig.cs
+++ b/Wonky.Entity/Configuration/ApiConfig.cs
@@ -17,10 +17,10 @@ namespace Wonky.Entity.Configuration;
public class ApiConfig
{
public string BaseAddress { get; set; } = "";
- public string CrmCompanies { get; set; } = "";
- public string PriceCatalog { get; set; } = "";
- public string KrvVariants { get; set; } = "";
- public string KrvProducts { get; set; } = "";
+ public string CustomerEndpoint { get; set; } = "";
+ public string CatalogEndpoint { get; set; } = "";
+ public string KrvVariantEndpoint { get; set; } = "";
+ public string KrvProductEndpoint { get; set; } = "";
public string ImageUpload { get; set; } = "";
public string UserRegistration { get; set; } = "";
public string UserInfo { get; set; } = "";
@@ -28,4 +28,5 @@ public class ApiConfig
public string TokenPath { get; set; } = "";
public string GlsTrackUrl { get; set; } = "";
public string GlsId { get; set; } = "";
+ public string ActivityEndpoint { get; set; } = "";
}
\ No newline at end of file
diff --git a/Wonky.Entity/DTO/ActivityResponse.cs b/Wonky.Entity/DTO/ActivityResponse.cs
new file mode 100644
index 00000000..6550e82c
--- /dev/null
+++ b/Wonky.Entity/DTO/ActivityResponse.cs
@@ -0,0 +1,27 @@
+// 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 Affero GNU 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
+// Affero GNU General Public License for more details.
+//
+// You should have received a copy of the Affero GNU General Public License
+// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
+//
+
+using System.Collections.Generic;
+using System.Net;
+
+namespace Wonky.Entity.DTO;
+
+public class ActivityResponseView
+{
+ public bool IsSuccessStatusCode { 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/DTO/DtoNgActivity.cs b/Wonky.Entity/DTO/DtoNgActivity.cs
index 713b8a27..68a9b817 100644
--- a/Wonky.Entity/DTO/DtoNgActivity.cs
+++ b/Wonky.Entity/DTO/DtoNgActivity.cs
@@ -17,7 +17,7 @@ using System.ComponentModel.DataAnnotations;
namespace Wonky.Entity.DTO
{
- public class DtoNgSalesRepActivity
+ public class DtoNgActivity
{
public string SalesHeadId { get; set; } = "";
public string CompanyId { get; set; } = "";
@@ -45,7 +45,7 @@ namespace Wonky.Entity.DTO
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string CrmNote { get; set; } = "";
// Delivery address form entries
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvName { get; set; } = "";
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvAddress1 { get; set; } = "";
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvAddress { get; set; } = "";
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string DlvAddress2 { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string DlvZipCode { get; set; } = "";
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string DlvCity { get; set; } = "";
diff --git a/Wonky.Entity/Requests/ActivityPagingParams.cs b/Wonky.Entity/Requests/ActivityPagingParams.cs
new file mode 100644
index 00000000..02798f85
--- /dev/null
+++ b/Wonky.Entity/Requests/ActivityPagingParams.cs
@@ -0,0 +1,30 @@
+// 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 Affero GNU 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
+// Affero GNU General Public License for more details.
+//
+// You should have received a copy of the Affero GNU 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