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

namespace TakeoutSaaS.Domain.CustomerService.Entities;

/// <summary>
/// 会话消息。
/// </summary>
public sealed class ChatMessage : MultiTenantEntityBase
{
    /// <summary>
    /// 会话标识。
    /// </summary>
    public long ChatSessionId { get; set; }

    /// <summary>
    /// 发送方类型。
    /// </summary>
    public MessageSenderType SenderType { get; set; } = MessageSenderType.Customer;

    /// <summary>
    /// 发送方用户 ID。
    /// </summary>
    public long? SenderUserId { get; set; }

    /// <summary>
    /// 消息内容。
    /// </summary>
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 消息类型（文字/图片/语音等）。
    /// </summary>
    public string ContentType { get; set; } = "text/plain";

    /// <summary>
    /// 是否已读。
    /// </summary>
    public bool IsRead { get; set; }

    /// <summary>
    /// 读取时间。
    /// </summary>
    public DateTime? ReadAt { get; set; }
}
