adamsaghy commented on code in PR #2783:
URL: https://github.com/apache/fineract/pull/2783#discussion_r1039800321
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java:
##########
@@ -479,10 +476,10 @@ public Map<String, Object> update(final JsonCommand
command) {
this.accountNumber = StringUtils.defaultIfEmpty(newValue, null);
}
- if
(command.isChangeInStringParameterNamed(ClientApiConstants.externalIdParamName,
this.externalId)) {
+ if
(command.isChangeInStringParameterNamed(ClientApiConstants.externalIdParamName,
this.externalId.getValue())) {
final String newValue =
command.stringValueOfParameterNamed(ClientApiConstants.externalIdParamName);
actualChanges.put(ClientApiConstants.externalIdParamName,
newValue);
- this.externalId = StringUtils.defaultIfEmpty(newValue, null);
+ this.externalId = new ExternalId(newValue);
Review Comment:
This is wrong! Please move this logic out of the entity.
Also, creating a new external id please use the `ExternalIdFactory`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]