Files
DEMO-AGENT/review_agent/regulatory_info_package/events.py

16 lines
525 B
Python

from __future__ import annotations
from review_agent.regulatory_info_package.constants import WORKFLOW_TYPE
from review_agent.models import RegulatoryInfoPackageBatch, WorkflowEvent
def record_event(batch: RegulatoryInfoPackageBatch, event_type: str, payload: dict | None = None) -> WorkflowEvent:
return WorkflowEvent.objects.create(
workflow_type=WORKFLOW_TYPE,
workflow_batch_id=batch.pk,
conversation=batch.conversation,
event_type=event_type,
payload=payload or {},
)