using System.ComponentModel.DataAnnotations; namespace Diligent.WebAPI.Host.DTOs.Customer { public class CustomerCreateDTO { [RegularExpression(@"^[a-zA-Z0-9]+$", ErrorMessage = "First Name should not contain special characters")] [Required(ErrorMessage = "Field First Name should not be empty")] public string FirstName { get; set; } [RegularExpression(@"^[a-zA-Z0-9]+$", ErrorMessage = "Last Name should not contain special characters")] [Required(ErrorMessage = "Field Last Name should not be empty")] public string LastName { get; set; } [Required(ErrorMessage = "Field E-mail should not be empty")] [EmailAddress(ErrorMessage = "Category Name should not be empty")] public string Email { get; set; } [Required(ErrorMessage = "Field Username should not be empty")] [MinLength(8, ErrorMessage = "Username must have a minimum length of 6 characters")] public string Username { get; set; } [Required(ErrorMessage = "Field Password should not be empty")] [RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,32}$", ErrorMessage = "Password must be between 8 and 32 characters and contain one uppercase letter, one lowercase letter, one digit and one special character.")] [MinLength(8, ErrorMessage = "Password must have a minimum length of 8 characters")] public string Password { get; set; } } }