import { JwtPayload } from 'jsonwebtoken';
import { UserRole } from './user.types';

declare global {
  namespace Express {
    interface Request {
      user?: {
        userId: string;
        email: string;
        employeeId?: string | null;
        role?: UserRole;
      };
      cookies?: {
        accessToken?: string;
        refreshToken?: string;
        [key: string]: string | undefined;
      };
      file?: Express.Multer.File;
      files?: Express.Multer.File[];
    }
  }
}

export interface AuthenticatedRequest extends Express.Request {
  user: {
    userId: string;
    email: string;
    employeeId?: string | null; // Optional - schema not finalized
    role: UserRole;
  };
  params: any;
  body: any;
  query: any;
  cookies?: {
    accessToken?: string;
    refreshToken?: string;
    [key: string]: string | undefined;
  };
}

// Export AuthenticatedRequest through a regular TypeScript file pattern
export type { AuthenticatedRequest };