import { Document, Types } from 'mongoose';

export interface CreateScanRequest {
  qrcode_id?: string;
  coordinate_id: string;
  scanned_by?: string;
  scan_location: {
    latitude: number;
    longitude: number;
    country?: string;
    city?: string;
    address?: string;
  };
  notes?: string;
  is_anonymous?: boolean;
  userId?: string;
  password?: string;
  device_info?: string;
  device_type?: 'mobile' | 'tablet' | 'desktop' | 'unknown';
}

export interface ScanResponse {
  _id: string;
  qrcode_id: string;
  coordinate_id: string;
  scanned_by?: string;
  scan_location: {
    latitude: number;
    longitude: number;
    country?: string;
    city?: string;
    address?: string;
  };
  notes?: string;
  is_anonymous: boolean;
  device_info?: string;
  device_type?: 'mobile' | 'tablet' | 'desktop' | 'unknown';
  created_at: Date;
  updated_at: Date;
  type?: string;
}

export interface ScanListResponse {
  scans: ScanResponse[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

export interface ScanDocument extends Document {
  _id: Types.ObjectId;
  qrcode_id: Types.ObjectId;
  coordinate_id?: Types.ObjectId;
  scanned_by?: Types.ObjectId;
  scan_location: {
    latitude: number;
    longitude: number;
    country?: string;
    city?: string;
    address?: string;
  };
  notes?: string;
  is_anonymous: boolean;
  device_info?: string;
  device_type?: 'mobile' | 'tablet' | 'desktop' | 'unknown';
  created_at: Date;
  updated_at: Date;
}

export interface CreateScanData {
  qrcode_id: Types.ObjectId;
  coordinate_id?: Types.ObjectId;
  scanned_by?: Types.ObjectId;
  scan_location: {
    latitude: number;
    longitude: number;
    country?: string;
    city?: string;
    address?: string;
  };
  notes?: string;
  is_anonymous: boolean;
  device_info?: string;
  device_type?: 'mobile' | 'tablet' | 'desktop' | 'unknown';
}
