// Core TypeScript types for Admin Console

export interface User {
  id: string;
  employeeId: string;
  name: string;
  email: string;
  role: string;
  sovereignBankId?: string;
  permissions: string[];
}

export interface AuthState {
  user: User | null;
  token: string | null;
  isAuthenticated: boolean;
  isLoading: boolean;
}

export interface LoginCredentials {
  username: string;
  password: string;
  rememberMe?: boolean;
}

export interface ApiError {
  code: string;
  message: string;
  timestamp?: string;
}

export interface PaginatedResponse<T> {
  data: T[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
}

export interface NetworkHealthStatus {
  subsystem: string;
  status: 'healthy' | 'degraded' | 'down';
  lastHeartbeat?: string;
  latency?: number;
  errorRate?: number;
}

export interface SettlementThroughput {
  txPerSecond: number;
  dailyVolume: number;
  byAssetType: {
    fiat: number;
    cbdc: number;
    gru: number;
    ssu: number;
    commodities: number;
  };
  heatmap: Array<{
    sourceSCB: string;
    destinationSCB: string;
    volume: number;
  }>;
}

export interface GRULiquidityMetrics {
  currentPrice: number;
  volatility: number;
  inCirculation: {
    m00: number;
    m0: number;
    m1: number;
    sr1: number;
    sr2: number;
    sr3: number;
  };
}

export interface RiskFlags {
  high: number;
  medium: number;
  low: number;
  alerts: Array<{
    id: string;
    type: string;
    severity: string;
    description: string;
    timestamp: string;
  }>;
}

export interface SCBStatus {
  scbId: string;
  name: string;
  country: string;
  bic?: string;
  status: string;
  connectivity: 'connected' | 'degraded' | 'disconnected';
  latency?: number;
  errorRate?: number;
  openIncidents: number;
}

export interface ParticipantInfo {
  scbId: string;
  name: string;
  country: string;
  bic?: string;
  lei?: string;
  status: string;
  connectivity: 'connected' | 'degraded' | 'disconnected';
  lastHeartbeat?: string;
  latency?: number;
  errorRate?: number;
}

