Skip to content

Commit

Permalink
Fix: 활동요약에서 저번주 평균값이 이번주 평균값으로 나오는 버그 수정 (#287)
Browse files Browse the repository at this point in the history
* Fix: 활동요약에서 저번주 평균값을 조회할 때 날짜가 이번주로 되어있던 버그를 수정

* Test: 저번주 평균값을 조회할 때 날짜가 이번주로 되어있던 버그를 수정에 대한 테스트 코드 수정
  • Loading branch information
hee9841 authored Oct 28, 2024
1 parent d6173c5 commit 0312d42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ public RunningRecordWeeklySummaryResponse getWeeklySummary(
weekSummaries = runningRecordRepository.findDailyDistancesMeterByDateRange(
memberId, startWeekDate, nextOfEndWeekDate);
avgValue = runningRecordRepository.findAvgDistanceMeterByMemberIdAndDateRange(
memberId, startWeekDate, nextOfEndWeekDate);
memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7));
conversionFactor = METERS_IN_A_KILOMETER;
} else {
weekSummaries = runningRecordRepository.findDailyDurationsSecByDateRange(
memberId, startWeekDate, nextOfEndWeekDate);
avgValue = runningRecordRepository.findAvgDurationSecByMemberIdAndDateRange(
memberId, startWeekDate, nextOfEndWeekDate);
memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7));
conversionFactor = SECONDS_PER_HOUR;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void getWeeklySummary_Distance() {
.willReturn(List.of(new DailyRunningRecordSummary(runningDate.toLocalDate(), 3567)));

given(runningRecordRepository.findAvgDistanceMeterByMemberIdAndDateRange(
memberId, startWeekDate, nextOfEndWeekDate))
memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7)))
.willReturn(800);

// when
Expand Down Expand Up @@ -505,7 +505,7 @@ void getWeeklySummary_Duration() {
.willReturn(List.of(new DailyRunningRecordSummary(runningDate.toLocalDate(), runningDurationSec)));

given(runningRecordRepository.findAvgDurationSecByMemberIdAndDateRange(
memberId, startWeekDate, nextOfEndWeekDate))
memberId, startWeekDate.minusDays(7), nextOfEndWeekDate.minusDays(7)))
.willReturn(runningDurationSec);

// when
Expand Down

0 comments on commit 0312d42

Please sign in to comment.