adamsaghy commented on code in PR #4902:
URL: https://github.com/apache/fineract/pull/4902#discussion_r2272802915
##########
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:
Also, code is unique, so you dont event need to check. After it got saved,
you would got a `duplicate key violates unique constraint`, you can handle that
and raise the proper exception.
--
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]