Skip to content

Commit

Permalink
refactor: [ACI-502, ACI-503] redesign course grading events payload (#8)
Browse files Browse the repository at this point in the history
* refactor: [ACI-502, ACI-503] redesign course grading events payload

* refactor: include passing status to data class

* refactor: merge passing/failing signals to a single status signal

* refactor: update avro schemas
  • Loading branch information
wowkalucky authored and kyrylo-kh committed Apr 14, 2024
1 parent 5f96415 commit 42fef33
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 284 deletions.
2 changes: 1 addition & 1 deletion openedx_events/event_bus/avro/custom_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CcxCourseLocatorAvroSerializer(BaseCustomTypeAvroSerializer):
def serialize(obj) -> str:
"""Serialize obj into string."""
return str(obj)

@staticmethod
def deserialize(data: str):
"""Deserialize string into obj."""
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"doc": "Avro Event Format for CloudEvents created with openedx_events/schema",
"fields": [
{
"name": "user_course_data",
"name": "course_passing_status",
"type": {
"name": "UserCourseData",
"name": "CcxCoursePassingStatusData",
"type": "record",
"fields": [
{
"name": "status",
"type": "string"
},
{
"name": "user",
"type": {
Expand Down Expand Up @@ -47,20 +51,36 @@
]
}
},
{
"name": "update_timestamp",
"type": "string"
},
{
"name": "grading_policy_hash",
"type": "string"
},
{
"name": "course",
"type": {
"name": "CourseData",
"name": "CcxCourseData",
"type": "record",
"fields": [
{
"name": "course_key",
"name": "ccx_course_key",
"type": "string"
},
{
"name": "master_course_key",
"type": "string"
},
{
"name": "display_name",
"type": "string"
},
{
"name": "coach_email",
"type": "string"
},
{
"name": "start",
"type": [
Expand All @@ -76,6 +96,14 @@
"string"
],
"default": null
},
{
"name": "max_students_allowed",
"type": [
"null",
"long"
],
"default": null
}
]
}
Expand All @@ -84,5 +112,5 @@
}
}
],
"namespace": "org.openedx.learning.course.grade.now.passed.v1"
"namespace": "org.openedx.learning.ccx.course.passing.status.v1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,48 @@
"doc": "Avro Event Format for CloudEvents created with openedx_events/schema",
"fields": [
{
"name": "user_course_data",
"name": "course_passing_status",
"type": {
"name": "UserCourseData",
"name": "CoursePassingStatusData",
"type": "record",
"fields": [
{
"name": "status",
"type": "string"
},
{
"name": "course",
"type": {
"name": "CourseData",
"type": "record",
"fields": [
{
"name": "course_key",
"type": "string"
},
{
"name": "display_name",
"type": "string"
},
{
"name": "start",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "end",
"type": [
"null",
"string"
],
"default": null
}
]
}
},
{
"name": "user",
"type": {
Expand Down Expand Up @@ -48,41 +85,16 @@
}
},
{
"name": "course",
"type": {
"name": "CourseData",
"type": "record",
"fields": [
{
"name": "course_key",
"type": "string"
},
{
"name": "display_name",
"type": "string"
},
{
"name": "start",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "end",
"type": [
"null",
"string"
],
"default": null
}
]
}
"name": "update_timestamp",
"type": "string"
},
{
"name": "grading_policy_hash",
"type": "string"
}
]
}
}
],
"namespace": "org.openedx.learning.course.grade.now.failed.v1"
"namespace": "org.openedx.learning.course.passing.status.v1"
}
Loading

0 comments on commit 42fef33

Please sign in to comment.