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

export interface RewardExpiredPayload {
  entryId: string;
  userId: string;
  usdtAmount: number;
  hashpowerAmount: number;
  transferredTo: string;  // 转移到的目标账户 (总部社区)
}

export class RewardExpiredEvent extends DomainEvent {
  constructor(private readonly payload: RewardExpiredPayload) {
    super();
  }

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

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

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

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