/**
 * MPC Service Domain Events
 *
 * Domain events represent significant state changes in the domain.
 * They are used for audit logging, event sourcing, and async communication.
 */

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

// Share Events
export { ShareCreatedEvent } from './share-created.event';
export { ShareRotatedEvent } from './share-rotated.event';
export { ShareRevokedEvent } from './share-revoked.event';
export { ShareUsedEvent } from './share-used.event';

// Session Events
export { KeygenStartedEvent } from './keygen-started.event';
export { KeygenCompletedEvent } from './keygen-completed.event';
export { SigningCompletedEvent } from './signing-completed.event';
export { SessionFailedEvent } from './session-failed.event';
export { PartyJoinedSessionEvent } from './party-joined-session.event';
export { SessionTimeoutEvent } from './session-timeout.event';

// Security Events
export { ShareDecryptionAttemptedEvent } from './share-decryption-attempted.event';

// Event Types Union
import { ShareCreatedEvent } from './share-created.event';
import { ShareRotatedEvent } from './share-rotated.event';
import { ShareRevokedEvent } from './share-revoked.event';
import { ShareUsedEvent } from './share-used.event';
import { KeygenStartedEvent } from './keygen-started.event';
import { KeygenCompletedEvent } from './keygen-completed.event';
import { SigningCompletedEvent } from './signing-completed.event';
import { SessionFailedEvent } from './session-failed.event';
import { PartyJoinedSessionEvent } from './party-joined-session.event';
import { SessionTimeoutEvent } from './session-timeout.event';
import { ShareDecryptionAttemptedEvent } from './share-decryption-attempted.event';

export type MPCDomainEvent =
  | ShareCreatedEvent
  | ShareRotatedEvent
  | ShareRevokedEvent
  | ShareUsedEvent
  | KeygenStartedEvent
  | KeygenCompletedEvent
  | SigningCompletedEvent
  | SessionFailedEvent
  | PartyJoinedSessionEvent
  | SessionTimeoutEvent
  | ShareDecryptionAttemptedEvent;

// Event Topic Names (for Kafka)
export const MPC_TOPICS = {
  SHARE_CREATED: 'mpc.ShareCreated',
  SHARE_ROTATED: 'mpc.ShareRotated',
  SHARE_REVOKED: 'mpc.ShareRevoked',
  SHARE_USED: 'mpc.ShareUsed',
  KEYGEN_STARTED: 'mpc.KeygenStarted',
  KEYGEN_COMPLETED: 'mpc.KeygenCompleted',
  SIGNING_COMPLETED: 'mpc.SigningCompleted',
  SESSION_FAILED: 'mpc.SessionFailed',
  PARTY_JOINED_SESSION: 'mpc.PartyJoinedSession',
  SESSION_TIMEOUT: 'mpc.SessionTimeout',
  SHARE_DECRYPTION_ATTEMPTED: 'mpc.ShareDecryptionAttempted',
} as const;
