Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package co.kr.pinhouse.domain.ad.domain.repository;

import java.time.LocalDateTime;

import org.springframework.data.jpa.repository.JpaRepository;

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

long countByAdvertisement_IdAndEventType(Long advertisementId, AdvertisementEventType eventType);

long countByEventTypeAndOccurredAtBetween(AdvertisementEventType eventType, LocalDateTime from, LocalDateTime to);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package co.kr.pinhouse.domain.ad.domain.repository;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.data.domain.Page;
Expand All @@ -18,4 +19,12 @@ List<Advertisement> findByPlacementAndStatusOrderByPriorityDescIdDesc(
AdvertisementPlacement placement,
AdvertisementStatus status
);

List<Advertisement> findByStatus(AdvertisementStatus status);

long countByStatus(AdvertisementStatus status);

long countByStatusAndCreatedAtBetween(AdvertisementStatus status, LocalDateTime from, LocalDateTime to);

List<Advertisement> findByStatusAndEndAtBetween(AdvertisementStatus status, LocalDateTime from, LocalDateTime to);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package co.kr.pinhouse.domain.admin.dashboard.application.dto.response;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.List;

import lombok.Builder;

@Builder
public record AdminDashboardResponse(
OffsetDateTime asOf,
String timezone,
StatCards statCards,
TodayBrief todayBrief,
List<RecentCsItem> recentCs,
List<WeeklyTrendPoint> weeklyTrend,
Checkpoints checkpoints
) {

public record StatCards(
DashboardMetric totalUsers,
DashboardMetric csInquiries,
DashboardMetric activeAdvertisements,
DashboardMetric monthlyDiagnoses
) {
}

public record DashboardMetric(
long value,
Long deltaValue,
BigDecimal deltaPercent,
String comparisonLabel,
BigDecimal subValue,
String subLabel
) {
}

public record TodayBrief(
long urgentCsCount,
int urgentCsThresholdMinutes,
long newUsersToday,
long newUsersDeltaFromYesterday,
long diagnosesCompletedToday,
BigDecimal diagnosisCompletionRateToday
) {
}

public record RecentCsItem(
Long inquiryId,
String title,
String requesterMaskedName,
String status,
OffsetDateTime createdAt,
OffsetDateTime lastMessageAt,
String assignedAdminName
) {
}

public record WeeklyTrendPoint(
LocalDate date,
long newUsers,
long csInquiries,
long diagnosesCompleted,
long adClicks
) {
}

public record Checkpoints(
long delayedCsCount,
long adsEndingSoonCount,
long newVisibleNoticesToday,
long noticesMissingActualLinkCount
) {
}
}
Loading
Loading