namespace WalletService.Domain.Events;

using MediatR;

/// <summary>
/// EN: Domain event raised when escrow hold is released (funds returned to wallet).
/// VI: Domain event được phát ra khi escrow hold được giải phóng (tiền trả về ví).
/// </summary>
public class EscrowReleasedDomainEvent : INotification
{
    public Guid WalletId { get; }
    public Guid HoldId { get; }
    public Guid UserId { get; }
    public decimal ReleasedAmount { get; }
    public decimal RemainingAmount { get; }
    public DateTime OccurredOn { get; }

    public EscrowReleasedDomainEvent(
        Guid walletId,
        Guid holdId,
        Guid userId,
        decimal releasedAmount,
        decimal remainingAmount)
    {
        WalletId = walletId;
        HoldId = holdId;
        UserId = userId;
        ReleasedAmount = releasedAmount;
        RemainingAmount = remainingAmount;
        OccurredOn = DateTime.UtcNow;
    }
}
