FINERACT-2676: Fix named PPI survey score overview#6102
Open
jmtdev0 wants to merge 1 commit into
Open
Conversation
Contributor
Kindly asking you to set up GPG signature and sign your commit. |
d5d5053 to
edf568a
Compare
Author
|
Thank you for the review and for pointing this out. I have now signed the commit and force-pushed the updated branch. GitHub marks the new commit as verified on my side. Please let me know if anything else is needed from me. |
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
Fixes FINERACT-2676.
The named PPI survey score overview endpoint accepted a
surveyNamepath parameter, but the resource method delegated to the all-surveys service overload and the named-survey service path attempted to use a JDBC bind parameter as a SQL table identifier (FROM ? tz). JDBC parameters can safely bind values, but not SQL identifiers, so the named-survey query could not work correctly.This PR updates the endpoint to delegate to the named-survey overload and updates
ReadSurveyServiceImpl.retrieveClientSurveyScoreOverview(String surveyName, Long clientId)to:surveyName;registered_table_name = ?;FROMclause with the resolved registered survey table name;ppi_name, enabled status, client id) bound as JDBC parameters.The identifier is not additionally quoted in this change. Instead, the table name is first looked up from the existing PPI datatable registration/permission query and then validated again with
SqlValidatorbefore it is used as an identifier. This mirrors the existing all-surveys implementation in the same service, while narrowing it to the requested registered survey. The values that remain user/runtime data continue to use JDBC bind parameters.Test coverage was added for both the API delegation and the SQL construction/permission behavior in the service.
Testing
Targeted unit tests passed:
I also performed a deeper local smoke test on Windows with Docker Desktop:
jibBuildTarand loaded it into Docker;{"status":"UP","groups":["liveness","readiness"]};ppi_test_alphaandppi_test_beta, plus the required PPI likelihood fixtures;GET /fineract-provider/api/v1/survey/ppi_test_alpha/1returned onlysurveyName: ppi_test_alpha;GET /fineract-provider/api/v1/survey/ppi_test_beta/1returned onlysurveyName: ppi_test_beta;[].That smoke test specifically checks that the named endpoint respects the requested
surveyNameinstead of falling back to all registered PPI surveys.Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.
This PR was developed by Codex with supervision from jmtdev0.