2023-07-07 16:26:16 +05:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Data;
|
|
|
|
|
|
|
|
/// <summary>
|
2023-07-11 18:57:25 +05:00
|
|
|
/// DTO уведомления
|
2023-07-07 16:26:16 +05:00
|
|
|
/// </summary>
|
|
|
|
public class NotificationDto : IId
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Id уведомления
|
|
|
|
/// </summary>
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Id получателя уведомления
|
|
|
|
/// </summary>
|
|
|
|
public int IdUser { get; set; }
|
|
|
|
|
2023-07-19 14:24:22 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Email получателя уведомления
|
|
|
|
/// </summary>
|
|
|
|
public string? UserEmail { get; set; }
|
|
|
|
|
2023-07-07 16:26:16 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Id категории уведомления
|
|
|
|
/// </summary>
|
|
|
|
public int IdNotificationCategory { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Заголовок уведомления
|
|
|
|
/// </summary>
|
|
|
|
public string Title { get; set; } = null!;
|
|
|
|
|
|
|
|
/// <summary>
|
2023-07-11 18:57:25 +05:00
|
|
|
/// Сообщение уведомления
|
2023-07-07 16:26:16 +05:00
|
|
|
/// </summary>
|
2023-07-11 18:57:25 +05:00
|
|
|
public string Message { get; set; } = null!;
|
2023-07-13 14:44:40 +05:00
|
|
|
|
2023-07-07 16:26:16 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Дата отправки уведомления
|
|
|
|
/// </summary>
|
2023-07-11 18:57:25 +05:00
|
|
|
public DateTime? SentDate { get; set; }
|
|
|
|
|
2023-07-10 16:43:58 +05:00
|
|
|
/// <summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
/// Дата прочтения уведомления
|
2023-07-10 16:43:58 +05:00
|
|
|
/// </summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
public DateTime? ReadDate { get; set; }
|
2023-07-11 18:57:25 +05:00
|
|
|
|
2023-07-07 16:26:16 +05:00
|
|
|
/// <summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
/// Состояние уведомления
|
|
|
|
/// 0 - Зарегистрировано,
|
|
|
|
/// 1 - Отправлено,
|
|
|
|
/// 2 - Прочитано
|
2023-07-07 16:26:16 +05:00
|
|
|
/// </summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
public int IdState
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (SentDate is not null && ReadDate is not null)
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
if (SentDate is not null)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2023-07-11 18:57:25 +05:00
|
|
|
|
|
|
|
/// <summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
/// Id типа доставки уведомления
|
|
|
|
/// 0 - SignalR
|
2023-07-19 14:24:22 +05:00
|
|
|
/// 1 - Email
|
2023-07-11 18:57:25 +05:00
|
|
|
/// </summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
public int IdTransportType { get; set; }
|
|
|
|
|
2023-07-11 18:57:25 +05:00
|
|
|
/// <summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
/// DTO категории уведомления
|
2023-07-11 18:57:25 +05:00
|
|
|
/// </summary>
|
2023-07-13 14:44:40 +05:00
|
|
|
public NotificationCategoryDto NotificationCategory { get; set; } = null!;
|
2023-07-07 16:26:16 +05:00
|
|
|
}
|