#!/usr/bin/env python
"""Debug script to check project IDs"""

import sys
from pathlib import Path

# Add src directory to path
current_dir = Path(__file__).parent
src_dir = current_dir / "src"
sys.path.insert(0, str(src_dir))

from models.config_model import Config
from models.project_model import ProjectManager
from services.project_discovery_service import ProjectDiscoveryService

# Initialize services
config = Config()
config.load_config()
project_manager = ProjectManager()
project_discovery_service = ProjectDiscoveryService(config, project_manager)

# Discover projects
projects = project_discovery_service.discover_all_projects()

print("Available project IDs:")
found = False
for project_id, project in project_manager.projects.items():
    if "Ssae0452 Last Version Walter" in project.name:
        print(f"Found project:")
        print(f"  ID: {project_id}")
        print(f"  Name: {project.name}")
        print(f"  Path: {project.path}")
        found = True
        break

if not found:
    print('Project "Ssae0452 Last Version Walter" not found!')
    print('Available projects containing "Ssae":')
    count = 0
    for project_id, project in project_manager.projects.items():
        if "Ssae" in project.name:
            print(f"  ID: {project_id}, Name: {project.name}")
            count += 1
            if count >= 10:  # Limit output
                break
