#!/bin/bash
# Create two user accounts
source "$(dirname "$0")/config.sh"

echo "=== Creating account: $USER1_NAME ==="
RESP1=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/new/client" \
    -d "username=$USER1_NAME" \
    -d "password=$USER1_PASS" \
    -d "color=$USER1_COLOR")
BODY1=$(echo "$RESP1" | head -1)
CODE1=$(echo "$RESP1" | tail -1)
echo "Response: $BODY1 (HTTP $CODE1)"

echo ""
echo "=== Creating account: $USER2_NAME ==="
RESP2=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/new/client" \
    -d "username=$USER2_NAME" \
    -d "password=$USER2_PASS" \
    -d "color=$USER2_COLOR")
BODY2=$(echo "$RESP2" | head -1)
CODE2=$(echo "$RESP2" | tail -1)
echo "Response: $BODY2 (HTTP $CODE2)"
