#!/bin/bash
echo "🧪 Testing POI Optimizations"
echo "============================\n"

API_URL="http://localhost:3000/api/ai/suggest-pois"

echo "Test 1: Geographic Cache (Paris)"
curl -s -X POST $API_URL \
  -H "Content-Type: application/json" \
  -d '{"location":{"lat":48.8566,"lng":2.3522},"categories":["restaurant"],"radiusKm":10}' \
  | jq '.cached, .metadata.processingTimeMs'

echo "\nTest 2: Same area - Cache HIT expected"
curl -s -X POST $API_URL \
  -H "Content-Type: application/json" \
  -d '{"location":{"lat":48.8570,"lng":2.3525},"categories":["restaurant"],"radiusKm":10}' \
  | jq '.cached, .metadata.processingTimeMs'

echo "\nTest 3: Streaming endpoint"
echo "(Use: curl -N http://localhost:3000/api/ai/suggest-pois/stream -X POST -d '{...}')"

echo "\n✅ Basic tests complete"
