feat(governance): link work items to event history
This commit is contained in:
@@ -195,6 +195,7 @@ async def _load_dispatch_ids_for_events(event_ids: list[str]) -> dict[str, list[
|
||||
|
||||
async def query_governance_events(
|
||||
*,
|
||||
event_ids: list[str] | None = None,
|
||||
event_types: list[str] | None = None,
|
||||
from_dt: datetime | None = None,
|
||||
to_dt: datetime | None = None,
|
||||
@@ -212,6 +213,14 @@ async def query_governance_events(
|
||||
async with get_db_context() as db:
|
||||
stmt = select(AiGovernanceEvent)
|
||||
|
||||
normalized_event_ids = [
|
||||
event_id.strip()
|
||||
for event_id in (event_ids or [])
|
||||
if isinstance(event_id, str) and event_id.strip()
|
||||
]
|
||||
if normalized_event_ids:
|
||||
stmt = stmt.where(AiGovernanceEvent.id.in_(normalized_event_ids))
|
||||
|
||||
if event_types:
|
||||
stmt = stmt.where(AiGovernanceEvent.event_type.in_(event_types))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user