diff --git a/Wonky.Client/HttpRepository/CrmCustomerRepository.cs b/Wonky.Client/HttpRepository/CrmCustomerRepository.cs index d6f2bbed..23f4b5fe 100644 --- a/Wonky.Client/HttpRepository/CrmCustomerRepository.cs +++ b/Wonky.Client/HttpRepository/CrmCustomerRepository.cs @@ -148,7 +148,7 @@ public class CrmCustomerRepository : ICrmCustomerRepository }; var response = await _client.PutAsJsonAsync($"{_conf.CrmCustomers}/{companyId}/crmData", updateModel, _options); var content = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(content); + return JsonSerializer.Deserialize(content) ?? new CompanyDto(); } /// @@ -169,12 +169,14 @@ public class CrmCustomerRepository : ICrmCustomerRepository Mobile = company.Mobile, Name = company.Name, Phone = company.Phone, - ZipCode = company.ZipCode + ZipCode = company.ZipCode, + EanNumber = company.EanNumber, + Segment = company.Segment }; var response = await _client.PutAsJsonAsync($"{_conf.CrmCustomers}/{companyId}/erpData", updateModel, _options); var content = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(content); + return JsonSerializer.Deserialize(content) ?? new CompanyDto(); } /// diff --git a/Wonky.Client/Models/DocView.cs b/Wonky.Client/Models/DocView.cs index d7c39a48..e040a42e 100644 --- a/Wonky.Client/Models/DocView.cs +++ b/Wonky.Client/Models/DocView.cs @@ -4,12 +4,12 @@ namespace Wonky.Client.Models; public class DocView { - public string ApbDocId { get; set; } = ""; - public string ApbDocLink { get; set; } = ""; - public string ApvDocId { get; set; } = ""; - public string ApvDocLink { get; set; } = ""; - public string DocumentDate { get; set; } = ""; - public string ProductId { get; set; } = ""; - public string VariantId { get; set; } = ""; - public string VariantName { get; set; } = ""; + public string ApbDocId { get; set; } = ""; + public string ApbDocLink { get; set; } = ""; + public string ApvDocId { get; set; } = ""; + public string ApvDocLink { get; set; } = ""; + public string DocumentDate { get; set; } = ""; + public string ProductId { get; set; } = ""; + public string VariantId { get; set; } = ""; + public string VariantName { get; set; } = ""; } \ No newline at end of file diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs index 6f8c17ae..3598d6bc 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs @@ -167,6 +167,8 @@ public partial class AdvisorActivityCreatePage : IDisposable Activity.DlvAddress2 = Company.Address2; Activity.DlvZipCode = Company.ZipCode; Activity.DlvCity = Company.City; + Activity.Segment = Company.Segment; + Activity.EanNumber = Company.EanNumber; // Initialize date variable Logger.LogDebug("AdvisorActivityCreatePage => DateTime parser => {}", UserPreference.WorkDate); diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor index a391a384..db90f168 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor @@ -30,13 +30,13 @@
- @Company.Name (@Company.Account) + @Company.Name (@Company.Account)
- +
// erp context @@ -68,16 +68,22 @@ @* Post Code *@ -
+
@* City Name *@ -
+
+ @* Email *@ + +
+ + +
@* Phone *@
@@ -91,37 +97,29 @@
@* Email *@ - +
- - + +
@if (!Kanvas) { - @if (AppInfo!.Value!.Rc) - { - -
- - - - - - @* *@ + +
+ + + + + + +
+
+
+
-
-
-
-
-
- } - else - { -
- @* placeholder *@ -
- } +
@* Enable edit/save *@
@@ -312,4 +310,4 @@ @ref="VatLookupPopup" OnSelectedCompany="SelectedCompanyCallback"/> \ No newline at end of file + @ref="ContactViewPopup" OnSaveClicked="WriteContactCallback" OnDeleteClicked="DeleteContactCallback"/> \ No newline at end of file diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs index 3a0f864f..8ee34fd0 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs @@ -455,7 +455,7 @@ public partial class AdvisorCustomerViewEditPage : IDisposable ErpContext = new EditContext(Company); ErpContext.OnFieldChanged += HandleFieldChanged; - ErpContext.OnValidationStateChanged += ValidationChanged; + ErpContext.OnValidationStateChanged += ValidationChanged!; } /// diff --git a/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor b/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor index b07b39e1..b4a177c5 100644 --- a/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor +++ b/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor @@ -16,7 +16,7 @@ @using Microsoft.AspNetCore.Authorization @using Wonky.Client.Components @attribute [Authorize(Roles = "Advisor")] -@page "/advisor/customers/{CompanyId}/workplaces/{WorkplaceId}/doc" +@page "/advisor/customers/{CompanyId}/workplaces/{WorkplaceId}/documents/new" @Workplace.CompanyName - @Workplace.Name
@@ -33,6 +33,69 @@
+ + +
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ +
+ +
+
+
+ @if (Working) diff --git a/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor.cs b/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor.cs index 7b572cf6..6d7765e9 100644 --- a/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor.cs +++ b/Wonky.Client/Pages/CrmCustomerWorkplaceDocumentAddPage.razor.cs @@ -33,12 +33,11 @@ namespace Wonky.Client.Pages; public partial class CrmCustomerWorkplaceDocumentAddPage : IDisposable { // ############################################################# - [Inject] public ICrmWorkplaceRepository Workplaces { get; set; } [Inject] public ICrmWorkplaceRepository WorkplaceRepo { get; set; } + [Inject] public ICrmPublicProductRepository PublicProductRepo { get; set; } [Inject] public HttpInterceptorService Interceptor { get; set; } [Inject] public NavigationManager Navigator { get; set; } [Inject] public ILogger Logger { get; set; } - [Inject] public ISystemSendMailService SendMail { get; set; } [Inject] public IToastService Toaster { get; set; } // ############################################################# @@ -46,64 +45,34 @@ public partial class CrmCustomerWorkplaceDocumentAddPage : IDisposable [Parameter] public string WorkplaceId { get; set; } = ""; // ############################################################# + private EditContext FormContext { get; set; } private WorkplaceDto Workplace { get; set; } = new(); - private EditContext WorkplaceContext { get; set; } - private bool Working { get; set; } = true; private WorkplaceInventory WorkplaceInventory { get; set; } = new(); - private List DocViews { get; set; } = new(); - private ConfirmDeleteModal ConfirmDeleteWorkplace { get; set; } - private ConfirmDeleteModal ConfirmDeleteProduct { get; set; } - private string DeleteMessage { get; set; } = ""; - private string LinkRecipients { get; set; } = ""; - private const string CopyText = "Kopier"; - private const string CopyStyle = "btn btn-primary"; - private const string SuccessText = "Kopieret"; - private const string SuccessStyle = "btn btn-success"; - private string _buttonText = CopyText; - private string _buttonStyle = CopyStyle; - + private List AvailableProducts { get; set; } = new(); + private WorkplaceDocumentDto WorkplaceDocumentDto { get; set; } = new(); + private bool Working { get; set; } = true; + private bool FormInvalid { get; set; } = true; protected override async Task OnInitializedAsync() { - WorkplaceContext = new EditContext(Workplace); - WorkplaceContext.OnFieldChanged += HandleFieldChanged!; - WorkplaceContext.OnValidationStateChanged += ValidationChanged!; - + FormContext = new EditContext(WorkplaceDocumentDto); Interceptor.RegisterEvent(); Interceptor.RegisterBeforeSendEvent(); - Workplace = await Workplaces.GetWorkplace(CompanyId, WorkplaceId); + Workplace = await WorkplaceRepo.GetWorkplace(CompanyId, WorkplaceId); WorkplaceInventory = await WorkplaceRepo.GetWorkplaceInventory(CompanyId, WorkplaceId); - + AvailableProducts = await PublicProductRepo.GetProducts(); + Working = false; } - - - private void HandleFieldChanged(object sender, FieldChangedEventArgs e) - { - - WorkplaceContext.Validate(); - - StateHasChanged(); - } - - private void ValidationChanged(object sender, ValidationStateChangedEventArgs e) + private void SubmitForm() { - WorkplaceContext.OnFieldChanged -= HandleFieldChanged!; - WorkplaceContext.OnValidationStateChanged -= ValidationChanged!; - WorkplaceContext = new EditContext(Workplace); - - WorkplaceContext.OnFieldChanged += HandleFieldChanged!; - WorkplaceContext.OnValidationStateChanged += ValidationChanged!; } - public void Dispose() { - WorkplaceContext.OnFieldChanged += HandleFieldChanged!; - WorkplaceContext.OnValidationStateChanged += ValidationChanged!; Interceptor.DisposeEvent(); } } diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index e2a0bb8f..750e4791 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,15 +1,15 @@ { "appInfo": { "name": "Wonky Online", - "version": "146.5", + "version": "147.0", "rc": true, - "sandBox": true, + "sandBox": false, "image": "grumpy-coder.png" }, "Logging": { "LogLevel": { - "Default": "Debug", - "System": "Debug", + "Default": "Information", + "System": "Information", "Microsoft": "Information" }, "Debug": { @@ -19,7 +19,7 @@ } }, "apiConfig": { - "baseUrl": "https://eta.innotec.dk", + "baseUrl": "https://zeta.innotec.dk", "catalog": "api/v2/catalog/country", "crmCustomers": "api/v2/crm/companies", "crmInventoryExt": "history/inventory", diff --git a/Wonky.Entity/DTO/ActivityDto.cs b/Wonky.Entity/DTO/ActivityDto.cs index 6c28ec78..4452f3fe 100644 --- a/Wonky.Entity/DTO/ActivityDto.cs +++ b/Wonky.Entity/DTO/ActivityDto.cs @@ -21,207 +21,106 @@ namespace Wonky.Entity.DTO; public class ActivityDto { - /// - /// Activity entity id - /// public string SalesHeadId { get; set; } = ""; - - /// - /// Sales representative identification - /// - [Required] + + [Required] public string SalesRep { get; set; } = ""; - - /// - /// Sales representative entity Id - /// - [Required] + + [Required] public string SalesRepId { get; set; } = ""; - - /// - /// Company countryCode (ensure correct code when office create ordre) - /// + [Required] public string CountryCode { get; set; } = ""; - - /// - /// Company entity Id - /// + [Required] public string CompanyId { get; set; } = ""; - - /// - /// Business Central entity Id - /// + public string BcId { get; set; } = ""; - - /// - /// Customer account - /// + public string Account { get; set; } = ""; - /// - /// VAT number - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string VatNumber { get; set; } = ""; - /// - /// Customer name - /// [Required(ErrorMessage = "Navn skal udfyldes")] [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Name { get; set; } = ""; - /// - /// Customer address city name - /// [Required(ErrorMessage = "Byanvn skal udfyldes")] [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string City { get; set; } = ""; - /// - /// Customer address postal code - /// [Required(ErrorMessage = "Postnr. skal udfyldes")] [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ZipCode { get; set; } = ""; - /// - /// Customer address line 1 - /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Address1 { get; set; } = ""; - /// - /// Customer address line 2 - /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Address2 { get; set; } = ""; - /// - /// Customer office phone - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = ""; - /// - /// Customer mobile phone - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = ""; - /// - /// Customer office email - /// [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string Email { get; set; } = ""; - /// - /// Customer attention description - /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Attention { get; set; } = ""; - /// - /// Flag express order - /// public bool Express { get; set; } - // Form entries - /// - /// Activity status enum as string - /// [Required(ErrorMessage = "Vælg status for besøg ")] public string ActivityStatusEnum { get; set; } = ""; - /// - /// Activity type enum as string - /// [Required(ErrorMessage = "Vælg aktivitetstype")] public string ActivityTypeEnum { get; set; } = ""; - /// - /// Visit type enum as string - /// public string ActivityVisitEnum { get; set; } = "recall"; - /// - /// Activity date - /// [Required(ErrorMessage = "Dato skal angives")] public string ActivityDate { get; set; } = ""; - /// - /// Product demonstration - /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Demo { get; set; } = ""; - /// - /// Our reference - system generated - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string OurRef { get; set; } = ""; - /// - /// Customer reference number - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ReferenceNumber { get; set; } = ""; - /// - /// Customer reference description - /// [MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")] public string YourRef { get; set; } = ""; - /// - /// Processing note to office - /// [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string OrderMessage { get; set; } = ""; - /// - /// CRM note for future reference - /// [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string CrmNote { get; set; } = ""; - // Delivery address form entries - /// - /// Customer delivery name - /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvName { get; set; } = ""; - /// - /// Customer delivery address line 1 - /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvAddress1 { get; set; } = ""; - /// - /// Customer delivery address line 2 - /// [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string DlvAddress2 { get; set; } = ""; - /// - /// Customer delivery postal code - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string DlvZipCode { get; set; } = ""; - /// - /// Customer delivery city name - /// [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string DlvCity { get; set; } = ""; - // Lines - /// - /// Order lines - /// + public string EanNumber { get; set; } = ""; + + public string Segment { get; set; } = ""; + public List Lines { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Entity/DTO/CompanyDto.cs b/Wonky.Entity/DTO/CompanyDto.cs index 01a39de8..519b6a17 100644 --- a/Wonky.Entity/DTO/CompanyDto.cs +++ b/Wonky.Entity/DTO/CompanyDto.cs @@ -21,180 +21,79 @@ namespace Wonky.Entity.DTO; public class CompanyDto { - /// - /// Account number - /// - [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] + [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Account { 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; } = ""; - - /// - /// Attention - /// - [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] - public string Attention { get; set; } = ""; - - /// - /// Business Central entity Id - /// - public string BcId { get; set; } = ""; - /// - /// ERP block state - /// - /// Empty string - Customer not blocked + [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] + public string Address1 { get; set; } = ""; + + [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] + public string Address2 { get; set; } = ""; + + [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] + public string Attention { get; set; } = ""; + + public string BcId { get; set; } = ""; public string Blocked { get; set; } = ""; - - /// - /// City name - /// + [Required(ErrorMessage = "Bynavn skal udfyldes")] [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string City { get; set; } = ""; - - /// - /// Company Id - /// - public string CompanyId { get; set; } = ""; - - /// - /// Country code ISO - /// - public string CountryCode { get; set; } = ""; - - /// - /// Crm note - /// - public string CrmNotes { get; set; } = ""; - /// - /// Ean number - /// + public string CompanyId { get; set; } = ""; + public string CountryCode { get; set; } = ""; + public string CrmNotes { get; set; } = ""; public string EanNumber { get; set; } = ""; - - /// - /// Office email - /// - [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] + + [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string Email { get; set; } = ""; - /// - /// Fax - /// [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string Fax { get; set; } = ""; - - /// - /// Value indication if company has shutdown - /// - /// 0 or 1 + public int HasFolded { get; set; } - - /// - /// Date for last sync of product history - /// public string HistorySync { get; set; } = ""; - /// - /// 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; - - /// - /// User value for hiding the company is out of business - /// - /// 0 or 1 + public int IsHidden { get; set; } - - /// - /// Last visit - /// public string LastVisit { get; set; } = "2010-01-01"; - - /// - /// Mobile phone number - /// - [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] + + [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = ""; - - /// - /// Name - /// + [Required(ErrorMessage = "Navn skal udfyldes")] [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Name { get; set; } = ""; - /// - /// Next visit - /// public string NextVisit { get; set; } = "2010-01-01"; - /// - /// Alert - /// [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Note { get; set; } = ""; - /// - /// Phone number - /// - [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] + [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = ""; - /// - /// SalesRep ERP identifier - /// public string SalesRep { get; set; } = ""; - - /// - /// Sales representative entity Id - /// + public string SalesRepId { get; set; } = ""; - - /// - /// Customer Segment - /// + + [Required(ErrorMessage = "Segment skal vælges - AUTO eller INDUSTRI")] public string Segment { get; set; } = ""; - - /// - /// Value indicating the VAT number is valid - /// - /// 0 or 1 + public int ValidVat { get; set; } - /// - /// VAT number - /// [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string VatNumber { get; set; } = ""; - /// - /// Postal code - /// [Required(ErrorMessage = "Postnummer skal udfyldes")] [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ZipCode { get; set; } = ""; - /// - /// Virtual property indicating if timespan is within the defined interval - /// - /// true/false public virtual bool ValidDateSpan() { - var notAllowed = new List {"2010-01-01", "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/UpdateDocHeaderDto.cs b/Wonky.Entity/DTO/UpdateDocHeaderDto.cs new file mode 100644 index 00000000..da477e62 --- /dev/null +++ b/Wonky.Entity/DTO/UpdateDocHeaderDto.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace Wonky.Entity.DTO; + +public class UpdateDocHeaderDto +{ + [Required][MaxLength(128)] public string ApprovedBy { get; set; } = ""; + [Required][MaxLength(10)] public string ApprovedDate { get; set; } = ""; + [Required][MaxLength(128)] public string AuthoredBy { get; set; } = ""; + [Required][MaxLength(128)] public string DocumentId { get; set; } = ""; + [Required][MaxLength(10)] public string FollowupDate { get; set; } = ""; +} \ No newline at end of file diff --git a/Wonky.Entity/DTO/WorkplaceBopCreate.cs b/Wonky.Entity/DTO/WorkplaceBopCreate.cs deleted file mode 100644 index cfdcd98a..00000000 --- a/Wonky.Entity/DTO/WorkplaceBopCreate.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; - -namespace Wonky.Entity.DTO; - -public class WorkplaceBopCreate -{ - public string EyeCleanerLocation { get; set; } = ""; - public string FirstAidLocation { get; set; } = ""; - public string GlovesStorage { get; set; } = ""; - public string GogglesStorage { get; set; } = ""; - public string MaskStorage { get; set; } = ""; - public string ProductStorage { get; set; } = ""; - public string WasteDeposit { get; set; } = ""; - public string AuthoredBy { get; set; } = ""; - public string ApprovedBy { get; set; } = ""; - public string ApprovedDate { get; set; } = ""; - public string FollowupDate { get; set; } = ""; - - public List ProductVariants { get; set; } = new(); -} - -public class ProductVariants -{ - public string VariantId { get; set; } = ""; - public string S5A { get; set; } = ""; - public string S9A { get; set; } = ""; - - // Sweden - // yearly consumption and product exposure - // public string S11A { get; set; } = ""; -} \ No newline at end of file diff --git a/Wonky.Entity/DTO/WorkplaceDocumentDto.cs b/Wonky.Entity/DTO/WorkplaceDocumentDto.cs new file mode 100644 index 00000000..4ea3e877 --- /dev/null +++ b/Wonky.Entity/DTO/WorkplaceDocumentDto.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Wonky.Entity.DTO; + +public class WorkplaceDocumentDto +{ + [Required] public string EyeCleanerLocation { get; set; } = ""; + [Required]public string FirstAidLocation { get; set; } = ""; + [Required]public string GlovesStorage { get; set; } = ""; + [Required]public string GogglesStorage { get; set; } = ""; + [Required]public string MaskStorage { get; set; } = ""; + [Required]public string ProductStorage { get; set; } = ""; + [Required]public string WasteDeposit { get; set; } = ""; + [Required]public string AuthoredBy { get; set; } = ""; + [Required]public string ApprovedBy { get; set; } = ""; + [Required]public string ApprovedDate { get; set; } = ""; + [Required]public string FollowupDate { get; set; } = ""; + + public List ProductVariants { get; set; } = new(); +} + +public class ProductVariant +{ + [Required] public string VariantId { get; set; } = ""; + public string S5A { get; set; } = ""; + public string S9A { get; set; } = ""; + + // Sweden + // yearly consumption and product exposure + // public string S11A { get; set; } = ""; +} \ No newline at end of file diff --git a/Wonky.Entity/Views/ExternalProductListView.cs b/Wonky.Entity/Views/ExternalProductListView.cs index f8d8e5a2..3343e4de 100644 --- a/Wonky.Entity/Views/ExternalProductListView.cs +++ b/Wonky.Entity/Views/ExternalProductListView.cs @@ -9,16 +9,4 @@ public class ExternalProductListView public string PictureLink { get; set; } = ""; public string ProductCategoryEnum { get; set; } = ""; public List Variants { get; set; } = new(); -} - -public class ExternalProductVariantView -{ - public string VariantId { get; set; } = ""; - public string Name { get; set; } = ""; - public string Sku { get; set; } = ""; - public string ErpName { get; set; } = ""; - public string ErpSku { get; set; } = ""; - public string ShortName { get; set; } = ""; - public string PictureLink { get; set; } = ""; - public bool Selected { get; set; } } \ No newline at end of file diff --git a/Wonky.Entity/Views/ExternalProductVariantView.cs b/Wonky.Entity/Views/ExternalProductVariantView.cs new file mode 100644 index 00000000..b7a63b15 --- /dev/null +++ b/Wonky.Entity/Views/ExternalProductVariantView.cs @@ -0,0 +1,13 @@ +namespace Wonky.Entity.Views; + +public class ExternalProductVariantView +{ + public string VariantId { get; set; } = ""; + public string Name { get; set; } = ""; + public string Sku { get; set; } = ""; + public string ErpName { get; set; } = ""; + public string ErpSku { get; set; } = ""; + public string ShortName { get; set; } = ""; + public string PictureLink { get; set; } = ""; + public bool Selected { get; set; } +} \ No newline at end of file