Samer-Melhem-FOO opened a new pull request, #6191:
URL: https://github.com/apache/fineract/pull/6191

   ## Description
   
   `CurrencyWritePlatformServiceJpaRepositoryImpl#updateAllowedCurrencies` 
allows removing a currency from the organisation's allowed-currency list. The 
existing in-use check only looked at loan products, savings products, and 
charges, so a currency still referenced by actual loans, savings/share 
accounts, client transactions, account transfers, cashier transactions, or GL 
journal entries could be silently removed.
   
   This broadens the check to a `JdbcTemplate`-based scan across all relevant 
tables (`m_product_loan`, `m_savings_product`, `m_share_product`, `m_charge`, 
`m_loan`, `m_savings_account`, `m_share_account`, `m_client_transaction`, 
`m_account_transfer_transaction`, `m_cashier_transactions`, 
`acc_gl_journal_entry`) and improves `CurrencyInUseException`'s message to be 
clearer to end users.
   
   ## JIRA
   
   https://issues.apache.org/jira/browse/FINERACT-2717
   
   ## Test plan
   
   - [x] `./gradlew :fineract-core:compileJava :fineract-provider:compileJava` 
passes
   - [x] Added `CurrencyWritePlatformServiceJpaRepositoryImplTest` (no prior 
test existed for this class), covering:
     - currency removed successfully when unused
     - `CurrencyInUseException` thrown when the removed currency is still 
referenced
     - the usage check is skipped entirely for currencies that remain allowed
   - [x] `./gradlew :fineract-provider:test --tests 
"...CurrencyWritePlatformServiceJpaRepositoryImplTest"` — all 3 tests pass


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