Skip to content

Commit

Permalink
Merge pull request #795 from bcgov/feature/update-completion
Browse files Browse the repository at this point in the history
Add change to capture existing value
  • Loading branch information
TayGov authored Nov 30, 2023
2 parents fc52cb1 + 75eef9e commit ea6fe14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,13 @@ public void editForm(UpdateForm updateForm, String location) {
riskRating = getAnswerByKey(childAnswers, RISK_RATING);
}
formInput.setFormType(formType);
List<CodeTable> parentCodes = obridgeClientService.getFormTypes(formType);
formInput.setFormTypeId(new BigDecimal(parentCodes.get(0).getCode()));

formInput.setFormTypeId(clientFormSummary.getFormTypeId());
formInput.setOverallSupervision(MessageFormat.format("Supervision Rating: {0}{1} Needs Rating: {2}{1} Risk Rating: {3}", supervisionRating, System.lineSeparator(), needsRating, riskRating));

} else {
formInput.setFormType(clientFormSummary.getModule());
List<CodeTable> childCodes = obridgeClientService.getFormTypes(clientFormSummary.getModule());
formInput.setFormTypeId(new BigDecimal(childCodes.get(0).getCode()));
formInput.setFormTypeId(clientFormSummary.getFormTypeId());
formInput.setOverallSupervision(MessageFormat.format("Supervision Rating: {0}{1} Needs Rating: {2}{1} Risk Rating: {3}", getAnswerByKey(existingAnswers, SUPERVISION_RATING), System.lineSeparator(), getAnswerByKey(existingAnswers, NEEDS_RATING), getAnswerByKey(existingAnswers, RISK_RATING)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void testEditWithChild() {
Assertions.assertDoesNotThrow(() -> sut.editForm(new UpdateForm(updateFormInput, BigDecimal.ONE, true,"TEST@idir", false, Collections.EMPTY_LIST), "1"));

}

@Test
@DisplayName("Error: Edit is invalid")
public void testDoesNotHaveOverrideorOwner() {
Expand Down

0 comments on commit ea6fe14

Please sign in to comment.