Draft
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.
Are you removing, renaming or moving a folder in this PR?
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:
Screenshots
N/A
What areas of the site does it impact?
COE behind feature flag
Acceptance criteria
Quality Assurance & Testing
Error Handling
Authentication