Set expeditedFlagged on Determination create in eligibility state machine - #373
Open
arpitjain099 wants to merge 1 commit into
Open
Conversation
…hine The intake.application.submitted handler POSTs a new Determination without expeditedFlagged, which the Determination schema marks required and non-nullable. The mock-server engine does not auto-default required non-nullable scalars, so every generated Zod client rejected each list/get Determination response with expected boolean, received undefined. Add expeditedFlagged: false to the create body. False is the correct initial value per the field description; the existing flag-expedited action promotes it to true when expedited screening criteria are met. Adds a regression test asserting the create body supplies every required writable field of the Determination schema. Refs codeforamerica#359 Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Collaborator
|
Thanks for the fix — the approach is correct and the regression test is a nice addition. Two small things before we merge:
|
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.
The intake.application.submitted handler creates a Determination without expeditedFlagged, but the resolved schema marks that field required and non-nullable and the mock-server engine leaves required non-nullable scalars to the caller, so generated Zod clients reject every list/get Determination response with expected boolean, received undefined (issue #359). This adds expeditedFlagged: false to the create body, which matches the field description (set at submission, then the existing flag-expedited action promotes it to true once expedited screening criteria are met).
I also added a small regression test that asserts the Determination create body supplies every required writable field of the schema; it fails on the old code and passes with the fix, and the existing state-machine unit tests still pass. I left the Interview appointments second site from the issue comment out of this PR since it lives in intake-state-machine.yaml and the reporter noted it may be a separate engine default, so happy to follow up on that separately if you'd like it here too.