#!/usr/bin/env bash
set -euo pipefail

BASE="app/src/trading/market_intelligence"
COMMON="$BASE/common"

echo "Creating directories..."

mkdir -p "$COMMON"

echo "Creating __init__.py files..."

cat > "$BASE/__init__.py" <<'EOF'
# app/src/trading/market_intelligence/__init__.py
EOF

cat > "$COMMON/__init__.py" <<'EOF'
# app/src/trading/market_intelligence/common/__init__.py
EOF

echo "Creating common files..."

FILES=(
    constants.py
    enums.py
    events.py
    models.py
    payloads.py
    reasons.py
    scores.py
    snapshots.py
    timeframes.py
    types.py
)

for FILE in "${FILES[@]}"; do
cat > "$COMMON/$FILE" <<EOF
# app/src/trading/market_intelligence/common/$FILE
EOF
done

echo
echo "Done."
echo
echo "Created:"
find "$BASE" -type f | sort
