rebuild(audit): complete entity detail and market preview
This commit is contained in:
@@ -7,6 +7,7 @@ from fastapi import APIRouter, Path, Query, Request
|
||||
from backend.features.accounts.auth import AdminWritePrincipal, AuthenticatedPrincipal
|
||||
from backend.features.market.schemas import (
|
||||
ChartResponse,
|
||||
EntityDetailResponse,
|
||||
MarketInsightResponse,
|
||||
MarketSummaryResponse,
|
||||
MarketWorkspaceResponse,
|
||||
@@ -61,6 +62,19 @@ def chart(
|
||||
return request.app.state.container.market.chart(entity_type, identifier, interval)
|
||||
|
||||
|
||||
@router.get("/entities/{entity_type}/{identifier}/detail", response_model=EntityDetailResponse)
|
||||
def entity_detail(
|
||||
request: Request,
|
||||
_principal: AuthenticatedPrincipal,
|
||||
entity_type: Annotated[Literal["stock", "sector", "theme", "index"], Path()],
|
||||
identifier: Annotated[str, Path(min_length=1, max_length=40)],
|
||||
requested_date: Annotated[str | None, Query(alias="date")] = None,
|
||||
) -> dict:
|
||||
return request.app.state.container.market.entity_detail(
|
||||
entity_type, identifier, requested_date
|
||||
)
|
||||
|
||||
|
||||
@router.post("/reference-sync", response_model=ReferenceSyncResponse)
|
||||
def refresh_reference(request: Request, _principal: AdminWritePrincipal) -> dict[str, int | str]:
|
||||
return request.app.state.container.market.refresh_reference()
|
||||
|
||||
Reference in New Issue
Block a user