class ProjectionRepositoryImpl implements ProjectionRepository, Constants {

    @Override
    public Map<Integer, Long> getPatchingSnapshot(String assetGroup) throws DataException {
        String responseJson = null;
        JsonParser jsonParser;
        JsonObject resultJson;
        Map<Integer, Long> patchedInstancesMap = new HashMap<>();
        LocalDate today = LocalDate.now();
        List<LocalDate> dates = updateCurrentWeekDate(today, getListOfLastWeekDateOfQuarter());
        StringBuilder urlToQueryBuffer = new StringBuilder(esUrl).append("/").append("assetgroup_stats").append("/")
                .append("patching").append("/").append("_search").append("?").append("size").append("=")
                .append(ES_PAGE_SIZE);
        StringBuilder requestBody = new StringBuilder(
                "{\"sort\":[{\"date\":{\"order\":\"asc\"}}],\"query\":{\"bool\":{\"must\":[{\"terms\":{\"date\":[");
        for (LocalDate date : dates) {
            requestBody.append("\"" + date + "\",");
        }
        requestBody.deleteCharAt(requestBody.lastIndexOf(","));
        requestBody.append("]}},{\"match\":{\"ag.keyword\":\"" + assetGroup + "\"}}]}}}");

        try {
            responseJson = PacHttpUtils.doHttpPost(urlToQueryBuffer.toString(), requestBody.toString());
        } catch (Exception e) {
            logger.error(e);
            throw new DataException(e);
        }
        jsonParser = new JsonParser();
        resultJson = (JsonObject) jsonParser.parse(responseJson);

        if (resultJson != null) {
            patchedInstancesMap = processJsonData(resultJson);
           
        }
        return patchedInstancesMap;
    }

}