feat(gift): 선물 응답 시각을 UTC 문자열로 변환한다
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.admin.gift.dto
|
||||
|
||||
import kr.co.vividnext.sodalive.extensions.toUtcIso
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftCategoryResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftOperationStatusResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftSizePriceResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.domain.GiftStatus
|
||||
import java.time.LocalDateTime
|
||||
|
||||
data class AdminGiftCategoryResponse(
|
||||
val categoryId: Long,
|
||||
val classificationNumber: String,
|
||||
val categoryCode: String,
|
||||
val name: String,
|
||||
val receiptCode: String,
|
||||
val representativeItem: String,
|
||||
val requiresDamageWaiver: Boolean,
|
||||
val isActive: Boolean
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftCategoryResult) = AdminGiftCategoryResponse(
|
||||
categoryId = result.categoryId,
|
||||
classificationNumber = result.classificationNumber,
|
||||
categoryCode = result.categoryCode,
|
||||
name = result.name,
|
||||
receiptCode = result.receiptCode,
|
||||
representativeItem = result.representativeItem,
|
||||
requiresDamageWaiver = result.requiresDamageWaiver,
|
||||
isActive = result.isActive
|
||||
)
|
||||
@@ -46,14 +52,14 @@ data class AdminGiftOperationStatusResponse(
|
||||
val applicationNo: String,
|
||||
val status: GiftStatus,
|
||||
val statusName: String,
|
||||
val occurredAt: LocalDateTime
|
||||
val occurredAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftOperationStatusResult) = AdminGiftOperationStatusResponse(
|
||||
applicationNo = result.applicationNo,
|
||||
status = result.status,
|
||||
statusName = result.statusName,
|
||||
occurredAt = result.occurredAt
|
||||
occurredAt = result.occurredAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.gift.dto
|
||||
|
||||
import kr.co.vividnext.sodalive.extensions.toUtcIso
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftApplicationResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftCancellationResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftDeliveryConfirmationResult
|
||||
@@ -9,7 +10,6 @@ import kr.co.vividnext.sodalive.v2.gift.application.GiftListResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftRecipientAddressRegistrationResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftReviewResult
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftTrackingRegistrationResult
|
||||
import java.time.LocalDateTime
|
||||
|
||||
data class GiftFormOptionsResponse(
|
||||
val sizes: List<GiftSizeOptionResponse>,
|
||||
@@ -59,7 +59,7 @@ data class GiftListResponse(
|
||||
priceCan = it.priceCan,
|
||||
categoryName = it.categoryName,
|
||||
sizeName = it.sizeName,
|
||||
createdAt = it.createdAt
|
||||
createdAt = it.createdAt?.toUtcIso()
|
||||
)
|
||||
},
|
||||
page = result.page,
|
||||
@@ -77,7 +77,7 @@ data class GiftListItemResponse(
|
||||
val priceCan: Int,
|
||||
val categoryName: String,
|
||||
val sizeName: String,
|
||||
val createdAt: LocalDateTime?
|
||||
val createdAt: String?
|
||||
)
|
||||
|
||||
data class GiftDetailResponse(
|
||||
@@ -91,7 +91,7 @@ data class GiftDetailResponse(
|
||||
val mailbox: GiftMailboxResponse?,
|
||||
val trackingRequired: Boolean,
|
||||
val recipientAddressRequired: Boolean,
|
||||
val recipientAddressDeadlineAt: LocalDateTime?,
|
||||
val recipientAddressDeadlineAt: String?,
|
||||
val delivery: GiftDeliveryInfoResponse,
|
||||
val statusTimeline: List<GiftStatusTimelineResponse>
|
||||
) {
|
||||
@@ -109,21 +109,21 @@ data class GiftDetailResponse(
|
||||
applicationNo = result.giftInfo.applicationNo,
|
||||
paidCan = result.giftInfo.paidCan,
|
||||
tracking = result.giftInfo.tracking,
|
||||
shippingRequestedAt = result.giftInfo.shippingRequestedAt
|
||||
shippingRequestedAt = result.giftInfo.shippingRequestedAt?.toUtcIso()
|
||||
),
|
||||
senderInfo = result.senderInfo?.let { GiftAddressResponse(it.name, it.phoneNumber, it.address) },
|
||||
recipientAddress = result.recipientAddress?.let { GiftAddressResponse(it.name, it.phoneNumber, it.address) },
|
||||
mailbox = result.mailbox?.let { GiftMailboxResponse(it.name, it.address, it.phoneNumber) },
|
||||
trackingRequired = result.trackingRequired,
|
||||
recipientAddressRequired = result.recipientAddressRequired,
|
||||
recipientAddressDeadlineAt = result.recipientAddressDeadlineAt,
|
||||
recipientAddressDeadlineAt = result.recipientAddressDeadlineAt?.toUtcIso(),
|
||||
delivery = GiftDeliveryInfoResponse(
|
||||
canceledAt = result.delivery.canceledAt,
|
||||
undeliverableAt = result.delivery.undeliverableAt,
|
||||
canceledAt = result.delivery.canceledAt?.toUtcIso(),
|
||||
undeliverableAt = result.delivery.undeliverableAt?.toUtcIso(),
|
||||
undeliverableReason = result.delivery.undeliverableReason
|
||||
),
|
||||
statusTimeline = result.statusTimeline.map {
|
||||
GiftStatusTimelineResponse(it.status.name, it.statusName, it.occurredAt)
|
||||
GiftStatusTimelineResponse(it.status.name, it.statusName, it.occurredAt?.toUtcIso())
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -137,7 +137,7 @@ data class GiftDetailInfoResponse(
|
||||
val applicationNo: String?,
|
||||
val paidCan: Int?,
|
||||
val tracking: String?,
|
||||
val shippingRequestedAt: LocalDateTime?
|
||||
val shippingRequestedAt: String?
|
||||
)
|
||||
|
||||
data class GiftAddressResponse(
|
||||
@@ -153,15 +153,15 @@ data class GiftMailboxResponse(
|
||||
)
|
||||
|
||||
data class GiftDeliveryInfoResponse(
|
||||
val canceledAt: LocalDateTime?,
|
||||
val undeliverableAt: LocalDateTime?,
|
||||
val canceledAt: String?,
|
||||
val undeliverableAt: String?,
|
||||
val undeliverableReason: String?
|
||||
)
|
||||
|
||||
data class GiftStatusTimelineResponse(
|
||||
val status: String,
|
||||
val statusName: String,
|
||||
val occurredAt: LocalDateTime?
|
||||
val occurredAt: String?
|
||||
)
|
||||
|
||||
data class GiftApplicationResponse(
|
||||
@@ -169,7 +169,7 @@ data class GiftApplicationResponse(
|
||||
val status: String,
|
||||
val statusName: String,
|
||||
val priceCan: Int,
|
||||
val trackingDeadlineAt: LocalDateTime
|
||||
val trackingDeadlineAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftApplicationResult) = GiftApplicationResponse(
|
||||
@@ -177,7 +177,7 @@ data class GiftApplicationResponse(
|
||||
status = result.status.name,
|
||||
statusName = result.statusName,
|
||||
priceCan = result.priceCan,
|
||||
trackingDeadlineAt = result.trackingDeadlineAt
|
||||
trackingDeadlineAt = result.trackingDeadlineAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ data class GiftCancellationResponse(
|
||||
val status: String,
|
||||
val statusName: String,
|
||||
val priceCan: Int,
|
||||
val canceledAt: LocalDateTime
|
||||
val canceledAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftCancellationResult) = GiftCancellationResponse(
|
||||
@@ -195,7 +195,7 @@ data class GiftCancellationResponse(
|
||||
status = result.status.name,
|
||||
statusName = result.statusName,
|
||||
priceCan = result.priceCan,
|
||||
canceledAt = result.canceledAt
|
||||
canceledAt = result.canceledAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -206,8 +206,8 @@ data class GiftTrackingRegistrationResponse(
|
||||
val statusName: String,
|
||||
val courierCompanyName: String,
|
||||
val trackingNumber: String,
|
||||
val trackingRegisteredAt: LocalDateTime,
|
||||
val recipientAddressDeadlineAt: LocalDateTime
|
||||
val trackingRegisteredAt: String,
|
||||
val recipientAddressDeadlineAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftTrackingRegistrationResult) = GiftTrackingRegistrationResponse(
|
||||
@@ -216,8 +216,8 @@ data class GiftTrackingRegistrationResponse(
|
||||
statusName = result.statusName,
|
||||
courierCompanyName = result.courierCompanyName,
|
||||
trackingNumber = result.trackingNumber,
|
||||
trackingRegisteredAt = result.trackingRegisteredAt,
|
||||
recipientAddressDeadlineAt = result.recipientAddressDeadlineAt
|
||||
trackingRegisteredAt = result.trackingRegisteredAt.toUtcIso(),
|
||||
recipientAddressDeadlineAt = result.recipientAddressDeadlineAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -226,14 +226,14 @@ data class GiftRecipientAddressRegistrationResponse(
|
||||
val applicationNo: String,
|
||||
val status: String,
|
||||
val statusName: String,
|
||||
val recipientAddressRegisteredAt: LocalDateTime
|
||||
val recipientAddressRegisteredAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftRecipientAddressRegistrationResult) = GiftRecipientAddressRegistrationResponse(
|
||||
applicationNo = result.applicationNo,
|
||||
status = result.status.name,
|
||||
statusName = result.statusName,
|
||||
recipientAddressRegisteredAt = result.recipientAddressRegisteredAt
|
||||
recipientAddressRegisteredAt = result.recipientAddressRegisteredAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -242,14 +242,14 @@ data class GiftDeliveryConfirmationResponse(
|
||||
val applicationNo: String,
|
||||
val status: String,
|
||||
val statusName: String,
|
||||
val deliveredAt: LocalDateTime
|
||||
val deliveredAt: String
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftDeliveryConfirmationResult) = GiftDeliveryConfirmationResponse(
|
||||
applicationNo = result.applicationNo,
|
||||
status = result.status.name,
|
||||
statusName = result.statusName,
|
||||
deliveredAt = result.deliveredAt
|
||||
deliveredAt = result.deliveredAt.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -260,7 +260,7 @@ data class GiftReviewResponse(
|
||||
val rating: Int,
|
||||
val keywords: List<String>,
|
||||
val comment: String?,
|
||||
val createdAt: LocalDateTime?
|
||||
val createdAt: String?
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftReviewResult) = GiftReviewResponse(
|
||||
@@ -269,7 +269,7 @@ data class GiftReviewResponse(
|
||||
rating = result.rating,
|
||||
keywords = result.keywords,
|
||||
comment = result.comment,
|
||||
createdAt = result.createdAt
|
||||
createdAt = result.createdAt?.toUtcIso()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user