-
Notifications
You must be signed in to change notification settings - Fork 409
feat(api): Staff Grant Extension - Upstream Rebase #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SteveDala
wants to merge
26
commits into
doubtfire-lms:10.0.x
Choose a base branch
from
SteveDala:SGE-rebase-upstream
base: 10.0.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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. |
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: