Skip to content

FINERACT-2530: Fix 500 error on GET /provisioningentries/{id} when no loan products exist#5880

Open
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2530-fix-provisioning-entry-500-no-loans
Open

FINERACT-2530: Fix 500 error on GET /provisioningentries/{id} when no loan products exist#5880
AshharAhmadKhan wants to merge 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2530-fix-provisioning-entry-500-no-loans

Conversation

@AshharAhmadKhan
Copy link
Copy Markdown
Contributor

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.

… 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
@AshharAhmadKhan AshharAhmadKhan force-pushed the FINERACT-2530-fix-provisioning-entry-500-no-loans branch from 420fa8a to 10786ca Compare May 22, 2026 18:26
@AshharAhmadKhan
Copy link
Copy Markdown
Contributor Author

@adamsaghy please trigger checks when you get a chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant