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

namespace TakeoutSaaS.Domain.Payments.Entities;

/// <summary>
/// 支付流水。
/// </summary>
public sealed class PaymentRecord : MultiTenantEntityBase
{
    /// <summary>
    /// 关联订单。
    /// </summary>
    public long OrderId { get; set; }

    /// <summary>
    /// 支付方式。
    /// </summary>
    public PaymentMethod Method { get; set; } = PaymentMethod.Unknown;

    /// <summary>
    /// 支付状态。
    /// </summary>
    public PaymentStatus Status { get; set; } = PaymentStatus.Unpaid;

    /// <summary>
    /// 支付金额。
    /// </summary>
    public decimal Amount { get; set; }

    /// <summary>
    /// 系统交易号。
    /// </summary>
    public string? TradeNo { get; set; }

    /// <summary>
    /// 第三方渠道单号。
    /// </summary>
    public string? ChannelTransactionId { get; set; }

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

    /// <summary>
    /// 错误/备注。
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 原始回调内容。
    /// </summary>
    public string? Payload { get; set; }
}
