namespace CMSMicroservice.Domain.Entities.History;

/// <summary>
/// تاریخچه تغییرات پرداخت کمیسیون (برای Audit)
/// </summary>
public class CommissionPayoutHistory : BaseAuditableEntity
{
    /// <summary>
    /// شناسه پرداخت کمیسیون
    /// </summary>
    public long UserCommissionPayoutId { get; set; }

    /// <summary>
    /// UserCommissionPayout Navigation Property
    /// </summary>
    public virtual UserCommissionPayout? UserCommissionPayout { get; set; }

    /// <summary>
    /// شناسه کاربر
    /// </summary>
    public long UserId { get; set; }


    /// <summary>
    /// شناسه تعریف هفته (کلید خارجی به WeekDefinition)
    /// </summary>
    public long WeekDefinitionId { get; set; }

    /// <summary>
    /// WeekDefinition Navigation Property
    /// </summary>
    public virtual WeekDefinition WeekDefinition { get; set; }

    /// <summary>
    /// مبلغ قبل از تغییر
    /// </summary>
    public long AmountBefore { get; set; }

    /// <summary>
    /// مبلغ بعد از تغییر
    /// </summary>
    public long AmountAfter { get; set; }

    /// <summary>
    /// وضعیت قبل از تغییر
    /// </summary>
    public CommissionPayoutStatus OldStatus { get; set; }

    /// <summary>
    /// وضعیت بعد از تغییر
    /// </summary>
    public CommissionPayoutStatus NewStatus { get; set; }

    /// <summary>
    /// نوع عملیات (Created, Paid, WithdrawRequested, Withdrawn, Cancelled, ManualFix)
    /// </summary>
    public CommissionPayoutAction Action { get; set; }

    /// <summary>
    /// چه کسی انجام داده (UserId یا "System")
    /// </summary>
    public string? PerformedBy { get; set; }

    /// <summary>
    /// دلیل تغییر (اختیاری)
    /// </summary>
    public string? Reason { get; set; }
}
