From bb7d207b4c4decca2ed8722cc94ba3456717a024 Mon Sep 17 00:00:00 2001 From: mariagrimaldi Date: Mon, 7 Jun 2021 18:05:11 -0400 Subject: [PATCH] feat: add Open edX signal definitions V1 --- openedx_events/learning/signals.py | 74 ++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index e842c1d2..de9ff80c 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -7,3 +7,77 @@ They also must comply with the payload definition specified in docs/decisions/0003-events-payload.rst """ + +from openedx_events.learning.data import ( + CertificateData, + CohortData, + CourseEnrollmentData, + RegistrationData, + StudentData, +) +from openedx_events.tooling import OpenEdxPublicSignal + +STUDENT_REGISTRATION_COMPLETED = OpenEdxPublicSignal( + event_type="org.openedx.learning.student.registration.completed.v1", + data={ + "user": StudentData, + "registration": RegistrationData, + } +) + + +SESSION_LOGIN_COMPLETED = OpenEdxPublicSignal( + event_type="org.openedx.learning.student.registration.completed.v1", + data={ + "user": StudentData, + "registration": RegistrationData, + } +) + + +COURSE_ENROLLMENT_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.enrollment.created.v1", + data={ + "enrollment": CourseEnrollmentData, + } +) + + +COURSE_ENROLLMENT_CHANGED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.enrollment.changed.v1", + data={ + "enrollment": CourseEnrollmentData, + } +) + + +COURSE_ENROLLMENT_DEACTIVATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.enrollment.deactivated.v1", + data={ + "enrollment": CourseEnrollmentData, + } +) + + +CERTIFICATE_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.certificate.created.v1", + data={ + "certificate": CertificateData, + } +) + + +CERTIFICATE_CHANGED = OpenEdxPublicSignal( + event_type="org.openedx.learning.certificate.changed.v1", + data={ + "certificate": CertificateData, + } +) + + +COHORT_MEMBERSHIP_CHANGED = OpenEdxPublicSignal( + event_type="org.openedx.learning.cohort_membership.changed.v1", + data={ + "cohort": CohortData, + } +)