This document describes legacy entities and flows that predate the dev portal's interactive form builder. Once the dev portal flow (multistep, conditional forms, new routes) is the primary component clients use, these can be deprecated.
What it is: A MongoDB document representing an "application form" linked to a PDF file. Stored in formDao, keyed by fileId.
What it stores:
fileId— links to the PDF filemetadata— title, description, etc.body—FormSectioncontainingFormQuestion[]
FormQuestion structure: A flat Java object per field:
questionName— PDF AcroForm field nametype— FieldType (TEXT_FIELD, CHECKBOX, DATE_FIELD, etc.)directive— e.g. "client.currentName.first", "On"options— for radio/selectdefaultValue,answerText, etc.
Where Form is created:
CreateApplicationService— when creating an application (empty body)UploadAnnotatedPDFServiceV2— when uploading an annotated PDF (parsed from PDF)
Who uses Form today:
get-questions-2— loads Form, iterates formQuestions, matches directives to user profiles, returnsfields+resolvedProfilessaveInteractiveFormConfig— when saving in builder, updates Form.body with generated FormQuestion[]fill-pdf-2— no longer uses Form (detached as of refactor); iteratesformAnswersdirectlyupload-signed-pdf-2— saves thefilledForm(a new Form created by FillPDFServiceV2 as the record of what was filled)
What it is: The source of truth for the dev portal form builder. Stored in interactiveFormConfigDao, keyed by fileId.
What it stores:
jsonSchema— JSON Schema for the formuiSchema— JSON Forms UI schema (Categorization, Control, steps, etc.)builderState— questions, output fields, auto-fill fields, signature placements
Who uses it:
get-interactive-form-config— returns jsonSchema, uiSchema to clientsaveInteractiveFormConfig— saves when user saves in builder- Client — uses jsonSchema + uiSchema to render the form via react-jsonforms
| Aspect | Form | InteractiveFormConfig |
|---|---|---|
| Structure | Flat FormQuestion[] | Nested jsonSchema + uiSchema |
| Used for rendering | No (legacy clients may have) | Yes (dev portal) |
| Used for fill-pdf | No (detached) | No (client sends formAnswers) |
| Source of truth | Derived from schema when saving | Primary |
Form.body (formQuestions) is a derived copy — generated from jsonSchema + uiSchema by InteractiveFormConfigUtils.generateFormQuestions() when saving. It is redundant for the dev portal flow.
Location: Form/InteractiveFormConfigUtils.java
What it does: Walks jsonSchema + uiSchema (as JSON), finds Controls with options.pdfField, produces FormQuestion[].
When called: From saveInteractiveFormConfig — updates Form.body with the result.
Legacy role: Feeds Form for get-questions-2 and (formerly) fill-pdf. No longer needed for fill-pdf.
What it does: Loads Form, iterates formQuestions, matches directives to user/org profiles, returns fields + resolvedProfiles.
What the dev portal uses: Only resolvedProfiles (flattened client/worker/org data for directive resolution). The fields array is ignored.
Legacy role: The fields array comes from Form and may be used by other clients (e.g. mobile). The resolvedProfiles could be served by a simpler "get profiles for client" endpoint without Form.
Once the dev portal flow (multistep, conditional forms, new routes) is the component clients use:
- New fill route that only needs
applicationId+formAnswers(already done for fill-pdf-2) - New "get resolved profiles" route that returns flattened user/org data without Form
- Dev portal uses InteractiveFormConfig + new routes only
- In
saveInteractiveFormConfig, remove the block that callsgenerateFormQuestionsand updates Form.body - Form.body will go stale for new saves; get-questions-2 will return outdated fields (if any client still uses them)
- Audit all consumers of Form (get-questions-2, CreateApplicationService, UploadAnnotatedPDFServiceV2)
- Migrate or remove dependencies
- Form may still be needed for
filledForm(the record saved when user uploads signed PDF) — that's a different use case (audit trail of filled answers)
- If no client needs Form.body for template forms, remove:
- Form.body update in saveInteractiveFormConfig
- generateFormQuestions (or repurpose)
- get-questions-2's Form iteration (replace with simpler profiles endpoint)
- Keep Form entity only if needed for filledForm records on upload
| Component | Status | Action |
|---|---|---|
| fill-pdf-2 | Detached from Form | Done — iterates formAnswers only |
| Form (template) | Legacy | Deprecate when dev portal flow is primary |
| Form.body / formQuestions | Redundant for dev portal | Stop updating on save; remove when safe |
| get-questions-2 | Partially legacy | Replace with simpler profiles endpoint |
| InteractiveFormConfig | Current | Keep — source of truth for builder |
| filledForm (on upload) | Still needed | Keep — audit record of filled PDF |