-
Notifications
You must be signed in to change notification settings - Fork 2
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
[MODFIN-391]. Minimize amount of requests to retrieve transactions for ledger #270
Conversation
|
||
private List<TransactionTotal> filterFundIdsByAllocationDirection(List<String> fundIds, List<TransactionTotal> transactions, String direction) { | ||
// Note that here getToFundId() is used when direction is from (a negation is used afterward) | ||
Function<TransactionTotal, String> getFundId = "from".equals(direction) ? TransactionTotal::getToFundId : TransactionTotal::getFromFundId; |
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 assume it should be
"from".equals(direction) ? TransactionTotal::getFromFundId : TransactionTotal::getToFundId;
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 assume it should be
"from".equals(direction) ? TransactionTotal::getFromFundId : TransactionTotal::getToFundId;
I think it was intentional like this, this code is taken from TransactionService
String fundIdField = "from".equals(direction) ? "fromFundId" : "toFundId"; | ||
String fundQuery = convertIdsToCqlQuery(fundIds, fundIdField, "==", " OR "); | ||
List<String> trTypeValues = trTypes.stream().map(TransactionTotal.TransactionType::value).toList(); | ||
String trTypeQuery = convertIdsToCqlQuery(trTypeValues, "transactionType", "==", " OR "); |
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.
from method name we are incorrectly using this by setting type value, better to use other method or create new one which take value and fieldName only
|
||
public Future<List<TransactionTotal>> getTransactionsToFunds(List<String> fundIds, String fiscalYearId, | ||
List<TransactionTotal.TransactionType> trTypes, RequestContext requestContext) { | ||
return getTransactionsFromOrToFunds(fundIds, fiscalYearId, trTypes, "to", requestContext); |
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 suggest to use string variable instead as static or enum variable
src/main/java/org/folio/services/transactions/TransactionTotalService.java
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Purpose
Approach