-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fineract-2408: Update search api resource to support SAVING & SHARE entities #5166
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
base: develop
Are you sure you want to change the base?
Fineract-2408: Update search api resource to support SAVING & SHARE entities #5166
Conversation
IOhacker
left a comment
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.
Make sure to do a squash and commit. Are you proposing to look up by the internal ID?
I’m not directly using the internal status ID. |
bc62c6b to
a34c455
Compare
|
Implementation looks good to me. I would recommend adding a test in @Test
public void searchSavingsAndSharesHaveEntityStatus() {
// Create client
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
final Long clientId = clientResponse.getClientId();
final GetClientsClientIdResponse getClientResponse = ClientHelper.getClient(requestSpec, responseSpec, clientId.intValue());
// Search for savings accounts - should return results with proper entityStatus
final List<String> savingsResources = Arrays.asList("savings");
final ArrayList<GetSearchResponse> savingsSearchResponse = SearchHelper.getSearch(requestSpec, responseSpec,
getClientResponse.getAccountNo(), Boolean.FALSE, getResources(savingsResources));
// Verify that if any SAVING entities are returned, they have valid entityStatus
savingsSearchResponse.stream()
.filter(result -> "SAVING".equalsIgnoreCase(result.getEntityType()))
.forEach(result -> {
assertNotNull(result.getEntityStatus(), "SAVING entity should have entityStatus");
assertNotNull(result.getEntityStatus().getId(), "SAVING entityStatus should have id");
assertNotNull(result.getEntityStatus().getCode(), "SAVING entityStatus should have code");
});
// Search for share accounts - should return results with proper entityStatus
final List<String> shareResources = Arrays.asList("shares");
final ArrayList<GetSearchResponse> shareSearchResponse = SearchHelper.getSearch(requestSpec, responseSpec,
getClientResponse.getAccountNo(), Boolean.FALSE, getResources(shareResources));
// Verify that if any SHARE entities are returned, they have valid entityStatus
shareSearchResponse.stream()
.filter(result -> "SHARE".equalsIgnoreCase(result.getEntityType()))
.forEach(result -> {
assertNotNull(result.getEntityStatus(), "SHARE entity should have entityStatus");
assertNotNull(result.getEntityStatus().getId(), "SHARE entityStatus should have id");
assertNotNull(result.getEntityStatus().getCode(), "SHARE entityStatus should have code");
});
} |
|
@Akshat-Soni02 Could you please add the appropriate test cases to this PR to verify the correct behavior? |
a34c455 to
ec3ce4a
Compare
|
@Akshat-Soni02 Please kindly check the failing test cases. |
Description
Implemented missing status mappings for savings and share entities in the SearchMapper to ensure accurate and complete search results.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.