#!/bin/bash

services=("tech-stack-selector:8002" "architecture-designer:8003" "code-generator:8004" "test-generator:8005" "deployment-manager:8006")

for service_port in "${services[@]}"; do
    IFS=':' read -r service port <<< "$service_port"
    echo "Creating $service on port $port..."
    
    # Copy from requirement-processor and modify
    cp services/requirement-processor/src/main.py services/$service/src/main.py
    
    # Replace service name in the file
    sed -i.bak "s/requirement-processor/$service/g" services/$service/src/main.py
    sed -i.bak "s/8001/$port/g" services/$service/src/main.py
    
    # Remove backup file
    rm services/$service/src/main.py.bak
    
    echo "✅ $service created"
done

echo "✅ All Python services created!"
