import { BiometricType, DevicePlatform, ActivityStatus, ActivityType } from '../entities';

// ============================================
// QUERY INTERFACES (Solo lectura)
// ============================================

export interface GetDeviceQueryDto {
  tenantId?: string;
}

export interface GetDevicesQueryDto {
  platform?: DevicePlatform;
  isActive?: string;
  biometricEnabled?: string;
  page?: number;
  limit?: number;
}

export interface GetCredentialsQueryDto {
  biometricType?: BiometricType;
  isActive?: string;
  page?: number;
  limit?: number;
}

export interface GetActivityLogQueryDto {
  activityType?: ActivityType;
  activityStatus?: ActivityStatus;
  startDate?: string;
  endDate?: string;
  page?: number;
  limit?: number;
}

export interface GetSessionsQueryDto {
  isActive?: string;
  page?: number;
  limit?: number;
}

// ============================================
// RESPONSE INTERFACES
// ============================================

export interface DeviceResponseDto {
  id: string;
  userId: string;
  tenantId: string;
  deviceUuid: string;
  deviceName: string;
  deviceModel: string;
  deviceBrand: string;
  platform: DevicePlatform;
  platformVersion: string;
  appVersion: string;
  isActive: boolean;
  isTrusted: boolean;
  trustLevel: number;
  biometricEnabled: boolean;
  biometricType: BiometricType;
  lastSeenAt: Date;
  createdAt: Date;
}

export interface BiometricCredentialResponseDto {
  id: string;
  deviceId: string;
  userId: string;
  biometricType: BiometricType;
  credentialName: string;
  isPrimary: boolean;
  isActive: boolean;
  lastUsedAt: Date;
  useCount: number;
  createdAt: Date;
}

export interface DeviceSessionResponseDto {
  id: string;
  deviceId: string;
  userId: string;
  tenantId: string;
  authMethod: string;
  issuedAt: Date;
  expiresAt: Date;
  isActive: boolean;
  ipAddress: string;
  createdAt: Date;
}

export interface DeviceActivityLogResponseDto {
  id: string;
  deviceId: string;
  userId: string;
  activityType: ActivityType;
  activityStatus: ActivityStatus;
  details: Record<string, unknown>;
  ipAddress: string;
  latitude: number;
  longitude: number;
  createdAt: Date;
}

export interface EnrollmentStatusResponseDto {
  userId: string;
  hasEnrollment: boolean;
  totalCredentials: number;
  activeCredentials: number;
  primaryCredential: BiometricCredentialResponseDto | null;
  biometricTypes: BiometricType[];
  devices: {
    deviceId: string;
    deviceName: string;
    credentialsCount: number;
  }[];
}
