2023-06-21 11:44:04 +05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using AsbCloudApp.Data.User;
|
2023-02-17 15:30:17 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Data
|
2021-07-21 15:22:58 +05:00
|
|
|
|
{
|
2022-06-01 17:52:26 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// DTO компании
|
|
|
|
|
/// </summary>
|
2021-09-10 11:28:57 +05:00
|
|
|
|
public class CompanyDto : IId
|
2021-07-21 15:22:58 +05:00
|
|
|
|
{
|
2022-06-01 17:52:26 +05:00
|
|
|
|
/// <inheritdoc/>
|
2021-07-21 15:22:58 +05:00
|
|
|
|
public int Id { get; set; }
|
2022-06-01 17:52:26 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Название
|
|
|
|
|
/// </summary>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Required]
|
2023-03-10 05:09:41 +05:00
|
|
|
|
[StringLength(50, MinimumLength = 1, ErrorMessage = "Допустимое имя компании от 1 до 50 символов")]
|
2023-02-17 15:30:17 +05:00
|
|
|
|
public string Caption { get; set; } = null!;
|
2022-06-01 17:52:26 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ИД типа компании
|
2023-03-10 13:40:05 +05:00
|
|
|
|
/// </summary>
|
2022-01-13 14:34:58 +05:00
|
|
|
|
public int IdCompanyType { get; set; }
|
2022-06-01 17:52:26 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Название типа компании
|
|
|
|
|
/// </summary>
|
2023-03-10 05:09:41 +05:00
|
|
|
|
[StringLength(30, MinimumLength = 1, ErrorMessage = "Допустимое имя типа компании от 1 до 30 символов")]
|
2023-03-10 05:48:43 +05:00
|
|
|
|
public string? CompanyTypeCaption { get; set; } = null!;
|
2023-06-21 11:44:04 +05:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// DTO компании с пользователями
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class CompanyWithUsersDto: CompanyDto
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Пользователи компании
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<UserContactDto> Users { get; set; } = Enumerable.Empty<UserContactDto>();
|
2021-07-21 15:22:58 +05:00
|
|
|
|
}
|
|
|
|
|
}
|