Skip to content

Commit

Permalink
feat: [ACI-512] update CCX events payload (#6)
Browse files Browse the repository at this point in the history
* feat: [ACI-512] update CCX events payload

* chore(deps): upgrade dependencies

* feat(deps): add edx-ccx-keys library
  • Loading branch information
wowkalucky authored and kyrylo-kh committed Apr 14, 2024
1 parent 84760dc commit 098ce1d
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 104 deletions.
28 changes: 16 additions & 12 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import List, Optional

import attr
from ccx_keys.locator import CCXLocator
from opaque_keys.edx.keys import CourseKey, UsageKey


Expand Down Expand Up @@ -529,21 +530,24 @@ class BadgeData:


@attr.s(frozen=True)
class CcxCourseData(CourseData):
class CcxCourseData:
"""
Attributes defined fir the Open edX custom course data object.
Represents data for a CCX (Custom Courses for edX) course.
Arguments:
master_course_key (str): identifier of the master Course object.
max_students_allowed (int): maximum number of students allowed on the custom course
coach (UserData): coach associated with the custom course
Attributes:
ccx_course_key (CCXLocator): The unique identifier for the CCX course.
master_course_key (CourseKey): The unique identifier for the original course from which the CCX is derived.
display_name (str): The name of the CCX course as it should appear to users.
coach_email (str): The email address of the coach (instructor) for the CCX course.
start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date.
end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date.
max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit.
"""

ccx_course_key = attr.ib(type=CCXLocator)
master_course_key = attr.ib(type=CourseKey)
max_students_allowed = attr.ib(type=int)
coach = attr.ib(type=UserData)

# copypasted from CourseData to avoid ValueError
display_name = attr.ib(type=str, factory=str)
start = attr.ib(type=datetime, default=None)
end = attr.ib(type=datetime, default=None)
coach_email = attr.ib(type=str, factory=str)
start = attr.ib(type=str, default=None)
end = attr.ib(type=str, default=None)
max_students_allowed = attr.ib(type=int, default=None)
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ django
attrs
fastavro
edx-opaque-keys[django]
edx-ccx-keys
10 changes: 8 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand Down Expand Up @@ -29,8 +29,12 @@ django-waffle==4.1.0
# via edx-django-utils
edx-django-utils==5.12.0
# via -r requirements/base.in
edx-opaque-keys[django]==2.5.1
edx-ccx-keys==1.2.1
# via -r requirements/base.in
edx-opaque-keys[django]==2.5.1
# via
# -r requirements/base.in
# edx-ccx-keys
fastavro==1.9.4
# via -r requirements/base.in
newrelic==9.8.0
Expand All @@ -45,6 +49,8 @@ pymongo==3.13.0
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
six==1.16.0
# via edx-ccx-keys
sqlparse==0.4.4
# via django
stevedore==5.2.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand Down
31 changes: 5 additions & 26 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand Down Expand Up @@ -111,16 +111,16 @@ docutils==0.20.1
# via
# -r requirements/quality.txt
# readme-renderer
edx-ccx-keys==1.2.1
# via -r requirements/quality.txt
edx-django-utils==5.12.0
# via -r requirements/quality.txt
edx-lint==5.3.6
# via -r requirements/quality.txt
edx-opaque-keys[django]==2.5.1
# via -r requirements/quality.txt
exceptiongroup==1.2.0
# via
# -r requirements/quality.txt
# pytest
# edx-ccx-keys
fastavro==1.9.4
# via -r requirements/quality.txt
filelock==3.13.4
Expand All @@ -135,10 +135,7 @@ idna==3.6
importlib-metadata==6.11.0
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# build
# keyring
# twine
importlib-resources==6.4.0
# via
Expand Down Expand Up @@ -344,6 +341,7 @@ secretstorage==3.3.3
six==1.16.0
# via
# -r requirements/quality.txt
# edx-ccx-keys
# edx-lint
snowballstemmer==2.2.0
# via
Expand All @@ -363,19 +361,6 @@ text-unidecode==1.3
# via
# -r requirements/quality.txt
# python-slugify
tomli==2.0.1
# via
# -r requirements/ci.txt
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# build
# coverage
# pip-tools
# pylint
# pyproject-api
# pyproject-hooks
# pytest
# tox
tomlkit==0.12.4
# via
# -r requirements/quality.txt
Expand All @@ -387,11 +372,7 @@ twine==5.0.0
typing-extensions==4.11.0
# via
# -r requirements/quality.txt
# asgiref
# astroid
# edx-opaque-keys
# pylint
# rich
urllib3==2.2.1
# via
# -r requirements/quality.txt
Expand All @@ -411,10 +392,8 @@ wrapt==1.16.0
# astroid
zipp==3.18.1
# via
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
50 changes: 19 additions & 31 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
#
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
alabaster==0.7.16
# via sphinx
asgiref==3.8.1
# via
Expand Down Expand Up @@ -72,21 +72,21 @@ django-waffle==4.1.0
# edx-django-utils
doc8==1.1.1
# via -r requirements/doc.in
docutils==0.19
docutils==0.20.1
# via
# doc8
# pydata-sphinx-theme
# readme-renderer
# restructuredtext-lint
# sphinx
edx-ccx-keys==1.2.1
# via -r requirements/test.txt
edx-django-utils==5.12.0
# via -r requirements/test.txt
edx-opaque-keys[django]==2.5.1
# via -r requirements/test.txt
exceptiongroup==1.2.0
# via
# -r requirements/test.txt
# pytest
# edx-ccx-keys
fastavro==1.9.4
# via -r requirements/test.txt
idna==3.6
Expand All @@ -96,9 +96,6 @@ imagesize==1.4.1
importlib-metadata==6.11.0
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# build
# keyring
# sphinx
# twine
importlib-resources==6.4.0
# via keyring
Expand Down Expand Up @@ -168,7 +165,7 @@ pycparser==2.22
# via
# -r requirements/test.txt
# cffi
pydata-sphinx-theme==0.14.4
pydata-sphinx-theme==0.15.2
# via sphinx-book-theme
pygments==2.17.2
# via
Expand Down Expand Up @@ -201,8 +198,6 @@ python-slugify==8.0.4
# via
# -r requirements/test.txt
# code-annotations
pytz==2024.1
# via babel
pyyaml==6.0.1
# via
# -r requirements/test.txt
Expand All @@ -225,40 +220,43 @@ rich==13.7.1
secretstorage==3.3.3
# via keyring
six==1.16.0
# via livereload
# via
# -r requirements/test.txt
# edx-ccx-keys
# livereload
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
# via beautifulsoup4
sphinx==6.2.1
sphinx==7.2.6
# via
# -r requirements/doc.in
# pydata-sphinx-theme
# sphinx-autobuild
# sphinx-book-theme
# sphinx-copybutton
# sphinxcontrib-contentui
sphinx-autobuild==2021.3.14
sphinx-autobuild==2024.2.4
# via -r requirements/doc.in
sphinx-book-theme==1.0.1
sphinx-book-theme==1.1.2
# via -r requirements/doc.in
sphinx-copybutton==0.5.2
# via -r requirements/doc.in
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-contentui==0.2.5
# via -r requirements/doc.in
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-mermaid==0.9.2
# via -r requirements/doc.in
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
sqlparse==0.4.4
# via
Expand All @@ -275,25 +273,15 @@ text-unidecode==1.3
# via
# -r requirements/test.txt
# python-slugify
tomli==2.0.1
# via
# -r requirements/test.txt
# build
# coverage
# doc8
# pyproject-hooks
# pytest
tornado==6.4
# via livereload
twine==5.0.0
# via -r requirements/doc.in
typing-extensions==4.11.0
# via
# -r requirements/test.txt
# asgiref
# edx-opaque-keys
# pydata-sphinx-theme
# rich
urllib3==2.2.1
# via
# requests
Expand Down
11 changes: 1 addition & 10 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand All @@ -8,10 +8,6 @@ build==1.2.1
# via pip-tools
click==8.1.7
# via pip-tools
importlib-metadata==6.11.0
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# build
packaging==24.0
# via build
pip-tools==7.4.1
Expand All @@ -20,11 +16,6 @@ pyproject-hooks==1.0.0
# via
# build
# pip-tools
tomli==2.0.1
# via
# build
# pip-tools
# pyproject-hooks
wheel==0.43.0
# via pip-tools
zipp==3.18.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand Down
Loading

0 comments on commit 098ce1d

Please sign in to comment.