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

namespace TakeoutSaaS.Domain.Payments.Entities;

/// <summary>
/// 支付渠道退款流水。
/// </summary>
public sealed class PaymentRefundRecord : MultiTenantEntityBase
{
    /// <summary>
    /// 原支付记录标识。
    /// </summary>
    public long PaymentRecordId { get; set; }

    /// <summary>
    /// 关联订单标识。
    /// </summary>
    public long OrderId { get; set; }

    /// <summary>
    /// 退款金额。
    /// </summary>
    public decimal Amount { get; set; }

    /// <summary>
    /// 渠道退款流水号。
    /// </summary>
    public string? ChannelRefundId { get; set; }

    /// <summary>
    /// 退款状态。
    /// </summary>
    public PaymentRefundStatus Status { get; set; } = PaymentRefundStatus.Pending;

    /// <summary>
    /// 退款请求时间。
    /// </summary>
    public DateTime RequestedAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// 完成时间。
    /// </summary>
    public DateTime? CompletedAt { get; set; }

    /// <summary>
    /// 渠道返回的原始数据 JSON。
    /// </summary>
    public string? Payload { get; set; }
}
