"""Modulo para geracao de arquivos de dependencias."""

from pathlib import Path


REQUIREMENTS_TEMPLATES = {
    # MVC
    'web-flask': """flask>=3.0.0
python-dotenv>=1.0.0
pytest>=8.0.0
""",
    'web-fastapi': """fastapi>=0.109.0
uvicorn[standard]>=0.27.0
jinja2>=3.1.0
python-multipart>=0.0.6
python-dotenv>=1.0.0
pytest>=8.0.0
""",
    # API REST
    'api-flask': """flask>=3.0.0
python-dotenv>=1.0.0
pytest>=8.0.0
""",
    'api-fastapi': """fastapi>=0.109.0
uvicorn[standard]>=0.27.0
pydantic>=2.0.0
python-dotenv>=1.0.0
pytest>=8.0.0
""",
    # CLI
    'cli': """click>=8.0.0
pytest>=8.0.0
""",
    # Clean Architecture
    'clean-flask': """flask>=3.0.0
python-dotenv>=1.0.0
pytest>=8.0.0
""",
    'clean-fastapi': """fastapi>=0.109.0
uvicorn[standard]>=0.27.0
pydantic>=2.0.0
python-dotenv>=1.0.0
pytest>=8.0.0
""",
}

DEFAULT_REQUIREMENTS = """python-dotenv>=1.0.0
pytest>=8.0.0
"""


def create_default_requirements(project_path, project_type):
    """Cria um requirements.txt padrao baseado no tipo de projeto."""
    content = REQUIREMENTS_TEMPLATES.get(project_type, DEFAULT_REQUIREMENTS)
    requirements_file = Path(project_path) / 'requirements.txt'
    requirements_file.write_text(content, encoding='utf-8')
