diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftRequest.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftRequest.kt new file mode 100644 index 00000000..0c1121a9 --- /dev/null +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftRequest.kt @@ -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 +) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftResponse.kt new file mode 100644 index 00000000..58f698a1 --- /dev/null +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/api/admin/gift/dto/AdminGiftResponse.kt @@ -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 + ) + } +}