Compare commits
2 Commits
58d066af0a
...
fa98138541
Author | SHA1 | Date |
---|---|---|
|
fa98138541 | |
|
cb7917dc26 |
|
@ -12,8 +12,7 @@ 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")
|
||||||
|
@ -27,11 +26,15 @@ data class CreatePointRewardPolicyRequest(
|
||||||
.atZone(ZoneId.of("Asia/Seoul"))
|
.atZone(ZoneId.of("Asia/Seoul"))
|
||||||
.withZoneSameInstant(ZoneId.of("UTC"))
|
.withZoneSameInstant(ZoneId.of("UTC"))
|
||||||
.toLocalDateTime(),
|
.toLocalDateTime(),
|
||||||
endDate = LocalDateTime.parse(endDate, dateTimeFormatter).withSecond(59)
|
endDate = if (endDate.isNotBlank()) {
|
||||||
|
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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue