import { type DomainEvent } from '@modules/shared';

/**
 * Fired after a user successfully confirms an email change via OTP.
 * Consumed by the audit listener to record sensitive-field changes.
 */
export class EmailChangedEvent implements DomainEvent {
  readonly eventName = 'user.email_changed';
  readonly occurredAt = new Date();

  constructor(
    public readonly aggregateId: string,
    public readonly oldEmail: string | null,
    public readonly newEmail: string,
  ) {}
}
