namespace WalletService.Domain.Events;

using MediatR;

/// <summary>
/// EN: Domain event raised when escrow hold is executed (funds committed).
/// VI: Domain event được phát ra khi escrow hold được thực thi (tiền đã cam kết).
/// </summary>
public class EscrowExecutedDomainEvent : INotification
{
    public Guid WalletId { get; }
    public Guid HoldId { get; }
    public Guid UserId { get; }
    public decimal ExecutedAmount { get; }
    public decimal RemainingAmount { get; }
    public string? ExecutionRef { get; }
    public DateTime OccurredOn { get; }

    public EscrowExecutedDomainEvent(
        Guid walletId,
        Guid holdId,
        Guid userId,
        decimal executedAmount,
        decimal remainingAmount,
        string? executionRef = null)
    {
        WalletId = walletId;
        HoldId = holdId;
        UserId = userId;
        ExecutedAmount = executedAmount;
        RemainingAmount = remainingAmount;
        ExecutionRef = executionRef;
        OccurredOn = DateTime.UtcNow;
    }
}
