-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-2081: Enable inline COB execution for locked loans #4171
FINERACT-2081: Enable inline COB execution for locked loans #4171
Conversation
@@ -241,7 +241,7 @@ private boolean isLockOverrulable(LoanAccountLock loanAccountLock) { | |||
if (isBypassUser()) { | |||
return true; | |||
} else { | |||
return StringUtils.isNotBlank(loanAccountLock.getError()); | |||
return StringUtils.isBlank(loanAccountLock.getError()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think it is correct to do this. Please undo this change. We can change the lock if we are going with bypass user or there was an error stored on the lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Change undone
@@ -75,7 +77,9 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse | |||
proceed(filterChain, request, response); | |||
} else { | |||
try { | |||
log.info("calculateRelevantLoanIds ==>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No info log please! Use debug!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Logs removed
@@ -240,7 +250,8 @@ private Long getTopLevelLoanIdFromBatchRequest(BatchRequest batchRequest) throws | |||
|
|||
private List<Long> getLoanIdsFromApi(String pathInfo) { | |||
List<Long> loanIds = getLoanIdList(pathInfo); | |||
if (isLoanHardLocked(loanIds)) { | |||
log.info("getLoanIdsFromApi {}", loanIds.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No info log please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Logs removed
@@ -217,7 +227,7 @@ private List<Long> getLoanIdsFromBatchApi(BodyCachingHttpServletRequestWrapper r | |||
// check the body for Loan ID | |||
Long loanId = getTopLevelLoanIdFromBatchRequest(batchRequest); | |||
if (loanId != null) { | |||
if (isLoanHardLocked(loanId)) { | |||
if (isLoanHardLocked(loanId) && isLockOverrulable(loanId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong condition. If the lock has an error stored, we should allow to run the inline cob!
@@ -240,7 +250,8 @@ private Long getTopLevelLoanIdFromBatchRequest(BatchRequest batchRequest) throws | |||
|
|||
private List<Long> getLoanIdsFromApi(String pathInfo) { | |||
List<Long> loanIds = getLoanIdList(pathInfo); | |||
if (isLoanHardLocked(loanIds)) { | |||
log.info("getLoanIdsFromApi {}", loanIds.size()); | |||
if (isLoanHardLocked(loanIds) && isLockOverrulable(loanIds)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong condition. If the lock has an error stored, we should allow to run the inline cob!
8ecb7a9
to
0d60d5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Updated
@@ -241,7 +241,7 @@ private boolean isLockOverrulable(LoanAccountLock loanAccountLock) { | |||
if (isBypassUser()) { | |||
return true; | |||
} else { | |||
return StringUtils.isNotBlank(loanAccountLock.getError()); | |||
return StringUtils.isBlank(loanAccountLock.getError()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Change undone
@@ -75,7 +77,9 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse | |||
proceed(filterChain, request, response); | |||
} else { | |||
try { | |||
log.info("calculateRelevantLoanIds ==>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Logs removed
@@ -240,7 +250,8 @@ private Long getTopLevelLoanIdFromBatchRequest(BatchRequest batchRequest) throws | |||
|
|||
private List<Long> getLoanIdsFromApi(String pathInfo) { | |||
List<Long> loanIds = getLoanIdList(pathInfo); | |||
if (isLoanHardLocked(loanIds)) { | |||
log.info("getLoanIdsFromApi {}", loanIds.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Logs removed
c44654e
to
f800f81
Compare
DataTable table) throws IOException { | ||
String idempotencyKey = UUID.randomUUID().toString(); | ||
Response<PostLoansResponse> loanResponse = testContext().get(TestContextKey.LOAN_CREATE_RESPONSE); | ||
Long loanId = loanResponse.body().getLoanId(); | ||
|
||
LoanRescheduleErrorMessage loanRescheduleErrorMessage = LoanRescheduleErrorMessage.valueOf(errorMessageType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to remove these checks?
@@ -542,17 +538,10 @@ public void runBatchApiCreateAndApproveLoanRescheduleWithGivenUserLockedByCobErr | |||
Boolean isEnclosingTransaction = Boolean.valueOf(enclosingTransaction); | |||
Response<List<BatchResponse>> batchResponseList = batchApiApi.handleBatchRequests(requestList, isEnclosingTransaction, headerMap) | |||
.execute(); | |||
String errorToString = batchResponseList.errorBody().string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to remove these checks?
@@ -658,6 +658,7 @@ Feature: LoanReschedule | |||
When Batch API call with created user and with steps: rescheduleLoan from "16 January 2024" to "31 January 2024" submitted on date: "10 January 2024", approveReschedule on date: "10 January 2024" runs with enclosingTransaction: "true" | |||
Then Admin checks that last closed business date of loan is "09 January 2024" | |||
|
|||
@temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this new tag?
f800f81
to
a6e07c3
Compare
a6e07c3
to
193225d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
If the loan is locked, but there is any error attached to the lock, it means the prior execution of COB / Inline COB failed.
For user experience it would be better if we let the inline COB to be triggered again in these situations hence noone is processing the loan at the moment, it just indicates there was some problem during the last processing.
FINERACT-2081
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Write the commit message as per https://github.com/apache/fineract/#pull-requests
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.
Create/update unit or integration tests for verifying the changes made.
Follow coding conventions at 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
Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.