fix(channel-donation): 후원 조회 월 경계를 UTC 전달 기준으로 보정한다

This commit is contained in:
2026-03-03 12:07:23 +09:00
parent de8917b312
commit ad872923ee
3 changed files with 63 additions and 12 deletions

View File

@@ -63,13 +63,23 @@ class ChannelDonationService(
memberRepository.findCreatorByIdOrNull(creatorId)
?: throw SodaException(messageKey = "member.validation.creator_not_found")
val utcZoneId = ZoneId.of("UTC")
val kstZoneId = ZoneId.of("Asia/Seoul")
val nowKst = ZonedDateTime.now(kstZoneId)
val startDateTime = nowKst
val nowUtc = ZonedDateTime.now(utcZoneId)
val nowKst = nowUtc.withZoneSameInstant(kstZoneId)
val startDateTimeKst = nowKst
.with(TemporalAdjusters.firstDayOfMonth())
.toLocalDate()
.atStartOfDay()
val endDateTime = startDateTime.plusMonths(1)
.atStartOfDay(kstZoneId)
val endDateTimeKst = startDateTimeKst.plusMonths(1)
val startDateTime = startDateTimeKst
.withZoneSameInstant(utcZoneId)
.toLocalDateTime()
val endDateTime = endDateTimeKst
.withZoneSameInstant(utcZoneId)
.toLocalDateTime()
val isCreator = member.role == MemberRole.CREATOR && creatorId == member.id
val totalCount = channelDonationMessageRepository.getChannelDonationMessageTotalCount(