export interface UserRegisteredEvent {
  userId: string;
  phone: string | null;
  email: string | null;
  role: string;
  referralCode: string | null; // 注册时填写的推荐码（推荐人的码）
  timestamp: string;
}

export interface UserLoggedInEvent {
  userId: string;
  ipAddress: string | null;
  deviceInfo: string | null;
  timestamp: string;
}

export interface UserLoggedOutEvent {
  userId: string;
  timestamp: string;
}

export interface TokenRefreshedEvent {
  userId: string;
  oldTokenId: string;
  newTokenId: string;
  timestamp: string;
}

export interface PasswordChangedEvent {
  userId: string;
  timestamp: string;
}

/* ── SMS & Account Lock Events ── */

export interface SmsCodeSentEvent {
  phone: string;
  type: string; // SmsVerificationType
  timestamp: string;
}

export interface SmsCodeVerifiedEvent {
  phone: string;
  type: string;
  timestamp: string;
}

export interface AccountLockedEvent {
  userId: string;
  lockedUntil: string;
  failCount: number;
  timestamp: string;
}

export interface PhoneChangedEvent {
  userId: string;
  oldPhone: string;
  newPhone: string;
  timestamp: string;
}

export interface PasswordResetEvent {
  userId: string;
  phone: string;
  timestamp: string;
}
