import mongoose from 'mongoose';
// ============ MEDIA MODEL SCHEMA ============

export interface MediaModelProps {
  originalName?: string;
  filePath?: string;
  hostUrl?: string;
  mimeType?: string;
  size?: string;
}

// ============ USER MODEL SCHEMA ============

export interface UserModelProps {
  first_name: string;
  last_name: string;
  email: string;
  password: string;
  phone_number: string;
  country: string;
  State: string;
  City: string;
  role?: 'USER' | 'ADMIN' | 'SCANNER';
  profile_picture?: string;
  media_id?: string;
}

// ============ OTP VERIFICATION SCHEMA ============

export interface VerifyOtpRequest {
  email: string;
  otp: string;
  type?: 'signup' | 'forgot-password';
}

// ============ FORGOT PASSWORD SCHEMA ============

export interface ForgotPasswordRequest {
  email: string;
}

// ============ CREATE PROFILE SCHEMA ============

export interface CreateProfileRequest {
  first_name: string;
  last_name: string;
  email: string;
  phone_number?: string;
  country?: string;
  State?: string;
  City?: string;
  role?: 'USER' | 'ADMIN' | 'SCANNER';
  profile?: string;
  deviceToken?: string;
  deviceType?: 'ios' | 'android' | 'web';
  user_agent?: string;
}

// ============ MEDIA UTILS INTERFACES ============

export interface MediaResult {
  mediaId: any;
  filePath: string;
  mediaRecord: any;
}

export interface FileData {
  originalname: string;
  mimetype: string;
  size: number;
}

export interface UserDataWithMedia {
  profile_picture?: string;
  media_id?: string;
  [key: string]: any;
}

interface AuthenticatedRequest extends Request {
  user?: {
    userId?: string;
    email?: string;
    role?: string;
  };
}

// ============ MEMORY TAG TYPES ============

export * from './memoryTag.types';

declare global {
  namespace Express {
    interface User {
      userId: string;
      email: string;
      role: string;
      isPasswordReset?: boolean;
      [key: string]: any;
    }
    export interface Request {
      user?: User;
    }
  }
}


// src/html.d.ts
declare module '*.html' {
  const content: string;
  export default content;
}


export * from './guestUser.types';
export * from './subscription.types';
export { };



export interface CreateContactData {
  name: string;
  email: string;
  message: string;
  phone?: string;
  subject: string;
  contact_priority?: string
}

// ============ LOCATION MODEL SCHEMA ============


export interface ILocation extends mongoose.Document {
  latitude: number;
  longitude: number;
  City?: string;
  address?: string;
  country?: string;
  state?: string;
  postalCode?: string;
  street?: string;
}

export interface ILocationModel extends mongoose.Model<ILocation> {
  createWithGeocode(latitude: number, longitude: number): Promise<ILocation>;
  reverseGeocode(
    latitude: number,
    longitude: number
  ): Promise<{
    city: string | null;
    address: string | null;
    country: string | null;
    state: string | null;
    postalCode: string | null;
    street: string | null;
  }>;
}
