FINERACT-2455: Working Capital product near breach configuration#5740
Conversation
a6f5a4d to
3f5d710
Compare
|
@alberto-art3ch please rebase |
3f5d710 to
a8de8ab
Compare
Done! Please review |
cfc10f4 to
21f037c
Compare
galovics
left a comment
There was a problem hiding this comment.
Builds are failing, pls fix them.
21f037c to
726b5bc
Compare
Done! Please review |
726b5bc to
e956b9a
Compare
| public class WorkingCapitalNearBreachNotFoundException extends AbstractPlatformResourceNotFoundException { | ||
|
|
||
| public WorkingCapitalNearBreachNotFoundException(final Long breachId) { | ||
| super("error.msg.wcl.breach.not.found", "Working Capital Near Breach with id " + breachId + " was not found.", breachId); |
There was a problem hiding this comment.
The error code is the same as for breach. It probably should be error.msg.wcl.near.breach.not.found
| } | ||
|
|
||
| if (this.value != null) { | ||
| final BigDecimal number = BigDecimal.valueOf(Double.parseDouble(this.value.toString())); |
There was a problem hiding this comment.
This can be simplified to new BigDecimal(this.value.toString())
| if (nearBreachId != null) { | ||
| final WorkingCapitalBreachData breachData = workingCapitalBreachReadPlatformService.retrieveOne(breachId); | ||
| final WorkingCapitalNearBreachData nearBreachData = workingCapitalNearBreachReadPlatformService.retrieveOne(nearBreachId); | ||
| if (FrequencyTypeUtil.compareFrequencies(nearBreachData.getFrequency(), nearBreachData.getFrequencyType().getCode(), |
There was a problem hiding this comment.
Do we support partial updates? If yes, then we are losing this check, because at the beginning we check whether nearBreachIdParamName exists. On a partial update that changes only breachId (to a breach with a shorter frequency), the existing nearBreach on the product is not re-validated.
| private final WorkingCapitalNearBreachReadPlatformService readPlatformService; | ||
|
|
||
| public WorkingCapitalNearBreachRequest validateAndParse(@NotNull final JsonCommand command) { | ||
| final DataValidatorBuilder dataValidator = new DataValidatorBuilder(new ArrayList<>()).resource("workingCapitalBreach.create"); |
There was a problem hiding this comment.
I believe should be workingCapitalNearBreach.create
| @Path("{breachId}") | ||
| @Consumes({ MediaType.APPLICATION_JSON }) | ||
| @Produces({ MediaType.APPLICATION_JSON }) | ||
| @Operation(operationId = "retrieveWorkingCapitalNearBreach", summary = "Retrieve Working Capital Breach") |
There was a problem hiding this comment.
Missed Near for summary
| @POST | ||
| @Consumes({ MediaType.APPLICATION_JSON }) | ||
| @Produces({ MediaType.APPLICATION_JSON }) | ||
| @Operation(operationId = "createWorkingCapitalNearBreach", summary = "Create Working Capital Breach") |
There was a problem hiding this comment.
Missed Near for summary
| @Path("{breachId}") | ||
| @Consumes({ MediaType.APPLICATION_JSON }) | ||
| @Produces({ MediaType.APPLICATION_JSON }) | ||
| @Operation(operationId = "updateWorkingCapitalNearBreach", summary = "Update Working Capital Breach") |
There was a problem hiding this comment.
Missed Near for summary
| @Path("{breachId}") | ||
| @Consumes({ MediaType.APPLICATION_JSON }) | ||
| @Produces({ MediaType.APPLICATION_JSON }) | ||
| @Operation(operationId = "deleteWorkingCapitalNearBreach", summary = "Delete Working Capital Breach") |
There was a problem hiding this comment.
Missed Near for summary
e956b9a to
5ec60de
Compare
Description
User should be able to configure near breach at the product level(similar to Breach configuration), now with the next attributes:
FINERACT-2455
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.