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

namespace TakeoutSaaS.Domain.Membership.Entities;

/// <summary>
/// 会员积分商城兑换记录。
/// </summary>
public sealed class MemberPointMallRecord : MultiTenantEntityBase
{
    /// <summary>
    /// 门店标识。
    /// </summary>
    public long StoreId { get; set; }

    /// <summary>
    /// 兑换记录单号。
    /// </summary>
    public string RecordNo { get; set; } = string.Empty;

    /// <summary>
    /// 关联积分商品 ID。
    /// </summary>
    public long PointMallProductId { get; set; }

    /// <summary>
    /// 会员标识。
    /// </summary>
    public long MemberId { get; set; }

    /// <summary>
    /// 会员名称快照。
    /// </summary>
    public string MemberName { get; set; } = string.Empty;

    /// <summary>
    /// 会员手机号快照（脱敏）。
    /// </summary>
    public string MemberMobileMasked { get; set; } = string.Empty;

    /// <summary>
    /// 商品名称快照。
    /// </summary>
    public string ProductName { get; set; } = string.Empty;

    /// <summary>
    /// 兑换类型快照。
    /// </summary>
    public MemberPointMallRedeemType RedeemType { get; set; } = MemberPointMallRedeemType.Product;

    /// <summary>
    /// 兑换方式快照。
    /// </summary>
    public MemberPointMallExchangeType ExchangeType { get; set; } = MemberPointMallExchangeType.PointsOnly;

    /// <summary>
    /// 消耗积分。
    /// </summary>
    public int UsedPoints { get; set; }

    /// <summary>
    /// 现金部分。
    /// </summary>
    public decimal CashAmount { get; set; }

    /// <summary>
    /// 记录状态。
    /// </summary>
    public MemberPointMallRecordStatus Status { get; set; } = MemberPointMallRecordStatus.Issued;

    /// <summary>
    /// 兑换时间（UTC）。
    /// </summary>
    public DateTime RedeemedAt { get; set; }

    /// <summary>
    /// 发放时间（UTC）。
    /// </summary>
    public DateTime? IssuedAt { get; set; }

    /// <summary>
    /// 核销时间（UTC）。
    /// </summary>
    public DateTime? VerifiedAt { get; set; }

    /// <summary>
    /// 核销方式。
    /// </summary>
    public MemberPointMallVerifyMethod? VerifyMethod { get; set; }

    /// <summary>
    /// 核销备注。
    /// </summary>
    public string? VerifyRemark { get; set; }

    /// <summary>
    /// 核销人用户标识。
    /// </summary>
    public long? VerifiedBy { get; set; }
}
