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


##########
fineract-core/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrencyRepositoryWrapper.java:
##########
@@ -66,4 +63,17 @@ public ApplicationCurrency 
findOneWithNotFoundDetection(final String currencyCod
         }
         return applicationCurrency;
     }
+
+    public Boolean existsByCode(String code) {
+        return repository.existsByCode(code);
+    }
+
+    public ApplicationCurrency save(ApplicationCurrency currency) {
+        if (existsByCode(currency.getCode())) {

Review Comment:
   you can do it, but pretty unnecessary... however this API will not be under 
heavy load ever, so it does not have performance impact. also sql exceptions 
can be wrapped into any "new" exception also... but like i said... it could be 
fine as this will be used rarely 



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