forked from ddrilling/AsbCloudServer
68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
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!;
|
||
|
||
}
|
||
}
|