adamsaghy commented on code in PR #3411:
URL: https://github.com/apache/fineract/pull/3411#discussion_r1321645034


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java:
##########
@@ -1662,10 +1664,10 @@ public void modifyApplication(final JsonCommand 
command, final Map<String, Objec
             this.accountNumber = StringUtils.defaultIfEmpty(newValue, null);
         }
 
-        if 
(command.isChangeInStringParameterNamed(SavingsApiConstants.externalIdParamName,
 this.externalId)) {
+        if 
(command.isChangeInStringParameterNamed(SavingsApiConstants.externalIdParamName,
 this.externalId.getValue())) {
             final String newValue = 
command.stringValueOfParameterNamed(SavingsApiConstants.externalIdParamName);
             actualChanges.put(SavingsApiConstants.externalIdParamName, 
newValue);
-            this.externalId = StringUtils.defaultIfEmpty(newValue, null);
+            this.externalId = ExternalIdFactory.produce(newValue);

Review Comment:
   Till this logic is not extracted out from the entity you might wanna use 
this:
   ```
               ExternalId externalId = ExternalIdFactory.produce(newValue);
               if (externalId.isEmpty() && 
TemporaryConfigurationServiceContainer.isExternalIdAutoGenerationEnabled()) {
                   externalId = ExternalId.generate();
               }
   ```



-- 
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]

Reply via email to