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

export interface RewardClaimedPayload {
  entryId: string;
  userId: string;
  usdtAmount: number;
  hashpowerAmount: number;
}

export class RewardClaimedEvent extends DomainEvent {
  constructor(private readonly payload: RewardClaimedPayload) {
    super();
  }

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

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

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

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