class AuditReportRepository extends ReportCommonRepository {

    public ReportResults computeVitamResults(String processId, Integer tenantId) {
        ReportResults reportResult = new ReportResults(0,0,0,0);

        Bson eqProcessId = eq(AuditObjectGroupModel.PROCESS_ID, processId);
        Bson eqTenant = eq(AuditObjectGroupModel.TENANT, tenantId);
        Bson groupOnSp = group("$_metadata.status", sum("result", 1));
        MongoCursor<Document> objectGroupsStatusCountResult = getListStats(Aggregates.match(and(eqProcessId, eqTenant)),
                groupOnSp);
        while (objectGroupsStatusCountResult.hasNext()) {
            Document result = objectGroupsStatusCountResult.next();
            String status = result.getString("_id");
            Integer count = result.getInteger("result");
            switch (status) {
            case "OK":
                reportResult.setNbOk(count);
                break;
            case "WARNING":
                reportResult.setNbWarning(count);
                break;
            case "KO":
                reportResult.setNbKo(count);
                break;
            default:
                break;
            }
        }
        reportResult.setTotal(reportResult.getNbKo() + reportResult.getNbOk() + reportResult.getNbWarning());
        return reportResult;
    }

    @VisibleForTesting public  AuditReportRepository(MongoDbAccess mongoDbAccess, String collectionName);
    public  AuditReportRepository(MongoDbAccess mongoDbAccess);

}