Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CCAP-341] Create confirmation code for family applications #598

Merged
merged 17 commits into from
Sep 18, 2024

Conversation

cram-cfa
Copy link
Collaborator

Issue tracking number πŸ”—

https://codeforamerica.atlassian.net/browse/CCAP-341

Description of change ✍️

Priority πŸ₯‡

Effect on other applications using FFB 🌊

Testing

βœ… Checklist before requesting a review

  • Does the new code follow our preferred coding
    style
    ?
  • Does the code include javadocs, where necessary?
  • Have tests for this feature been added / updated?
  • Has the readme been updated?

Copy link
Contributor

@coltborg coltborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

}

actionManager.handleBeforeSaveAction(currentScreen, submission);
submission = saveToRepository(submission);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be in the POST endpoint and not the POST + /submit endpoint.

As is right now, the at creation method would not work correctly since this endpoint is only hit when submitting the application. You want the POST mapping which starts on line 234.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, though unlikely, it's possible at some point someone will create an application where the flow starts with a subflow and the first POST is in a subflow, which makes me wonder if we should account for that by adding the on creation but to the POST subflow endpoint as well (starts on 448) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, these should be updated per our Tuple!

public synchronized void generateAndSetUniqueShortCode(Submission submission) {

if (submission.getShortCode() != null) {
return;
Copy link
Contributor

@spokenbird spokenbird Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should log here as ideally we shouldn't hit this return, but it would be good to know if we are. Maybe a log warn?

assertThat(testFlowSubmission.get().getSubmittedAt()).isNull();
// assertThat(testFlowSubmission.get().getShortCode()).isNotNull();

ResultActions result = mockMvc.perform(post("/flow/testFlow/pageWithCustomSubmitButton/submit").session(session));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update this test when moving the above creation method as the /submit endpoint is only meant for completing an application and setting the submittedAt, etc.

@cram-cfa cram-cfa merged commit 572a59a into main Sep 18, 2024
5 checks passed
@cram-cfa cram-cfa deleted the marc-CCAP-341 branch September 18, 2024 17:29
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.

3 participants