Files
group_fqcd_jr/app/api/controllers/asset_allocation.py
T

23 lines
826 B
Python
Raw Normal View History

2026-09-11 14:44:29 +08:00
"""Analysis-only dynamic asset allocation endpoint."""
from fastapi import APIRouter, Depends
from app.api.dependencies.auth import build_request_context
from app.api.dependencies.rate_limit import enforce_rate_limit
from app.api.schemas.asset_allocation import AssetAllocationQuery
from app.core.contracts import RequestContext
from app.service.asset_allocation_service import AssetAllocationService
router = APIRouter(
prefix="/api/v1/advisor", tags=["advisor-asset-allocation"],
dependencies=[Depends(enforce_rate_limit)],
)
@router.post("/asset-allocation")
async def generate_asset_allocation(
payload: AssetAllocationQuery,
context: RequestContext = Depends(build_request_context), # noqa: B008
) -> dict[str, object]:
return await AssetAllocationService().generate_for_agent(payload, context)