class LocationInfowindowController extends GenericOCDSController {

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

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

        return releaseAgg(agg);
    }

}