Skip to content

Commit

Permalink
fix: 🐛 dailyLogtime 계산 로직 수정
Browse files Browse the repository at this point in the history
logtime을 계산하는 중 하루의 데이터가 24시간을 넘는 데이터에 min을 적용하였습니다.

- close #408
  • Loading branch information
niamu01 committed Dec 24, 2023
1 parent 299c6d8 commit b3861a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/dailyLogtime/db/dailyLogtime.database.dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ConfigType } from '@nestjs/config';
import { InjectModel } from '@nestjs/mongoose';
import type { Model } from 'mongoose';
import { RUNTIME_CONFIG } from 'src/config/runtime';
import { DateWrapper } from 'src/dateWrapper/dateWrapper';
import type {
UserLogtimeRecordByDateRangeOutput,
UserLogtimeRecordsByDateRangeInput,
Expand Down Expand Up @@ -48,7 +49,7 @@ export class DailyLogtimeDaoImpl implements DailyLogtimeDao {
timezone: this.runtimeConfig.TIMEZONE,
},
},
value: { $sum: '$value' },
value: { $sum: { $min: ['$value', DateWrapper.DAY] } },
})
.sort({ _id: 1 })
.project({
Expand Down

0 comments on commit b3861a2

Please sign in to comment.