2023-03-07 12:40:02 +01:00
|
|
|
|
// Copyright (C) 2022 FCS Frede's Computer Services.
|
2022-03-11 14:21:04 +01:00
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
2022-05-31 19:07:39 +02:00
|
|
|
|
// it under the terms of the GNU Affero General Public License as
|
2022-03-11 14:21:04 +01:00
|
|
|
|
// 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
|
2022-05-31 19:07:39 +02:00
|
|
|
|
// GNU Affero General Public License for more details.
|
2022-03-11 14:21:04 +01:00
|
|
|
|
//
|
2022-05-31 19:07:39 +02:00
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
2022-03-11 14:21:04 +01:00
|
|
|
|
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
|
|
|
|
//
|
|
|
|
|
|
2023-03-07 12:40:02 +01:00
|
|
|
|
|
2022-03-11 14:21:04 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
2022-09-06 12:28:44 +02:00
|
|
|
|
namespace Wonky.Entity.DTO;
|
|
|
|
|
|
2023-03-18 16:01:22 +01:00
|
|
|
|
public class ActivityModel
|
2022-03-11 14:21:04 +01:00
|
|
|
|
{
|
2022-09-06 12:28:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Activity entity id
|
|
|
|
|
/// </summary>
|
2022-09-28 12:35:26 +02:00
|
|
|
|
public string SalesHeadId { get; set; } = "";
|
2022-09-14 13:45:55 +02:00
|
|
|
|
|
2022-09-06 12:28:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sales representative identification
|
|
|
|
|
/// </summary>
|
2022-09-14 13:45:55 +02:00
|
|
|
|
[Required] public string SalesRep { get; set; } = "";
|
2022-09-06 12:28:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sales representative entity Id
|
|
|
|
|
/// </summary>
|
2022-09-14 13:45:55 +02:00
|
|
|
|
[Required] public string SalesRepId { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Company countryCode (ensure correct code when office create ordre)
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required] public string CountryCode { get; set; } = "";
|
2022-09-06 12:28:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Company entity Id
|
|
|
|
|
/// </summary>
|
2022-09-14 13:45:55 +02:00
|
|
|
|
[Required] public string CompanyId { get; set; } = "";
|
2022-09-06 12:28:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Business Central entity Id
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string BcId { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer account
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Account { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// VAT number
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string VatNumber { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer name
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required(ErrorMessage = "Navn skal udfyldes")]
|
|
|
|
|
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
|
|
|
|
|
public string Name { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 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>
|
|
|
|
|
/// 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>
|
|
|
|
|
/// Customer address line 1
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
|
|
|
|
|
public string Address1 { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer address line 2
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
|
|
|
|
|
public string Address2 { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer office phone
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string Phone { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer mobile phone
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string Mobile { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer office email
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
|
|
|
|
|
public string Email { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer attention description
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
|
|
|
|
|
public string Attention { get; set; } = "";
|
|
|
|
|
// Form entries
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Activity type enum as string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required(ErrorMessage = "Vælg aktivitetstype")]
|
|
|
|
|
public string ActivityTypeEnum { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Flag express order
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Express { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Activity status enum as string
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required(ErrorMessage = "Vælg status for besøg ")]
|
|
|
|
|
public string ActivityStatusEnum { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Visit type enum as string
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string VisitTypeEnum { get; set; } = "recall";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Activity date
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required(ErrorMessage = "Dato skal angives")]
|
|
|
|
|
public string ActivityDate { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Product demonstration
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
|
|
|
|
|
public string Demo { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Our reference - system generated
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string OurRef { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer reference number
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string ReferenceNumber { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer reference description
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")]
|
|
|
|
|
public string YourRef { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processing note to office
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
|
|
|
|
|
public string OrderMessage { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// CRM note for future reference
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
|
|
|
|
|
public string CrmNote { get; set; } = "";
|
|
|
|
|
// Delivery address form entries
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer delivery name
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
|
|
|
|
|
public string DlvName { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer delivery address line 1
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
|
|
|
|
|
public string DlvAddress1 { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer delivery address line 2
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
|
|
|
|
|
public string DlvAddress2 { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer delivery postal code
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
|
|
|
|
|
public string DlvZipCode { get; set; } = "";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Customer delivery city name
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
|
|
|
|
|
public string DlvCity { get; set; } = "";
|
|
|
|
|
// Lines
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Order lines
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<ActivityLineDto> Lines { get; set; } = new();
|
|
|
|
|
}
|