mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 07:40:13 +01:00
21 lines
679 B
C#
21 lines
679 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Schema;
|
|
|
|
[PrimaryKey("NotificationId")]
|
|
public class Notification(string title, string message = "", NotificationUrgency urgency = NotificationUrgency.Normal, DateTime? date = null)
|
|
{
|
|
[MaxLength(64)]
|
|
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification");
|
|
|
|
public NotificationUrgency Urgency { get; init; } = urgency;
|
|
|
|
public string Title { get; init; } = title;
|
|
|
|
public string Message { get; init; } = message;
|
|
|
|
public DateTime Date { get; init; } = date ?? DateTime.UtcNow;
|
|
|
|
public Notification() : this("") { }
|
|
} |