feat(gift): 선물 관리자 DTO를 추가한다
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.admin.gift.dto
|
||||
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftCategoryCommand
|
||||
import kr.co.vividnext.sodalive.v2.gift.application.GiftSizePriceCommand
|
||||
|
||||
data class AdminGiftCategoryRequest(
|
||||
val categoryCode: String,
|
||||
val name: String,
|
||||
val requiresDamageWaiver: Boolean,
|
||||
val isActive: Boolean
|
||||
) {
|
||||
fun toCommand() = GiftCategoryCommand(
|
||||
categoryCode = categoryCode,
|
||||
name = name,
|
||||
requiresDamageWaiver = requiresDamageWaiver,
|
||||
isActive = isActive
|
||||
)
|
||||
}
|
||||
|
||||
data class AdminGiftSizePriceRequest(
|
||||
val basePriceCan: Int,
|
||||
val salePriceCan: Int,
|
||||
val isActive: Boolean
|
||||
) {
|
||||
fun toCommand() = GiftSizePriceCommand(
|
||||
basePriceCan = basePriceCan,
|
||||
salePriceCan = salePriceCan,
|
||||
isActive = isActive
|
||||
)
|
||||
}
|
||||
|
||||
data class AdminGiftMarkUndeliverableRequest(
|
||||
val reason: String
|
||||
)
|
||||
@@ -0,0 +1,59 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.admin.gift.dto
|
||||
|
||||
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 categoryCode: String,
|
||||
val name: String,
|
||||
val requiresDamageWaiver: Boolean,
|
||||
val isActive: Boolean
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftCategoryResult) = AdminGiftCategoryResponse(
|
||||
categoryId = result.categoryId,
|
||||
categoryCode = result.categoryCode,
|
||||
name = result.name,
|
||||
requiresDamageWaiver = result.requiresDamageWaiver,
|
||||
isActive = result.isActive
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
data class AdminGiftSizePriceResponse(
|
||||
val sizeCode: String,
|
||||
val name: String,
|
||||
val basePriceCan: Int,
|
||||
val salePriceCan: Int,
|
||||
val isActive: Boolean
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftSizePriceResult) = AdminGiftSizePriceResponse(
|
||||
sizeCode = result.sizeCode.name,
|
||||
name = result.sizeName,
|
||||
basePriceCan = result.basePriceCan,
|
||||
salePriceCan = result.salePriceCan,
|
||||
isActive = result.isActive
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
data class AdminGiftOperationStatusResponse(
|
||||
val applicationNo: String,
|
||||
val status: GiftStatus,
|
||||
val statusName: String,
|
||||
val occurredAt: LocalDateTime
|
||||
) {
|
||||
companion object {
|
||||
fun from(result: GiftOperationStatusResult) = AdminGiftOperationStatusResponse(
|
||||
applicationNo = result.applicationNo,
|
||||
status = result.status,
|
||||
statusName = result.statusName,
|
||||
occurredAt = result.occurredAt
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user