DD.WellWorkover.Cloud/AsbCloudDb/Model/Notification.cs

44 lines
1.5 KiB
C#
Raw Normal View History

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model;
[Table("t_notification"), Comment("Уведомления")]
public class Notification : IId
{
[Key]
[Column("id")]
public int Id { get; set; }
[Column("id_user"), Comment("Id получателя")]
public int IdUser { get; set; }
[Column("id_notification_category"), Comment("Id категории уведомления")]
public int IdNotificationCategory { get; set; }
[Column("title"), Comment("Заголовок уведомления")]
public string Title { get; set; } = null!;
[Column("message"), Comment("Сообщение уведомления")]
public string Message { get; set; } = null!;
[Column("time_to_life"), Comment("Время жизни уведомления")]
public TimeSpan TimeToLife { get; set; }
[Column("sent_date"), Comment("Дата отправки уведомления")]
public DateTime? SentDate { get; set; }
[Column("notification_state"), Comment("Состояние уведомления")]
public string NotificationState { get; set; } = null!;
[Column("notification_transport"), Comment("Метод доставки уведомления")]
public string NotificationTransport { get; set; } = null!;
[ForeignKey(nameof(IdNotificationCategory))]
public virtual NotificationCategory NotificationCategory { get; set; } = null!;
[ForeignKey(nameof(IdUser))]
public virtual User User { get; set; } = null!;
}