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
Feature 7434 do not validate case save from visit #7556
Feature 7434 do not validate case save from visit #7556
Conversation
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.
You would've spared yourself a lot of refactoring work by adding a second saveCase
method with the additional parameter, and by extending the current method to call the new method with false
:) I'd suggest to still do this because it makes the code a lot cleaner (i.e. far less unnecessary parameters).
Actually the IDE changed the signature automatically so no trouble there. |
@@ -1335,7 +1335,12 @@ public CaseReferenceDto getReferenceByUuid(String uuid) { | |||
|
|||
@Override | |||
public CaseDataDto saveCase(@Valid CaseDataDto dto) throws ValidationRuntimeException { | |||
return saveCase(dto, true, true); | |||
return saveCase(dto, true, true, false, false); |
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.
internal
should not be set to false here; see line 1455, the method there sets it to true
as well. If I understand it correctly, internal
should always be true unless the case comes from an external source (e.g. sormas2sormas). I suggest to ommit the argument here and let the saveCase method in 1455 handle it.
|
||
@Override | ||
public CaseDataDto saveCase(@Valid CaseDataDto dto, Boolean systemSave) throws ValidationRuntimeException { | ||
return saveCase(dto, true, true, false, systemSave); |
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.
Same here
@@ -3167,7 +3172,7 @@ private void mergeCase(CaseDataDto leadCaseData, CaseDataDto otherCaseData, bool | |||
// 1.1 Case | |||
|
|||
copyDtoValues(leadCaseData, otherCaseData, cloning); | |||
saveCase(leadCaseData, !cloning, true); | |||
saveCase(leadCaseData, !cloning, true, false, false); |
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.
Same here
@@ -77,7 +77,7 @@ | |||
@POST | |||
@Path("/push") | |||
public List<PushResult> postCases(@Valid List<CaseDataDto> dtos) { | |||
return savePushedDto(dtos, FacadeProvider.getCaseFacade()::saveCase); | |||
return savePushedDto(dtos, dto -> FacadeProvider.getCaseFacade().saveCase(dto)); |
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.
Strange refactoring - the ::
notation should actually be the preferred one by the IDE
Fixes #7434