class LocationInfowindowController extends GenericOCDSController {

    @ApiOperation(value = "Displays the planning items, filtered by location. See the location filter "
            + "for the options to filter by")
    @RequestMapping(value = "/api/planningByLocation", method = {RequestMethod.POST,
            RequestMethod.GET}, produces = "application/json")
    @JsonView(Views.Public.class)
    public List<Document> planningByLocation(
            @ModelAttribute @Valid final DefaultFilterPagingRequest filter) {

        Aggregation agg = newAggregation(
                match(where("planning.budget").exists(true).orOperator(
                        where("tender.items.deliveryLocation._id").exists(true)
                )
                        .andOperator(getDefaultFilterCriteria(filter))),
                project("planning").andExclude(Fields.UNDERSCORE_ID),
                skip(filter.getSkip()), limit(filter.getPageSize())
        );

        return releaseAgg(agg);
    }

}