import type { DevicePurpose } from '@prisma/client';
import type { AccessTokenPayload } from '../lib/jwt';
import type { Permission } from '../lib/permissions';

declare global {
  // eslint-disable-next-line @typescript-eslint/no-namespace
  namespace Express {
    interface Request {
      user?: AccessTokenPayload & { perms: Permission[] };
      /** Active property (from the X-Property-Id header), validated per tenant. */
      propertyId?: string;
      /** Set by deviceAuth for biometric terminal requests (not a user). */
      device?: { id: string; tenantId: string; propertyId: string | null; purpose: DevicePurpose };
    }
  }
}

export {};
