-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
src/test/java/formflow/library/repository/SubmissionRepositoryServiceTest.java
Show resolved
Hide resolved
There was a problem hiding this 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); | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
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
style?