import 'express-session';

declare module 'express-session' {
  interface SessionData {
    userId?: string;
    sessionVersion?: number;
    csrfToken?: string;
    flash?: { kind: 'success' | 'error' | 'info'; message: string };
    temporaryPassword?: { username: string; password: string };
  }
}

declare global {
  namespace Express {
    interface Request {
      currentUser?: {
        id: string;
        name: string;
        username: string;
        warehouseId: string | null;
        forcePasswordChange: boolean;
        sessionVersion: number;
        roles: string[];
        permissions: Set<string>;
      };
    }
  }
}

export {};

