# ADR: API Endpoint for User Exam Due Dates in the Mobile App

**URL:** https://discuss.openedx.org/t/adr-api-endpoint-for-user-exam-due-dates-in-the-mobile-app/16059
**Category:** Architecture
**Created:** [May 26, 2025, 3:29am UTC](https://discuss.openedx.org/t/adr-api-endpoint-for-user-exam-due-dates-in-the-mobile-app/16059 "2025-05-26T03:29:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SergiiKalinchuk](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sergiikalinchuk/32/8356_2.png) [@SergiiKalinchuk](https://discuss.openedx.org/u/SergiiKalinchuk)
#### Post date: [May 26, 2025, 3:29am UTC](https://discuss.openedx.org/t/adr-api-endpoint-for-user-exam-due-dates-in-the-mobile-app/16059/1 "2025-05-26T03:29:03Z")

</div>

## Context

To improve the Open edX mobile experience, we need to provide learners with a fast, accurate list of upcoming **exam and assignment due dates** across all of their enrolled courses. This is critical for enabling mobile-first learning workflows, proactive planning, and push notifications.

The current approach, which relies on `get_course_date_blocks()` and modulestore traversal, is inefficient, especially for multi-course scenarios. The Open edX community has committed to limiting modulestore usage in runtime systems ([ADR 0011](https://github.com/openedx/edx-platform/blob/master/docs/decisions/0011-limit-modulestore-use-in-lms.rst)) and modularizing content and date management.

* * *

## Decision Summary

We suggest reusing and extending the **`edx-when`** application as the unified backend for both course-level and user-level due dates:

- Use `CourseDate` to store **published due dates** from course metadata
- Use `UserDate` to store **user-specific overrides** , including:
  - Personalized schedules (self-paced)
  - Instructor-granted extensions

- Create a **new API endpoint** to return a merged and filtered list of upcoming due dates for the authenticated user

* * *

## Architecture Overview

### ✅ What We Reuse

| Component | Role |
| --- | --- |
| `edx-when.CourseDate` | Stores canonical due dates published for each course |
| `edx-when.UserDate` | Stores per-user overrides (e.g., extensions, personalized pacing) |
| `Schedules` | Provides `start_date` for self-paced learners (used in overrides) |

### 🆕 What We Add

| Component | Purpose |
| --- | --- |
| New API | Returns all due dates visible to the user across their courses |
| Runtime logic | Merges `CourseDate` and `UserDate`, applies filtering/visibility |

## Benefits

- ✅ **Performance** : Indexed queries instead of runtime block traversal
- ✅ **Consistency** : All dates managed in one canonical system
- ✅ **Maintainability** : No need to create redundant data models
- ✅ **Scalability** : Reusable for LMS, mobile, and analytics
- ✅ **Forward-compatible** : Aligned with plans to remove MongoDB and improve RBAC

## Scope Limitations

❌ **CCX courses (Custom Courses for EdX)** are excluded from this implementation due to their unique override structure and management.
