"""Templates for the `strura gen:context` command."""


def context_readme(context_name: str, pascal_name: str) -> str:
    """Generate README.md content for a bounded context."""
    return f"""\
# Context: {pascal_name}

## Description

> TODO: Describe the purpose and responsibility of this bounded context.

## Bounded Context Boundaries

- **Owns**: (list the entities/aggregates this context manages)
- **Depends on**: (list other contexts this one communicates with)

## Directory Structure

- `application/` — Use cases and service orchestration.
- `domain/` — Business rules, schemas (DTOs), and enumerations.
- `infrastructure/` — Database models, repositories, and external integrations.
"""


def schema_py(context_name: str) -> str:
    """Generate schema.py with TableName StrEnum."""
    return f'''\
"""Table name constants for the {context_name} context."""

from enum import StrEnum


class TableName(StrEnum):
    """Centralized table name registry.

    Usage:
        __tablename__ = TableName.EXAMPLE
    """

    pass
'''


def init_tables_py(context_name: str) -> str:
    """Generate init_tables.py for model registration."""
    return f'''\
"""Import all models here so they are registered with SQLAlchemy Base metadata.

This file must be imported at application startup (e.g., in main.py lifespan)
to ensure all tables are created/discovered by Alembic or create_all().

Context: {context_name}
"""
'''


def erd_md(pascal_name: str) -> str:
    """Generate ERD.md with empty mermaid diagram."""
    return f"""\
# ERD: {pascal_name}

```mermaid
erDiagram
    %% Add your entities here
```
"""
