#nullable enable
using Baya.Domain.Common;

namespace Baya.Domain.Entities.Notifications;

/// <summary>
/// An in-app notification for a single user. <see cref="DataJson"/> is a typed, versioned deep-link
/// payload the front-end navigates on — not an arbitrary blob. Read notifications older than 90 days are
/// hard-deleted by the retention job; unread ones are never auto-deleted.
/// </summary>
public class Notification : IEntity
{
    public long Id { get; set; }

    public int UserId { get; set; }

    public string Type { get; set; } = string.Empty;

    public string Title { get; set; } = string.Empty;

    public string? Body { get; set; }

    public string? DataJson { get; set; }

    public bool IsRead { get; set; }

    public DateTimeOffset? ReadAt { get; set; }

    public DateTimeOffset CreatedAt { get; set; }
}
