#!/bin/bash
# Test script for inventory processing with live output
# Usage: ./test_inventory_live.sh

echo "╔═══════════════════════════════════════════════════════╗"
echo "║   Inventory Processing Test - Live Output Mode       ║"
echo "╚═══════════════════════════════════════════════════════╝"
echo ""

# Configuration
API_URL="${1:-http://localhost/api/inventory/processTransactions}"

echo "📡 Calling API: $API_URL"
echo "⏰ Started at: $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

# Make the request and show output in real-time
curl -X POST "$API_URL" \
  -H "Content-Type: application/json" \
  -d '{}' \
  --no-buffer \
  2>/dev/null

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "⏰ Finished at: $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
