Bosu - hgn questionnaire followup fixes backend - #2316
Open
BosuBose132 wants to merge 3 commits into
Open
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
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
Adds backend support for the HGN Questionnaire Dashboard follow-up requirement to display forms on
/hgnformwith theirformNameanddescription.The existing generic Form schema supported
formNameand questions but did not include a description field. This PR adds backward-compatible description support to the existing Form model and updates the form controller so descriptions can be preserved and returned through the existing form API.Existing Form records without descriptions remain valid, and the existing HGN question API and questionnaire response flow are unchanged.
Fixes # PR #1547 / PR #3775 follow-up fixes
Related PRS (if any):
Bosu-HGN-Questionnaire-Followup-FixesMain changes explained:
src/models/forms.jsto support an optionaldescriptionfield for generic forms.descriptionbackward compatible so existing database records without this field continue to work.src/controllers/formController.jsso form creation and editing preserve description metadata./api/formresponse behavior while allowing returned forms to includedescription.src/controllers/formController.spec.jswith focused coverage for the new description behavior./api/questionsHGN questionnaire API and existing form-response behavior.How to test:
Bosu-HGN-Questionnaire-Followup-Fixes-BackendBosu-HGN-Questionnaire-Followup-Fixesnpm installif dependencies need to be installed.npm run buildnpm startnpm run start:local/hgnform./api/formendpoint are displayed./api/questionsflow continues to work.Screenshots or videos of changes:
Note:
git diff --checkpassed.descriptionfield is optional, so no MongoDB migration or manual update is required for existing Form records.