diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java index f984d0e0..7fe87275 100644 --- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java +++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java @@ -361,5 +361,13 @@ public class GepafinConstant { public static final String GET_STATUS_CODE_STRING = "status"; public static final String MESSAGE_STRING = "message"; public static final String AMOUNT_ACCEPTED_REQUIRED_WHILE_APPROVING_APPLICATION="amount.accepted.required"; + public static final String CALL_NAME="callName"; + public static final String NUMBER_OF_APPLICATIONS="numberOfApplications"; + public static final String STATUS="status"; + public static final String COUNT="count"; + public static final String APPLICATION_PER_CALL="applicationPerCall"; + public static final String APPLICATION_PER_STATUS="applicationPerStatus"; + + } diff --git a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java index 91b94b90..8f3a55f1 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/DashboardDao.java @@ -1,5 +1,6 @@ package net.gepafin.tendermanagement.dao; +import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.entities.CompanyEntity; import net.gepafin.tendermanagement.entities.UserActionEntity; import net.gepafin.tendermanagement.entities.UserEntity; @@ -175,19 +176,19 @@ public class DashboardDao { // Get applications per call List applicationsPerCall = applicationRepository.findApplicationsPerCallWithName(requestedUser.getHub().getId()); - stats.put("APPLICATION_PER_CALL", applicationsPerCall.stream().map(result -> { + stats.put(GepafinConstant.APPLICATION_PER_CALL, applicationsPerCall.stream().map(result -> { Map callData = new HashMap<>(); - callData.put("CALL", result[0]); // Call name - callData.put("APPLICATIONS", result[1]); // Application count + callData.put(GepafinConstant.CALL_NAME, result[0]); // Call name + callData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Application count return callData; }).toList()); // Get applications grouped by status List applicationsByStatus = applicationRepository.findApplicationsByStatus(requestedUser.getHub().getId()); - stats.put("APPLICATION_STATUSES", applicationsByStatus.stream().map(result -> { + stats.put(GepafinConstant.APPLICATION_PER_STATUS, applicationsByStatus.stream().map(result -> { Map statusData = new HashMap<>(); - statusData.put("STATUS", result[0]); // Application status - statusData.put("COUNT", result[1]); // Count of applications + statusData.put(GepafinConstant.STATUS, result[0]); // Application status + statusData.put(GepafinConstant.NUMBER_OF_APPLICATIONS, result[1]); // Count of applications return statusData; }).toList());