Skip to content

format v2 data for submission#44145

Draft
andresriveratoro wants to merge 5 commits intomainfrom
cve-2513-data
Draft

format v2 data for submission#44145
andresriveratoro wants to merge 5 commits intomainfrom
cve-2513-data

Conversation

@andresriveratoro
Copy link
Copy Markdown
Contributor

@andresriveratoro andresriveratoro commented Apr 16, 2026

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

  • New v2 submission format. When a veteran fills out the newer version of the COE form, their answers are now packaged up in the shape the backend expects. The older form continues to submit exactly as before — nothing about the existing flow changes.

  • Conditional fields. Certain fields (like Purple Heart recipient and pre-discharge claim questions) are only included when the applicant is active-duty service member. Prior-loan information is only included if the veteran said they had prior loans.

  • Date handling fix. Fixed a crash that could happen when a date field contained only a year (e.g. "1985") without a month or day. Dates are now safely normalized before submission.

  • Feature-flag marker is carried along in the submitted data so the backend knows which version of the form produced it.

  • config/helpers.js — extracted isoDateString to module scope, added a new formatV2Data builder, and branched customCOEsubmit on the view:<TOGGLE_KEY> flag to route v2 submissions through the new formatter while leaving the v1 path intact.

  • formatV2Data reshapes militaryHistory, periodsOfService[].dateRange, loanHistory, and relevantPriorLoans[] (including naturalDisaster.dateOfLoss), strips non-digits from vaLoanNumber, and only includes ADSM-specific and prior-loan branches when applicable.

  • isoDateString now tolerates missing month/day segments (year-only input no longer throws) — this was the bug fix in the final commit.

  • tests/config/helpers.unit.spec.jsx — expanded with coverage for the v2 path, the ADSM conditional fields, prior-loan handling, and the year-only date case.

Related issue(s)

Testing done

New tests make sure that when the updated COE form runs:

  • Added unit tests

Screenshots

N/A

What areas of the site does it impact?

COE behind feature flag

Acceptance criteria

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

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