Compare commits
2 Commits
58d066af0a
...
fa98138541
| Author | SHA1 | Date | |
|---|---|---|---|
| fa98138541 | |||
| cb7917dc26 |
@@ -12,8 +12,7 @@ data class CreatePointRewardPolicyRequest(
|
||||
val threshold: Int,
|
||||
val pointAmount: Int,
|
||||
val startDate: String,
|
||||
val endDate: String,
|
||||
val isActive: Boolean
|
||||
val endDate: String
|
||||
) {
|
||||
fun toEntity(): PointRewardPolicy {
|
||||
val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
|
||||
@@ -27,11 +26,15 @@ data class CreatePointRewardPolicyRequest(
|
||||
.atZone(ZoneId.of("Asia/Seoul"))
|
||||
.withZoneSameInstant(ZoneId.of("UTC"))
|
||||
.toLocalDateTime(),
|
||||
endDate = LocalDateTime.parse(endDate, dateTimeFormatter).withSecond(59)
|
||||
.atZone(ZoneId.of("Asia/Seoul"))
|
||||
.withZoneSameInstant(ZoneId.of("UTC"))
|
||||
.toLocalDateTime(),
|
||||
isActive = isActive
|
||||
endDate = if (endDate.isNotBlank()) {
|
||||
LocalDateTime.parse(endDate, dateTimeFormatter).withSecond(59)
|
||||
.atZone(ZoneId.of("Asia/Seoul"))
|
||||
.withZoneSameInstant(ZoneId.of("UTC"))
|
||||
.toLocalDateTime()
|
||||
} else {
|
||||
null
|
||||
},
|
||||
isActive = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user