adamsaghy commented on code in PR #3663:
URL: https://github.com/apache/fineract/pull/3663#discussion_r1441476212
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -1705,4 +1710,22 @@ private void officeSpecificLoanProductValidation(final
Long productId, final Lon
}
}
+ private void validateTransactionProcessingStrategy(final LoanProduct
loanProduct, final String loanRepaymentStrategy) {
+ // PROGRESSIVE: Repayment strategy MUST be only "advanced payment
allocation"
+ if
(loanProduct.getLoanProductRelatedDetail().getLoanScheduleType().equals(LoanScheduleType.PROGRESSIVE))
{
Review Comment:
Still no good :(
During loan submit loan schedule type can be overriden , so you must check
that one instead of the loan product.
TLDR: loan schedule type is stored at loan level as well, so you must check
that instead of the product.
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -1705,4 +1710,22 @@ private void officeSpecificLoanProductValidation(final
Long productId, final Lon
}
}
+ private void validateTransactionProcessingStrategy(final LoanProduct
loanProduct, final String loanRepaymentStrategy) {
+ // PROGRESSIVE: Repayment strategy MUST be only "advanced payment
allocation"
+ if
(loanProduct.getLoanProductRelatedDetail().getLoanScheduleType().equals(LoanScheduleType.PROGRESSIVE))
{
Review Comment:
The only check you need to do with product:
- if loan product repayment strategy is **not** advanced payment allocation,
during the loan submit you **cannot** select advanced payment allocation either.
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java:
##########
@@ -248,6 +251,22 @@ private Loan assembleApplication(final JsonElement
element, final Long clientId,
final Boolean isFloatingInterestRate = this.fromApiJsonHelper
.extractBooleanNamed(LoanApiConstants.isFloatingInterestRateParameterName,
element);
+ // PROGRESSIVE: Repayment strategy MUST be only "advanced payment
allocation"
+ if
(loanProduct.getLoanProductRelatedDetail().getLoanScheduleType().equals(LoanScheduleType.PROGRESSIVE))
{
Review Comment:
same as above.
--
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]