Compare commits

..

No commits in common. "fa98138541289fd2df7ab23c3eeba1cff9362add" and "58d066af0a617d0bf14c4b58a04d3579cc9f3ab0" have entirely different histories.

1 changed files with 7 additions and 10 deletions

View File

@ -12,7 +12,8 @@ data class CreatePointRewardPolicyRequest(
val threshold: Int, val threshold: Int,
val pointAmount: Int, val pointAmount: Int,
val startDate: String, val startDate: String,
val endDate: String val endDate: String,
val isActive: Boolean
) { ) {
fun toEntity(): PointRewardPolicy { fun toEntity(): PointRewardPolicy {
val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm") val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
@ -26,15 +27,11 @@ data class CreatePointRewardPolicyRequest(
.atZone(ZoneId.of("Asia/Seoul")) .atZone(ZoneId.of("Asia/Seoul"))
.withZoneSameInstant(ZoneId.of("UTC")) .withZoneSameInstant(ZoneId.of("UTC"))
.toLocalDateTime(), .toLocalDateTime(),
endDate = if (endDate.isNotBlank()) { endDate = LocalDateTime.parse(endDate, dateTimeFormatter).withSecond(59)
LocalDateTime.parse(endDate, dateTimeFormatter).withSecond(59) .atZone(ZoneId.of("Asia/Seoul"))
.atZone(ZoneId.of("Asia/Seoul")) .withZoneSameInstant(ZoneId.of("UTC"))
.withZoneSameInstant(ZoneId.of("UTC")) .toLocalDateTime(),
.toLocalDateTime() isActive = isActive
} else {
null
},
isActive = true
) )
} }
} }