Skip to content

Commit

Permalink
feat(policy-api):[#639] update TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf committed Jul 4, 2024
1 parent f3950f1 commit 7ec214f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ public Map<String, List<PolicyResponse>> getPolicies(//
.collect(Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue));
}

// TODO (mfischer): #639: add documentation
// TODO (mfischer): #639: add integration tests
// TODO (mfischer): #639: update insomnia
// TODO (mfischer): #750: add documentation
// TODO (mfischer): #750: add / adapt integration tests
// TODO (mfischer): #750: update insomnia
@GetMapping("/policies/paged")
@ResponseStatus(HttpStatus.OK)
@PreAuthorize("hasAuthority('" + IrsRoles.ADMIN_IRS + "')")
Expand All @@ -231,7 +231,7 @@ public Page<PolicyResponse> getPoliciesPaged(//

ensureParamBusinessPartnerNumberCorrectlyNamed(parameterMap);

// TODO (mfischer): #639: add test coverage for this block
// TODO (mfischer): #750: add test coverage for this block
// There seems to be a bug concerning interpretation of delimiters in Spring.
// If we pass only one search filter `?search=policyId,EQUALS,policy1`,
// the parts of this search filter are split up into several search filters even if we encode the comma.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private PageImpl<PolicyWithBpn> applyPaging(final Pageable pageable, final List<
* Builder for {@link Comparator} for sorting a list of {@link PolicyWithBpn} objects.
*/
private static class PolicyComparatorBuilder {
// TODO (mfischer): #639: maybe extract to separate class
// TODO (mfischer): #750: maybe extract to separate class

private final Pageable pageable;

Expand Down Expand Up @@ -167,7 +167,7 @@ public Sort.Direction getSortDirection(final Pageable pageable, final String fie
* Builder for {@link Predicate} for filtering a list of {@link PolicyWithBpn} objects.
*/
private static class PolicyFilterBuilder {
// TODO (mfischer): #639: maybe extract to separate class
// TODO (mfischer): #750: maybe extract to separate class

private final List<SearchCriteria<?>> searchCriteriaList;

Expand All @@ -193,16 +193,15 @@ private Predicate<PolicyWithBpn> getPolicyPredicate(final SearchCriteria<?> sear
return getBpnFilter(searchCriteria);
} else if (CommonConstants.PROPERTY_POLICY_ID.equalsIgnoreCase(searchCriteria.getProperty())) {
return getPolicyIdFilter(searchCriteria);

// TODO (mfischer): #639: add coverage for action, createdOn, validUntil
// TODO (mfischer): #750: add coverage for action, createdOn, validUntil
} else if (CommonConstants.PROPERTY_ACTION.equalsIgnoreCase(searchCriteria.getProperty())) {
return getActionFilter(searchCriteria);
} else if (CommonConstants.PROPERTY_CREATED_ON.equalsIgnoreCase(searchCriteria.getProperty())) {
// TODO (mfischer): #639: implement createdOn filter
// TODO (mfischer): #750: implement createdOn filter
throw new IllegalArgumentException("Filtering by '%s' has not been implemented yet".formatted(
CommonConstants.PROPERTY_CREATED_ON));
} else if (CommonConstants.PROPERTY_VALID_UNTIL.equalsIgnoreCase(searchCriteria.getProperty())) {
// TODO (mfischer): #639: implement validUntil filter
// TODO (mfischer): #750: implement validUntil filter
throw new IllegalArgumentException("Filtering by '%s' has not been implemented yet".formatted(
CommonConstants.PROPERTY_VALID_UNTIL));
} else {
Expand Down

0 comments on commit 7ec214f

Please sign in to comment.