51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using ProjectGSM.Entities.Enums;
|
|
using System.ComponentModel;
|
|
|
|
namespace ProjectGSM.Entities;
|
|
|
|
public class Advocate
|
|
{
|
|
public int Id { get; private set; }
|
|
public string Name { get; private set; } = string.Empty;
|
|
public bool Sex { get; private set; }
|
|
public DateTime DateOfBirth { get; private set; }
|
|
public int Experience { get; private set; }
|
|
public int CompletedTasks { get; private set; }
|
|
public int Rating { get; private set; }
|
|
public string Email { get; private set; } = string.Empty;
|
|
public string PhoneNumber { get; private set; } = string.Empty;
|
|
public string Address { get; private set; } = string.Empty;
|
|
public LicenseType LicenseType { get; private set; }
|
|
public DateTime CreatedAt { get; private set; } = DateTime.UtcNow;
|
|
|
|
// Конструктор для создания сущности
|
|
public static Advocate CreateEntity(
|
|
int id,
|
|
string name,
|
|
bool sex,
|
|
DateTime dateOfBirth,
|
|
int experience,
|
|
int completedTasks,
|
|
int rating,
|
|
string email,
|
|
string phoneNumber,
|
|
string address, LicenseType license)
|
|
{
|
|
return new Advocate
|
|
{
|
|
Id = id,
|
|
Name = name ?? string.Empty,
|
|
Sex = sex,
|
|
DateOfBirth = dateOfBirth,
|
|
Experience = experience,
|
|
CompletedTasks = completedTasks,
|
|
Rating = rating,
|
|
Email = email ?? string.Empty,
|
|
PhoneNumber = phoneNumber ?? string.Empty,
|
|
Address = address ?? string.Empty,
|
|
LicenseType = license,
|
|
CreatedAt = DateTime.UtcNow
|
|
};
|
|
}
|
|
}
|