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

export class PhoneNumberBoundEvent extends DomainEvent {
  constructor(
    public readonly userId: string,
    public readonly phoneNumber: string,
  ) {
    super();
  }

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

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

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

  toPayload(): object {
    return {
      userId: this.userId,
      phoneNumber: this.phoneNumber,
    };
  }
}
