diff --git a/src/dispatch/signal/flows.py b/src/dispatch/signal/flows.py index 9cc7706b7034..2c4d56c549db 100644 --- a/src/dispatch/signal/flows.py +++ b/src/dispatch/signal/flows.py @@ -3,17 +3,17 @@ from dispatch.case import service as case_service from dispatch.case import flows as case_flows from dispatch.signal import service as signal_service -from dispatch.signal.models import SignalInstanceCreate +from dispatch.signal.models import SignalInstanceCreate, RawSignal -def create_signal_instance(db_session: SessionLocal, signal_instance_data: dict): +def create_signal_instance(db_session: SessionLocal, signal_instance_data: RawSignal): """Creates a signal and a case if necessary.""" signal = signal_service.get_by_variant_or_external_id( db_session=db_session, external_id=signal_instance_data.id, variant=signal_instance_data.variant, ) - signal_instance_in = SignalInstanceCreate(**signal_instance_data, project=signal.project) + signal_instance_in = SignalInstanceCreate(raw=signal_instance_data, project=signal.project) signal_instance = signal_service.create_instance( db_session=db_session, signal_instance_in=signal_instance_in diff --git a/src/dispatch/signal/models.py b/src/dispatch/signal/models.py index 364d65eb3afa..d201b3e0356f 100644 --- a/src/dispatch/signal/models.py +++ b/src/dispatch/signal/models.py @@ -208,7 +208,7 @@ class SignalInstanceBase(DispatchBase): project: ProjectRead case: Optional[CaseRead] tags: Optional[List[TagRead]] = [] - raw: Any + raw: RawSignal suppression_rule: Optional[SuppressionRuleBase] duplication_rule: Optional[DuplicationRuleBase] created_at: Optional[datetime] = None