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

namespace TakeoutSaaS.Domain.CustomerService.Entities;

/// <summary>
/// 客服工单。
/// </summary>
public sealed class SupportTicket : MultiTenantEntityBase
{
    /// <summary>
    /// 工单编号。
    /// </summary>
    public string TicketNo { get; set; } = string.Empty;

    /// <summary>
    /// 客户用户 ID。
    /// </summary>
    public long CustomerUserId { get; set; }

    /// <summary>
    /// 关联订单（如有）。
    /// </summary>
    public long? OrderId { get; set; }

    /// <summary>
    /// 工单主题。
    /// </summary>
    public string Subject { get; set; } = string.Empty;

    /// <summary>
    /// 工单详情。
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 优先级。
    /// </summary>
    public TicketPriority Priority { get; set; } = TicketPriority.Normal;

    /// <summary>
    /// 状态。
    /// </summary>
    public TicketStatus Status { get; set; } = TicketStatus.Open;

    /// <summary>
    /// 指派的客服。
    /// </summary>
    public long? AssignedAgentId { get; set; }

    /// <summary>
    /// 关闭时间。
    /// </summary>
    public DateTime? ClosedAt { get; set; }
}
