feat(api): Staff Grant Extension - Upstream Rebase#565
Open
SteveDala wants to merge 27 commits intodoubtfire-lms:10.0.xfrom
Open
feat(api): Staff Grant Extension - Upstream Rebase#565SteveDala wants to merge 27 commits intodoubtfire-lms:10.0.xfrom
SteveDala wants to merge 27 commits intodoubtfire-lms:10.0.xfrom
Conversation
The document still said "documentaion". Nuts. I have also added the doc version number. I defaulted to the version of the branch.
Also correct the pdf reading test
Enable staff to grant extensions to multiple students without formal requests. Reuse existing student extension logic through a new service for consistency. Supports flexible academic support and streamlines staff workflows. Relates to the OnTrack Staff Grant Extension design documentation.
…rpolated strings This aligns the test file with the string formatting convention used in the rest of the codebase. Single quotes are preferred when string interpolation is not needed, improving consistency. Reviewed as part of peer feedback.
Linked extension_comments_api (student-requested extensions) to use the shared ExtensionService, previously set up for staff-granted extensions. This refactor ensures both student and staff extension flows use the same logic, improving consistency and reducing duplication.
Implemented backend logic to send emails to tutor and student when extensions are granted. Also enable it so the front end can use the returned information from the api to display notifications.
A comment line change made in the staff grant extension feature branch that hasn't been updated here. Changing to keep the consistency.
Also, define relation with user
- Fix delivery method consistency (deliver_now vs deliver_later) - Fix ExtensionComment retrieval logic to prevent race conditions - Add proper error handling for email failures - Fix mailer method calls (class methods vs instance methods) - Add input validation for API parameters - Improve error logging and debugging - Ensure thread-safe extension processing The email notification system now works correctly: - Staff receive summary emails for all granted extensions - Students receive individual notification emails - Proper error handling prevents API failures on email issues - All email delivery methods are consistent across the project
- Change notification message from unit.name to unit.code for better consistency - Unit codes are more concise and standardized (e.g., 'SITXXX') - Improves readability of extension grant notifications
…ttps://github.com/SteveDala/doubtfire-api into feature/staff-grant-extension-backend-t1-complete
Author
|
@b0ink please review when you have a moment. |
b0ink
requested changes
Feb 4, 2026
Member
b0ink
left a comment
There was a problem hiding this comment.
I'll need to review the notification workflow a little more in-depth, but here's a few changes that can be made for now
Member
There was a problem hiding this comment.
The html template should be more consistent with existing email templates (eg. using the logo and main content border outline), refer to portfolio_ready.html.erb or weekly_student_summary.html.erb - you can preview these by copying the HTML output from one of the students in doubtfire-api/tmp/mails/student_**@doubtfire.com into an HTML previewer online to verify that it looks right
SteveDala
added a commit
to SteveDala/doubtfire-api
that referenced
this pull request
Feb 4, 2026
SteveDala
added a commit
to SteveDala/doubtfire-api
that referenced
this pull request
Feb 4, 2026
fix: changes requested to doubtfire-lms#565 fix: db/schema.rb changes requested to doubtfire-lms#565 fix: change approach to institution settings fix: rubocop nit fix: test issues
a5447e0 to
1df9bb2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request is a complete rebase of the Staff Grant Extension (SGE) API functionality introduced in #77. The initial feature was built on
9.x, and this PR migrates the feature to the new10.0.xdevelopment branch.All credit for development of the feature API goes to @samindiii and @SahiruWithanage.
Sister branches
Run OnTrack with the latest version of these branches to recreate the environment.
Sister Pull Requests
Repo cleanup
Merging this PR should be followed by closing the following open PRs with a comment that they have been merged into
10.0.x:Merging this PR should also be followed by closing the forked version PR mentioned above with a comment that it has been merged into
10.0.xupstream:Type of change
How Has This Been Tested?
Test A
While the development container is running, connect and run
rails testfrom the directory/workspace/doubtfire-api. This runs all unit tests. For the last successful GitHub Action run of this branch, see here.Test B
To strictly test the API, head to localhost's API docs while your Docker server is running.
Open "auth : Operations about auths" and go to "POST /api/auth". Enter the following JSON for the
postApiAuthvalue:{"username": "aconvenor", "password":"password"}Then click "Try it out!". From the response, grab the
auth_tokenvalue.Open "units : Operations about units" further down the page then go to "POST /api/units/{unit_id}/staff-grant-extension". Enter the following values for each parameter:
unit_id: 1Username: aconvenorAuth_token: (The one you received from POST /api/auth)postApiUnitsUnitIdStaffGrantExtension:{ "student_ids": [ 24 ], "task_definition_id": 1, "weeks_requested": 1, "comment": "string" }You should receive a "
successful" result in the Response Body.Checklist: