Tranga/API/Schema/Notification.cs

19 lines
583 B
C#
Raw Normal View History

2024-12-16 17:35:36 +01:00
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace API.Schema;
2024-12-16 18:02:48 +01:00
[PrimaryKey("NotificationId")]
2024-12-16 20:03:45 +01:00
public class Notification(string title, string message = "", byte urgency = 2, DateTime? date = null)
2024-12-16 17:35:36 +01:00
{
[MaxLength(64)]
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification", 64);
2024-12-16 17:58:25 +01:00
public byte Urgency { get; init; } = urgency;
2024-12-16 17:35:36 +01:00
public string Title { get; init; } = title;
public string Message { get; init; } = message;
2024-12-16 20:03:45 +01:00
public DateTime? Date { get; init; } = date ?? DateTime.UtcNow;
2024-12-16 17:35:36 +01:00
}