FINERACT-2530: Fix 500 error on GET /provisioningentries/{id} when no loan products exist#5880
Open
AshharAhmadKhan wants to merge 1 commit into
Conversation
… loan products exist Change INNER JOIN to LEFT JOIN in PROVISIONING_ENTRY_SUM_RESERVED_SCHEMA so that provisioning entries with no associated loan product rows still return a valid result instead of throwing EmptyResultDataAccessException. Add FeignProvisioningEntryTest to verify the fix. FINERACT-2530: Fix wrong feign method name in test FINERACT-2530: Fix test - create provisioning criteria before entry
420fa8a to
10786ca
Compare
Contributor
Author
|
@adamsaghy please trigger checks when you get a chance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a provisioning entry exists but no loans have been disbursed yet,
calling GET /provisioningentries/{id} returns HTTP 500. The root cause
is an INNER JOIN in PROVISIONING_ENTRY_SUM_RESERVED_SCHEMA — when
m_loanproduct_provisioning_entry has no rows for the given history ID,
the join returns zero rows and Spring's queryForObject() throws
EmptyResultDataAccessException.
Fix: change INNER JOIN to LEFT JOIN so the query always returns one row
(totalReserved = NULL when no loan products exist), mapping cleanly
without throwing.
Picks up the work from #5621.