class PatchingRepositoryImpl implements PatchingRepository, Constants {

	@Override
	public List<Map<String, Object>> getPatchingPercentForDateRange(String assetGroup, LocalDate fromDate,
			LocalDate toDate){
		
		List<String> fieldList = new ArrayList<>();
		
		Map<String, Object> mustFilter = new HashMap<>();
		
		mustFilter.put(CommonUtils.convertAttributetoKeyword("ag"),assetGroup);

		Map<String, Object> rangeMap = new HashMap<>();
		rangeMap.put("gte", fromDate.format(DateTimeFormatter.ISO_DATE));
		rangeMap.put("lte", toDate.format(DateTimeFormatter.ISO_DATE));
		
		Map<String, Object> dateRangeMap = new HashMap<>();
		dateRangeMap.put("date", rangeMap);
		
		mustFilter.put(RANGE, dateRangeMap);
		
		fieldList.add("patching_percentage");
		fieldList.add("date");
		fieldList.add("ag");
		
		try {
			return elasticSearchRepository.getSortedDataFromES(AG_STATS, "patching", mustFilter, null, null,
					fieldList, null, null);
		} catch (Exception e) {
			return null;
		}
	}

}