"""Router assembly for Phase 4 verify routes"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/routes/init.ipynb.

# %% auto #0
__all__ = ['init_verify_routers']

# %% ../../nbs/routes/init.ipynb #verify-routes-init-imports
from typing import List, Dict, Callable, Tuple

from fasthtml.common import APIRouter

from ..models import VerifyUrls
from ..services.verify import VerifyService
from .core import WorkflowStateStore
from .verify import init_verify_router
from .sample import init_sample_router

# %% ../../nbs/routes/init.ipynb #verify-routes-init-assembly
def init_verify_routers(
    state_store:WorkflowStateStore,  # The workflow state store
    workflow_id:str,  # The workflow identifier
    prefix:str,  # Base prefix for verify routes (e.g., "/workflow/verify")
    verify_service:VerifyService,  # Service for graph queries
) -> Tuple[List[APIRouter], VerifyUrls, Dict[str, Callable]]:  # (routers, urls, routes)
    """Initialize and return all verify routers with URL bundle."""
    # Create empty URL bundle (populated after routes are defined)
    urls = VerifyUrls()
    
    # Initialize verify router
    verify_router, verify_routes = init_verify_router(
        state_store, workflow_id, prefix, verify_service, urls
    )
    
    # Initialize sample router
    sample_router, sample_routes = init_sample_router(
        state_store, workflow_id, prefix, verify_service, urls
    )
    
    # Populate the URL bundle using .to() on route functions
    urls.verify = verify_routes["verify"].to()
    urls.sample = sample_routes["sample"].to()
    
    routers = [verify_router, sample_router]
    all_routes = {**verify_routes, **sample_routes}
    
    return routers, urls, all_routes
