From e7df8a7d455de5b074f27c360b377bb305ce29ef Mon Sep 17 00:00:00 2001 From: JunHyoung Lim <109949924+toychip@users.noreply.github.com> Date: Sat, 17 Aug 2024 21:23:18 +0900 Subject: [PATCH] fix: pick detail field UNKNOWN to null (#106) pickId, pickerId, pickerGender, pickerPlatform, pickerSecondInitialName, pickerFullName --- .../kotlin/com/mashup/dojo/PickController.kt | 7 ++++-- .../kotlin/com/mashup/dojo/dto/PickDto.kt | 12 +++++----- .../mashup/dojo/service/DefaultPickService.kt | 24 +++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/api/src/main/kotlin/com/mashup/dojo/PickController.kt b/api/src/main/kotlin/com/mashup/dojo/PickController.kt index b64e7891..95c16c65 100644 --- a/api/src/main/kotlin/com/mashup/dojo/PickController.kt +++ b/api/src/main/kotlin/com/mashup/dojo/PickController.kt @@ -119,11 +119,14 @@ class PickController( val pickDetails = pickDetailPaging.picks.map { + val pickId = if (it.pickId.value == "UNKNOWN") null else it.pickId + val pickerId = if (it.pickerId.value == "UNKNOWN") null else it.pickId + ReceivedPickDetail( - pickId = it.pickId, + pickId = pickId, pickerOrdinal = it.pickerOrdinal, pickerIdOpen = it.pickerIdOpen, - pickerId = it.pickerId, + pickerId = pickerId, pickerGenderOpen = it.pickerGenderOpen, pickerGender = it.pickerGender, pickerPlatformOpen = it.pickerPlatformOpen, diff --git a/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt b/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt index cf8ee747..69756a1c 100644 --- a/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt +++ b/api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt @@ -61,18 +61,18 @@ data class PickDetailPaging( ) data class ReceivedPickDetail( - val pickId: PickId, + val pickId: PickId?, val pickerOrdinal: Int, val pickerIdOpen: Boolean, - val pickerId: MemberId, + val pickerId: PickId?, val pickerGenderOpen: Boolean, - val pickerGender: MemberGender, + val pickerGender: MemberGender?, val pickerPlatformOpen: Boolean, - val pickerPlatform: MemberPlatform, + val pickerPlatform: MemberPlatform?, val pickerSecondInitialNameOpen: Boolean, - val pickerSecondInitialName: String, + val pickerSecondInitialName: String?, val pickerFullNameOpen: Boolean, - val pickerFullName: String, + val pickerFullName: String?, val latestPickedAt: LocalDateTime, ) diff --git a/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt b/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt index b1aada79..1a3084ac 100644 --- a/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt +++ b/service/src/main/kotlin/com/mashup/dojo/service/DefaultPickService.kt @@ -104,13 +104,13 @@ interface PickService { val pickerIdOpen: Boolean, val pickerId: MemberId, val pickerGenderOpen: Boolean, - val pickerGender: MemberGender, + val pickerGender: MemberGender?, val pickerPlatformOpen: Boolean, - val pickerPlatform: MemberPlatform, + val pickerPlatform: MemberPlatform?, val pickerSecondInitialNameOpen: Boolean, - val pickerSecondInitialName: String, + val pickerSecondInitialName: String?, val pickerFullNameOpen: Boolean, - val pickerFullName: String, + val pickerFullName: String?, val latestPickedAt: LocalDateTime, ) @@ -288,41 +288,41 @@ class DefaultPickService( fun transformPickerGender( isOpen: Boolean, pickerGender: MemberGender, - ): MemberGender { + ): MemberGender? { if (isOpen) { return pickerGender } - return MemberGender.UNKNOWN + return null } fun transformPickerPlatform( isOpen: Boolean, pickerPlatform: MemberPlatform, - ): MemberPlatform { + ): MemberPlatform? { if (isOpen) { return pickerPlatform } - return MemberPlatform.UNKNOWN + return null } fun transformPickerSecondInitialName( isOpen: Boolean, secondInitialName: String, - ): String { + ): String? { if (isOpen) { return secondInitialName } - return UNKNOWN + return null } fun transformPickerFullName( isOpen: Boolean, fullName: String, - ): String { + ): String? { if (isOpen) { return fullName } - return UNKNOWN + return null } override fun getPickCount(