Skip to content

Commit 9e3173f

Browse files
feat: add data attributes definition for learning subdomain
1 parent 71e82fc commit 9e3173f

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

openedx_events/learning/signals.py

+110
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,113 @@
77
They also must comply with the payload definition specified in
88
docs/decisions/0003-events-payload.rst
99
"""
10+
11+
from openedx_events.learning.data import CertificateData, CohortData, CourseEnrollmentData, UserData
12+
from openedx_events.tooling import OpenEdxPublicSignal
13+
14+
# .. event_type: org.openedx.learning.student.registration.completed.v1
15+
# .. event_name: STUDENT_REGISTRATION_COMPLETED
16+
# .. event_description: emitted when the user registration process in the LMS is completed.
17+
# .. event_data: UserData
18+
STUDENT_REGISTRATION_COMPLETED = OpenEdxPublicSignal(
19+
event_type="org.openedx.learning.student.registration.completed.v1",
20+
data={
21+
"user": UserData,
22+
}
23+
)
24+
25+
26+
# .. event_type: org.openedx.learning.auth.session.login.completed.v1
27+
# .. event_name: SESSION_LOGIN_COMPLETED
28+
# .. event_description: emitted when the user's login process in the LMS is completed.
29+
# .. event_data: UserData
30+
SESSION_LOGIN_COMPLETED = OpenEdxPublicSignal(
31+
event_type="org.openedx.learning.auth.session.login.completed.v1",
32+
data={
33+
"user": UserData,
34+
}
35+
)
36+
37+
38+
# .. event_type: org.openedx.learning.course.enrollment.created.v1
39+
# .. event_name: COURSE_ENROLLMENT_CREATED
40+
# .. event_description: emitted when the user's enrollment process is completed.
41+
# .. event_data: CourseEnrollmentData
42+
COURSE_ENROLLMENT_CREATED = OpenEdxPublicSignal(
43+
event_type="org.openedx.learning.course.enrollment.created.v1",
44+
data={
45+
"enrollment": CourseEnrollmentData,
46+
}
47+
)
48+
49+
50+
# .. event_type: org.openedx.learning.course.enrollment.changed.v1
51+
# .. event_name: COURSE_ENROLLMENT_CHANGED
52+
# .. event_description: emitted when the user's enrollment update process is completed.
53+
# .. event_data: CourseEnrollmentData
54+
COURSE_ENROLLMENT_CHANGED = OpenEdxPublicSignal(
55+
event_type="org.openedx.learning.course.enrollment.changed.v1",
56+
data={
57+
"enrollment": CourseEnrollmentData,
58+
}
59+
)
60+
61+
62+
# .. event_type: org.openedx.learning.course.unenrollment.completed.v1
63+
# .. event_name: COURSE_ENROLLMENT_CHANGED
64+
# .. event_description: emitted when the user's unenrollment process is completed.
65+
# .. event_data: CourseEnrollmentData
66+
COURSE_UNENROLLMENT_COMPLETED = OpenEdxPublicSignal(
67+
event_type="org.openedx.learning.course.unenrollment.completed.v1",
68+
data={
69+
"enrollment": CourseEnrollmentData,
70+
}
71+
)
72+
73+
74+
# .. event_type: org.openedx.learning.certificate.created.v1
75+
# .. event_name: CERTIFICATE_CREATED
76+
# .. event_description: emitted when the user's certificate creation process is completed.
77+
# .. event_data: CertificateData
78+
CERTIFICATE_CREATED = OpenEdxPublicSignal(
79+
event_type="org.openedx.learning.certificate.created.v1",
80+
data={
81+
"certificate": CertificateData,
82+
}
83+
)
84+
85+
86+
# .. event_type: org.openedx.learning.certificate.created.v1
87+
# .. event_name: CERTIFICATE_CREATED
88+
# .. event_description: emitted when the user's certificate creation process is completed.
89+
# .. event_data: CertificateData
90+
CERTIFICATE_CHANGED = OpenEdxPublicSignal(
91+
event_type="org.openedx.learning.certificate.changed.v1",
92+
data={
93+
"certificate": CertificateData,
94+
}
95+
)
96+
97+
98+
# .. event_type: org.openedx.learning.certificate.revoked.v1
99+
# .. event_name: CERTIFICATE_REVOKED
100+
# .. event_description: emitted when the user's certificate annulation process is completed.
101+
# .. event_data: CertificateData
102+
CERTIFICATE_REVOKED = OpenEdxPublicSignal(
103+
event_type="org.openedx.learning.certificate.revoked.v1",
104+
data={
105+
"certificate": CertificateData,
106+
}
107+
)
108+
109+
110+
# .. event_type: org.openedx.learning.cohort_membership.changed.v1
111+
# .. event_name: COHORT_MEMBERSHIP_CHANGED
112+
# .. event_description: emitted when the user's cohort update is completed.
113+
# .. event_data: CohortData
114+
COHORT_MEMBERSHIP_CHANGED = OpenEdxPublicSignal(
115+
event_type="org.openedx.learning.cohort_membership.changed.v1",
116+
data={
117+
"cohort": CohortData,
118+
}
119+
)

0 commit comments

Comments
 (0)