feat(regulatory): 接入法规核查触发与工作流骨架

This commit is contained in:
2026-06-07 00:34:12 +08:00
parent 26490f7c46
commit 44d31d2a14
9 changed files with 511 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
from __future__ import annotations
from review_agent.models import RegulatoryReviewBatch, WorkflowEvent
def record_event(
batch: RegulatoryReviewBatch,
event_type: str,
payload: dict | None = None,
) -> WorkflowEvent:
return WorkflowEvent.objects.create(
workflow_type="regulatory_review",
workflow_batch_id=batch.pk,
conversation=batch.conversation,
event_type=event_type,
payload=payload or {},
)
def serialize_event(event: WorkflowEvent) -> dict[str, object]:
return {
"id": event.pk,
"event_type": event.event_type,
"payload": event.payload,
"created_at": event.created_at.isoformat(),
}