using TakeoutSaaS.Domain.Tenants.Enums;
using TakeoutSaaS.Shared.Abstractions.Entities;

namespace TakeoutSaaS.Domain.Tenants.Entities;

/// <summary>
/// 面向租户的站内通知或消息推送。
/// </summary>
public sealed class TenantNotification : MultiTenantEntityBase
{
    /// <summary>
    /// 通知标题。
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 通知正文。
    /// </summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>
    /// 发布通道（站内、邮件、短信等）。
    /// </summary>
    public TenantNotificationChannel Channel { get; set; } = TenantNotificationChannel.InApp;

    /// <summary>
    /// 通知重要级别。
    /// </summary>
    public TenantNotificationSeverity Severity { get; set; } = TenantNotificationSeverity.Info;

    /// <summary>
    /// 推送时间。
    /// </summary>
    public DateTime SentAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// 租户是否已阅读。
    /// </summary>
    public DateTime? ReadAt { get; set; }

    /// <summary>
    /// 附加元数据 JSON。
    /// </summary>
    public string? MetadataJson { get; set; }
}
