Skip to content

Set expeditedFlagged on Determination create in eligibility state machine - #373

Open
arpitjain099 wants to merge 1 commit into
codeforamerica:mainfrom
arpitjain099:chore/determination-expedited-flagged
Open

Set expeditedFlagged on Determination create in eligibility state machine#373
arpitjain099 wants to merge 1 commit into
codeforamerica:mainfrom
arpitjain099:chore/determination-expedited-flagged

Conversation

@arpitjain099

Copy link
Copy Markdown

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.

…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>
@mryhmln

mryhmln commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the fix — the approach is correct and the regression test is a nice addition.

Two small things before we merge:

  1. Could you rebase on main so CI can run the full test suite?
  2. Since the Interview appointments piece from state-machine: Determination create omits required expeditedFlagged; Zod rejects every list/get response #359 is out of scope here, would you mind updating the PR description to say "Partially addresses state-machine: Determination create omits required expeditedFlagged; Zod rejects every list/get response #359" so the issue stays open for the follow-up?

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.

2 participants