Conversation
…eld to settings Move StringArray type to its own file since it's shared by schedule.go. Add ApplicationSchemaField struct, SettingsKeyApplicationSchema constant, and GetApplicationSchema/UpdateApplicationSchema methods to settings store.
…onses Replace ~25 individual form-field columns with a single `responses JSONB` column. Simplify Create/Update/List/SetStatus/GetEmailsByStatus queries. Add scanApplication helper and applicationSelectCols constant for DRY.
Change GetPendingByAdminID and GetCompletedByAdminID queries to use a.responses->>'field_name' instead of direct column references.
Replace 25-field UpdateApplicationPayload with 5 fields (responses, resume_path, ack_mlh_coc, ack_mlh_privacy, opt_in_mlh_emails). Switch to schema-driven validation on submit using GetApplicationSchema. Rename ApplicationWithQuestions to ApplicationWithSchema.
Replace getShortAnswerQuestions/updateShortAnswerQuestions with getApplicationSchema/updateApplicationSchema. Update routes from /saquestions to /application-schema.
Remove ShortAnswerQuestion struct, SettingsKeyShortAnswerQuestions constant, and Get/Update methods from settings store, interface, and mock. Application schema replaces this functionality.
Update newCompleteApplication to use Responses JSONB field. Replace ShortAnswerQuestion mocks with ApplicationSchemaField mocks. Replace SAQ settings tests with application-schema tests.
Add validateResponses function that validates each response value against its schema field: type checks for text/number/select/ multi_select/checkbox, min/max for numbers, maxLength for strings, and option validation for select/multi_select fields.
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.
BREAKING CHANGE. Will have to run migrations down and back up. A complete refactor of the applications to have a reponses column which is of type json. The responses schema is then stored in the settings as a key value config.