Skip to content

Commit 05f876d

Browse files
authored
Merge pull request #137 from PinHouse/fix/#134
fix/feat: 시외 대중교통 경로, 도보 거리, 청약진단, 어드민 링크, 라벨 개선 (#136)
2 parents 5575bfd + 883dde1 commit 05f876d

26 files changed

Lines changed: 962 additions & 58 deletions

File tree

module-domain/src/main/java/co/kr/pinhouse/domain/ad/domain/repository/AdvertisementEventRepository.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package co.kr.pinhouse.domain.ad.domain.repository;
22

3+
import java.time.LocalDateTime;
4+
35
import org.springframework.data.jpa.repository.JpaRepository;
46

57
import co.kr.pinhouse.domain.ad.domain.entity.AdvertisementEvent;
@@ -8,4 +10,6 @@
810
public interface AdvertisementEventRepository extends JpaRepository<AdvertisementEvent, Long> {
911

1012
long countByAdvertisement_IdAndEventType(Long advertisementId, AdvertisementEventType eventType);
13+
14+
long countByEventTypeAndOccurredAtBetween(AdvertisementEventType eventType, LocalDateTime from, LocalDateTime to);
1115
}

module-domain/src/main/java/co/kr/pinhouse/domain/ad/domain/repository/AdvertisementRepository.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package co.kr.pinhouse.domain.ad.domain.repository;
22

3+
import java.time.LocalDateTime;
34
import java.util.List;
45

56
import org.springframework.data.domain.Page;
@@ -18,4 +19,12 @@ List<Advertisement> findByPlacementAndStatusOrderByPriorityDescIdDesc(
1819
AdvertisementPlacement placement,
1920
AdvertisementStatus status
2021
);
22+
23+
List<Advertisement> findByStatus(AdvertisementStatus status);
24+
25+
long countByStatus(AdvertisementStatus status);
26+
27+
long countByStatusAndCreatedAtBetween(AdvertisementStatus status, LocalDateTime from, LocalDateTime to);
28+
29+
List<Advertisement> findByStatusAndEndAtBetween(AdvertisementStatus status, LocalDateTime from, LocalDateTime to);
2130
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package co.kr.pinhouse.domain.admin.dashboard.application.dto.response;
2+
3+
import java.math.BigDecimal;
4+
import java.time.LocalDate;
5+
import java.time.OffsetDateTime;
6+
import java.util.List;
7+
8+
import lombok.Builder;
9+
10+
@Builder
11+
public record AdminDashboardResponse(
12+
OffsetDateTime asOf,
13+
String timezone,
14+
StatCards statCards,
15+
TodayBrief todayBrief,
16+
List<RecentCsItem> recentCs,
17+
List<WeeklyTrendPoint> weeklyTrend,
18+
Checkpoints checkpoints
19+
) {
20+
21+
public record StatCards(
22+
DashboardMetric totalUsers,
23+
DashboardMetric csInquiries,
24+
DashboardMetric activeAdvertisements,
25+
DashboardMetric monthlyDiagnoses
26+
) {
27+
}
28+
29+
public record DashboardMetric(
30+
long value,
31+
Long deltaValue,
32+
BigDecimal deltaPercent,
33+
String comparisonLabel,
34+
BigDecimal subValue,
35+
String subLabel
36+
) {
37+
}
38+
39+
public record TodayBrief(
40+
long urgentCsCount,
41+
int urgentCsThresholdMinutes,
42+
long newUsersToday,
43+
long newUsersDeltaFromYesterday,
44+
long diagnosesCompletedToday,
45+
BigDecimal diagnosisCompletionRateToday
46+
) {
47+
}
48+
49+
public record RecentCsItem(
50+
Long inquiryId,
51+
String title,
52+
String requesterMaskedName,
53+
String status,
54+
OffsetDateTime createdAt,
55+
OffsetDateTime lastMessageAt,
56+
String assignedAdminName
57+
) {
58+
}
59+
60+
public record WeeklyTrendPoint(
61+
LocalDate date,
62+
long newUsers,
63+
long csInquiries,
64+
long diagnosesCompleted,
65+
long adClicks
66+
) {
67+
}
68+
69+
public record Checkpoints(
70+
long delayedCsCount,
71+
long adsEndingSoonCount,
72+
long newVisibleNoticesToday,
73+
long noticesMissingActualLinkCount
74+
) {
75+
}
76+
}

0 commit comments

Comments
 (0)