From 1925eb10c91ba6b7f5d3113f0ef0b9637528f429 Mon Sep 17 00:00:00 2001 From: AsadAzam Date: Mon, 7 Nov 2022 15:08:08 +0500 Subject: [PATCH] feat: add external id mapping in courseoverview (#31243) --- .../migrations/0027_auto_20221102_1109.py | 23 +++++++++++++++ .../content/course_overviews/models.py | 4 ++- .../0001-add-external-id-mapping.rst | 29 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 openedx/core/djangoapps/content/course_overviews/migrations/0027_auto_20221102_1109.py create mode 100644 openedx/core/djangoapps/content/docs/decisions/0001-add-external-id-mapping.rst diff --git a/openedx/core/djangoapps/content/course_overviews/migrations/0027_auto_20221102_1109.py b/openedx/core/djangoapps/content/course_overviews/migrations/0027_auto_20221102_1109.py new file mode 100644 index 0000000000..3f985efcd3 --- /dev/null +++ b/openedx/core/djangoapps/content/course_overviews/migrations/0027_auto_20221102_1109.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.15 on 2022-11-02 11:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('course_overviews', '0026_courseoverview_entrance_exam'), + ] + + operations = [ + migrations.AddField( + model_name='courseoverview', + name='external_id', + field=models.CharField(blank=True, max_length=128, null=True), + ), + migrations.AddField( + model_name='historicalcourseoverview', + name='external_id', + field=models.CharField(blank=True, max_length=128, null=True), + ), + ] diff --git a/openedx/core/djangoapps/content/course_overviews/models.py b/openedx/core/djangoapps/content/course_overviews/models.py index 0ae4c0701a..a7565c7a4d 100644 --- a/openedx/core/djangoapps/content/course_overviews/models.py +++ b/openedx/core/djangoapps/content/course_overviews/models.py @@ -62,7 +62,7 @@ class CourseOverview(TimeStampedModel): app_label = 'course_overviews' # IMPORTANT: Bump this whenever you modify this model and/or add a migration. - VERSION = 17 + VERSION = 18 # Cache entry versioning. version = models.IntegerField() @@ -142,6 +142,8 @@ class CourseOverview(TimeStampedModel): entrance_exam_id = models.CharField(max_length=255, blank=True) entrance_exam_minimum_score_pct = models.FloatField(default=0.65) + external_id = models.CharField(max_length=128, null=True, blank=True) + language = models.TextField(null=True) history = HistoricalRecords() diff --git a/openedx/core/djangoapps/content/docs/decisions/0001-add-external-id-mapping.rst b/openedx/core/djangoapps/content/docs/decisions/0001-add-external-id-mapping.rst new file mode 100644 index 0000000000..4ad974d14c --- /dev/null +++ b/openedx/core/djangoapps/content/docs/decisions/0001-add-external-id-mapping.rst @@ -0,0 +1,29 @@ +1. Add External ID mapping in course overview +----------------------------------- + +Status +------ + +Accepted + +Context +------- + +The Need for storing an external ID for a course run in edx platform primarily +comes from BootCamps. Bootcamp class objects are created in Salesforce +and have a class ID that is specific to Bootcamps ecosystem. Corresponding +course runs are automatically created in Canvas and store this class ID +in the field called sis_id. +Tools in BootCamps ecosystem leverage this sis_id to exchange information with +Canvas. This ID will potentially be used by multiple Bootcamp tools such as +Attendance, Central grading etc. So it should not be in a configuration +interface specific to any one tool. +This external ID is not limited to Bootcamp and can potentially be used for +integrating other systems into the edx platform. + +Decision +-------- + +Adding this new external id mapping in the CourseOverview modal since that +model contains all the basic information of a course and allows this id to +be used by all areas of the edx-platform