From 616171c23bacef30bcd9c8610330e7a73f98f4bf Mon Sep 17 00:00:00 2001 From: Cavin Date: Wed, 1 Jul 2026 18:12:21 +0300 Subject: [PATCH] ref: zone and dashboard services --- Dockerfile => backend/Dockerfile | 0 .../io/github/devcavin/backend/service/DashboardService.kt | 4 ++-- .../kotlin/io/github/devcavin/backend/service/ZoneService.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename Dockerfile => backend/Dockerfile (100%) diff --git a/Dockerfile b/backend/Dockerfile similarity index 100% rename from Dockerfile rename to backend/Dockerfile diff --git a/backend/src/main/kotlin/io/github/devcavin/backend/service/DashboardService.kt b/backend/src/main/kotlin/io/github/devcavin/backend/service/DashboardService.kt index a99df41..a1f091a 100644 --- a/backend/src/main/kotlin/io/github/devcavin/backend/service/DashboardService.kt +++ b/backend/src/main/kotlin/io/github/devcavin/backend/service/DashboardService.kt @@ -63,7 +63,7 @@ class DashboardService( siteId = siteId, visitStatus = checkedInStatus, pageable = PageRequest.of(0, 10, - Sort.by(Sort.Direction.DESC, "checkoutTime")) + Sort.by(Sort.Direction.DESC, "checkInTime")) ).content.map { it.toResponse() } val overdueVisitors = visitorRepository.findAllOverdue( @@ -75,7 +75,7 @@ class DashboardService( siteId = siteId, visitStatus = checkedOutStatus, pageable = PageRequest.of(0, 10, - Sort.by(Sort.Direction.DESC, "checkoutTime")) + Sort.by(Sort.Direction.DESC, "checkOutTime")) ).content.map { it.toResponse() } return DashboardFeed( diff --git a/backend/src/main/kotlin/io/github/devcavin/backend/service/ZoneService.kt b/backend/src/main/kotlin/io/github/devcavin/backend/service/ZoneService.kt index 107db4c..0e9da3b 100644 --- a/backend/src/main/kotlin/io/github/devcavin/backend/service/ZoneService.kt +++ b/backend/src/main/kotlin/io/github/devcavin/backend/service/ZoneService.kt @@ -22,7 +22,7 @@ class ZoneService( val site = siteRepository.findById(siteId) .orElseThrow { ResourceNotFoundException("Site", siteId) } - if (!zoneRepository.existsBySiteIdAndName(siteId, request.name)) { + if (zoneRepository.existsBySiteIdAndName(siteId, request.name)) { throw ConflictException("Zone with this name already exists under this site") }