Skip to content

Commit

Permalink
[MODFIN-352] Fixed code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-git committed Apr 10, 2024
1 parent f454be7 commit 1411dce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ public Future<FiscalYear> createFiscalYear(FiscalYear fiscalYear, RequestContext
});
}

public Future<FiscalYearsCollection> getFiscalYearsWithAcqUnitsRestriction(String query, int offset, int limit, RequestContext requestContext) {
public Future<FiscalYearsCollection> getFiscalYearsWithAcqUnitsRestriction(String query, int offset, int limit,
RequestContext requestContext) {
return acqUnitsService.buildAcqUnitsCqlClause(requestContext)
.map(clause -> StringUtils.isEmpty(query) ? clause : combineCqlExpressions("and", clause, query))
.compose(effectiveQuery -> fiscalYearService.getFiscalYearByQuery(effectiveQuery, offset, limit, requestContext));
.compose(effectiveQuery -> fiscalYearService.getFiscalYearsWithoutAcqUnitsRestriction(effectiveQuery, offset,
limit, requestContext));
}

public Future<FiscalYear> getFiscalYearById(String id, boolean withFinancialSummary, RequestContext requestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ public Future<FiscalYearsCollection> getFiscalYearsWithoutAcqUnitsRestriction(St
return restClient.get(requestEntry.buildEndpoint(), FiscalYearsCollection.class, requestContext);
}

public Future<FiscalYearsCollection> getFiscalYearByQuery(String query, int offset, int limit, RequestContext requestContext) {
var requestEntry = new RequestEntry(resourcesPath(FISCAL_YEARS_STORAGE))
.withOffset(offset)
.withLimit(limit)
.withQuery(query);
return restClient.get(requestEntry.buildEndpoint(), FiscalYearsCollection.class, requestContext);
}

public Future<FiscalYear> getFiscalYearById(String id, RequestContext requestContext) {
return restClient.get(resourceByIdPath(FISCAL_YEARS_STORAGE, id), FiscalYear.class, requestContext);
}
Expand Down

0 comments on commit 1411dce

Please sign in to comment.