import { DomainEvent } from './domain-event.base';

export interface BalanceDeductedPayload {
  userId: string;
  walletId: string;
  amount: string;
  assetType: string;
  reason: string;
  refOrderId?: string;
  balanceAfter: string;
}

export class BalanceDeductedEvent extends DomainEvent {
  constructor(private readonly payload: BalanceDeductedPayload) {
    super({
      aggregateId: payload.walletId,
      aggregateType: 'WalletAccount',
    });
  }

  getPayload(): BalanceDeductedPayload {
    return this.payload;
  }
}
