Skip to content

Applications refactor#72

Merged
balebbae merged 17 commits intomainfrom
applications-refactor
Apr 15, 2026
Merged

Applications refactor#72
balebbae merged 17 commits intomainfrom
applications-refactor

Conversation

@balebbae
Copy link
Copy Markdown
Collaborator

@balebbae balebbae commented Apr 15, 2026

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.

balebbae added 17 commits April 12, 2026 19:58
…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.
@balebbae balebbae merged commit ddf12af into main Apr 15, 2026
2 checks passed
@balebbae balebbae deleted the applications-refactor branch April 20, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant