fix(channel-donation): 기부 목록 조회 월 범위를 한국 시간 기준으로 계산한다

This commit is contained in:
2026-03-03 11:11:30 +09:00
parent 3e4e23eb73
commit de8917b312
2 changed files with 29 additions and 2 deletions

View File

@@ -11,7 +11,8 @@ import kr.co.vividnext.sodalive.member.MemberRole
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.time.LocalDate
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.time.temporal.TemporalAdjusters
@@ -62,8 +63,11 @@ class ChannelDonationService(
memberRepository.findCreatorByIdOrNull(creatorId)
?: throw SodaException(messageKey = "member.validation.creator_not_found")
val startDateTime = LocalDate.now()
val kstZoneId = ZoneId.of("Asia/Seoul")
val nowKst = ZonedDateTime.now(kstZoneId)
val startDateTime = nowKst
.with(TemporalAdjusters.firstDayOfMonth())
.toLocalDate()
.atStartOfDay()
val endDateTime = startDateTime.plusMonths(1)
val isCreator = member.role == MemberRole.CREATOR && creatorId == member.id