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

export interface RewardSettledPayload {
  entryId: string;
  userId: string;
  usdtAmount: number;
  hashpowerAmount: number;
  settleCurrency: string;
  receivedAmount: number;
}

export class RewardSettledEvent extends DomainEvent {
  constructor(private readonly payload: RewardSettledPayload) {
    super();
  }

  get eventType(): string {
    return 'RewardSettled';
  }

  get aggregateId(): string {
    return this.payload.entryId;
  }

  get aggregateType(): string {
    return 'RewardLedgerEntry';
  }

  toPayload(): RewardSettledPayload {
    return { ...this.payload };
  }
}
