// Scan login types

export type ScanLoginStatus = 'pending' | 'scanned' | 'confirmed' | 'expired';

export interface ScanTokenData {
  scanToken: string;
  pcSocketId: string;
  status: ScanLoginStatus;
  createdAt: number;
  expiresAt: number;
  userInfo?: {
    userId: string;
    userName: string;
    department: string;
  };
}

export interface GenerateScanTokenResponse {
  success: boolean;
  data?: {
    scanToken: string;
    qrCodeUrl: string;
    expiresAt: number;
  };
  error?: string;
}

export interface ValidateTokenResponse {
  success: boolean;
  data?: {
    valid: boolean;
    status: ScanLoginStatus;
    expiresAt: number;
  };
  error?: string;
}

export interface ScanConfirmPayload {
  scanToken: string;
  userName: string;
  department: string;
}

export interface ScanConfirmResponse {
  success: boolean;
  data?: {
    sessionToken: string;
    userId: string;
  };
  error?: string;
}

export interface ScanStatusUpdatePayload {
  scanToken: string;
  status: ScanLoginStatus;
  userInfo?: {
    userId: string;
    userName: string;
    department: string;
    sessionToken: string;
  };
}

export interface ScanSubscribePayload {
  scanToken: string;
}
