pwargulak opened a new pull request, #6748:
URL: https://github.com/apache/fineract/pull/6748

   ## Description
   
   [FINERACT-3002](https://issues.apache.org/jira/browse/FINERACT-3002)
   
   Working Capital loan transaction amounts were only checked for being 
positive, so an amount with more decimals than the loan's currency was stored 
and posted as given (a 339.735 repayment on a 2-decimal currency). 
`WorkingCapitalLoanDataValidator` now applies 
`WorkingCapitalAmountScaleValidator.validateNotFinerThanCurrency`, which the 
product and application validators already use, to:
   
   - disbursement `transactionAmount` and `discountAmount`;
   - repayment (also goodwill credit and payout refund), recovery payment and 
credit balance refund `transactionAmount`;
   - discount fee and discount fee adjustment amounts;
   - adjust transaction and adjust by delta `transactionAmount`.
   
   A finer amount answers 400 
`validation.msg.WORKINGCAPITALLOAN.<param>.scale.is.greater.than.<digits>`. Not 
included: the charge adjustment `amount` (its validator gets no loan, so no 
currency) and principal / discount at create, modify and approval, which book 
nothing themselves; both noted on the ticket.
   
   Tests: new `WorkingCapitalLoanDataValidatorAmountScaleTest` (8), and one 
case each in `WorkingCapitalLoanDataValidatorRecoveryPaymentTest` and 
`WorkingCapitalLoanDataValidatorAdjustByDeltaTest`. The 9 refusal cases fail on 
`develop`.
   
   Run locally: on the three changes together (FINERACT-3000, 3001, 3002) on 
develop 537e19aaa9: spotless, checkstyle, rat, javadoc, spotbugs and the 
Liquibase DDL safety check are clean; the core build; the unit suites of 
`fineract-provider` (1899 tests), `fineract-working-capital-loan` (1721) and 
`fineract-cob` (5), no failures; and all 76 Working Capital and COB integration 
test classes (748 tests) on PostgreSQL, MariaDB and MySQL, where the five 
indexes were checked to exist. Not run: the other integration test classes and 
the e2e (Cucumber) suite.
   
   ## Checklist
   
   - [x] Write the commit message as per [our 
guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [x] Acknowledge that we will not review PRs that are not passing the build 
_("green")_ - it is your responsibility to get a proposed PR to pass the build, 
not primarily the project's maintainers.
   - [x] Create/update [unit or integration 
tests](https://fineract.apache.org/docs/current/#_testing) for verifying the 
changes made.
   - [x] Follow our [coding 
conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [ ] Add required Swagger annotation and update API documentation at 
fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with 
details of any API changes
   - [x] [This PR must not be a "code 
dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit).
 Large changes can be made in a branch, with assistance. Ask for help on the 
[developer mailing list](https://fineract.apache.org/#contribute).
   - [x] If merging this PR resolves a JIRA issue, I will mark that issue as 
resolved and set "Fix Version/s" appropriately.
   - [x] I followed the [AI 
Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy).
   


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