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_transport"), Comment("Id способа доставки уведомления")] public int IdNotificationTransport { get; set; } [Column("id_notification_category"), Comment("Id категории уведомления")] public int IdNotificationCategory { get; set; } [Column("title"), Comment("Заголовок уведомления")] public string Title { get; set; } = null!; [Column("subject"), Comment("Текст уведомления")] public string Subject { get; set; } = null!; [Column("time_to_life"), Comment("Время жизни уведомления")] public TimeSpan TimeToLife { get; set; } [Column("sent_date_at_utc"), Comment("Дата отправки уведомления")] public DateTime? SentDateAtUtc { get; set; } [Column("is_read"), Comment("Прочитано ли уведомление")] public bool? IsRead { get; set; } [ForeignKey(nameof(IdNotificationTransport))] public virtual NotificationTransport NotificationTransport { get; set; } = null!; [ForeignKey(nameof(IdNotificationCategory))] public virtual NotificationCategory NotificationCategory { get; set; } = null!; [ForeignKey(nameof(IdUser))] public virtual User User { get; set; } = null!; }