feat: add subscriber platform plugin POC with learner dashboard course categorization API.#125
feat: add subscriber platform plugin POC with learner dashboard course categorization API.#125pavanhalesh wants to merge 1 commit intorelease-ulmofrom
Conversation
| if course_id in SUBSCRIPTION_COURSE_IDS: | ||
| if user_is_subscriber: | ||
| subscription_courses.append(course_id) | ||
| else: | ||
| upgradeable_courses.append(course_id) | ||
| else: | ||
| non_upgradeable_courses.append(course_id) |
There was a problem hiding this comment.
This is the part that we should clarify.
Assume that SUBSCRIPTION_COURSE_IDS will eventually be an API call that we make to the Subscription catalog that another team will create.
From that payload, we'll need to check for each course enrollment:
- Is the course part of the Subscription catalog? If yes:
a. Did the user fulfill either enrolling in the course after becoming a Subscriber or upgrading their audited course into their Subscription? (This is likely to mean that in theEnrollmentspayload we will know if the course is upgraded to a full-access.)- If yes to either, then this course falls under
subscription_courses. - If no to either, then this course falls under
upgradeable_courses
- If yes to either, then this course falls under
- If no, then the course falls under
non_upgradeable_courses.
There's an additional tricky part that I haven't confirmed with Kelly, which is what happens if prior to being a Subscriber the user fully upgraded a course. Where does that course live in these three categories? If the course technically is part of the Subscription catalog, does it go under subscription_courses? If it doesn't, does it go under non_upgradeable_courses even though it indeed is upgraded already? Maybe that 3rd category would be more accurately called non_subscription_courses. I don't know yet.
Overview
This PR introduces a platform plugin that exposes a new LMS API endpoint to retrieve and categorize a learner’s enrolled courses into:
This is a Proof of Concept to validate backend filtering and course categorization logic required for the Subscriber Learner Dashboard.
Implementation Details
Created a new platform plugin under openedx/plugins/subscriber
Registered plugin using entry_points and plugin_app configuration
Implemented API endpoint:
/api/subscriber/dashboard/courses/
Fetches learner enrollments using CourseEnrollment model
Applies subscription catalog and subscriber status logic
Returns categorized course IDs as JSON response
Example Response
{
"subscription_courses": ["course-v1:edX+DemoX+Demo_Course"],
"upgradeable_courses": [],
"non_upgradeable_courses": []
}
@asharma4-sonata and @jsnwesson Please review my PR whenever you get a chance to look on this. Thank You.