DD.WellWorkover.Cloud/AsbCloudApp/Data/User/ContactDto.cs

68 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.User
{
/// <summary>
/// Контакт
/// </summary>
public class ContactDto : IId
{
/// <inheritdoc/>
public int Id { get; set; }
/// <summary>
/// ключ типа компании
/// </summary>
[Required]
public int IdCompanyType { get; set; }
/// <summary>
/// ключ скважины
/// </summary>
[Required]
public int IdWell { get; set; }
/// <summary>
/// ФИО
/// </summary>
[Required]
[StringLength(260, MinimumLength = 0, ErrorMessage = "Допустимая длина ФИО от 1 до 260 символов")]
public string FullName { get; set; } = null!;
/// <summary>
/// Email
/// </summary>
[Required]
[RegularExpression(
@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",
ErrorMessage = "Некорректный email")]
public string Email { get; set; } = null!;
/// <summary>
/// Phone
/// </summary>
[Required]
[RegularExpression(
@"^(?:\+7|8)\s?(?:\(\d{3}\)|\d{3})\s?\d{3}-?\d{2}-?\d{2}$",
ErrorMessage = "Некорректный номер телефона")]
public string Phone { get; set; } = null!;
/// <summary>
/// Должность
/// </summary>
[Required]
[StringLength(260, MinimumLength = 1, ErrorMessage = "Допустимая длина должности от 1 до 260 символов")]
public string Position { get; set; } = null!;
/// <summary>
/// Компания
/// </summary>
[Required]
[StringLength(260, MinimumLength = 3, ErrorMessage = "Допустимая длина должности от 3 до 260 символов")]
public string Company { get; set; } = null!;
}
}