/**
 * KeygenStarted Event
 *
 * Emitted when a keygen session starts processing.
 * Used to notify identity-service that keygen is in progress.
 */

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

export class KeygenStartedEvent extends DomainEvent {
  constructor(
    public readonly sessionId: string,
    public readonly userId: string,
    public readonly username: string,
    public readonly mpcSessionId: string,
  ) {
    super();
  }

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

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

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

  get payload(): Record<string, unknown> {
    return {
      sessionId: this.sessionId,
      userId: this.userId,
      username: this.username,
      mpcSessionId: this.mpcSessionId,
    };
  }
}
