dev add statistic complaints by status
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-25 12:57:22 +07:00
parent 670f14e955
commit 6929060661
2 changed files with 5 additions and 5 deletions
@@ -34,7 +34,7 @@ public interface ComplaintEntityRepository extends JpaRepository<ComplaintEntity
Long getTotalComplaintsCount();
@Query("SELECT COUNT(c.id) FROM ComplaintEntity c WHERE c.status = :status")
Long getTotalComplaintsCountByStatus(@Param("status")String status);
Long getTotalComplaintsCountByStatus(@Param("status")ComplaintStatus status);
@Query("""
SELECT COUNT(c.id)
@@ -16,10 +16,10 @@ public class ComplaintStatisticService {
return ComplaintStatisticResponse.builder()
.totalComplaints(complaintEntityRepository.getTotalComplaintsCount())
.totalCancelled(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CANCELLED.name()))
.totalCreated(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CREATED.name()))
.totalCompleted(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.COMPLETED.name()))
.totalInWork(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.IN_WORK.name()))
.totalCancelled(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CANCELLED))
.totalCreated(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.CREATED))
.totalCompleted(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.COMPLETED))
.totalInWork(complaintEntityRepository.getTotalComplaintsCountByStatus(ComplaintStatus.IN_WORK))
.build();
}
}