From 3d81e44fa77169bc41ca52afe59d094d4a8ed57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=84=ED=81=AC?= <37167652+re4rk@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:18:44 +0900 Subject: [PATCH] =?UTF-8?q?[AN/USER]=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=20=ED=9B=84=20=EB=82=A8=EC=95=84=EC=9E=88=EB=8A=94=20?= =?UTF-8?q?ui=20model=20=EB=AA=A8=EB=91=90=20=EC=A0=9C=EA=B1=B0=20(#421)?= =?UTF-8?q?=20(#422)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 티켓 코드 uiModel 제거 * refactor: 티켓 ui model 제거 * refactor: 유저 정보 ui model 제거 * refactor: 스테이지 ui model 제거 * refactor: 예약 ui model 제거 --- .../presentation/mapper/ReservationMapper.kt | 0 .../mapper/ReservationTicketMapper.kt | 18 ------------------ .../presentation/mapper/StageMapper.kt | 14 -------------- .../presentation/mapper/TicketCodeMapper.kt | 8 -------- .../presentation/mapper/TicketMapper.kt | 19 ------------------- .../presentation/mapper/TicketStateMapper.kt | 18 ------------------ .../presentation/mapper/UserProfileMapper.kt | 10 ---------- .../model/ReservationTicketUiModel.kt | 12 ------------ .../presentation/model/StageUiModel.kt | 8 -------- .../presentation/model/TicketCodeUiModel.kt | 10 ---------- .../model/TicketConditionUiModel.kt | 11 ----------- .../presentation/model/TicketUiModel.kt | 15 --------------- .../presentation/model/UserProfileUiModel.kt | 7 ------- .../ui/ticketentry/TicketEntryActivity.kt | 3 +-- 14 files changed, 1 insertion(+), 152 deletions(-) delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationTicketMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/StageMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketCodeMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketStateMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/mapper/UserProfileMapper.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/ReservationTicketUiModel.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/StageUiModel.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketCodeUiModel.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketConditionUiModel.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketUiModel.kt delete mode 100644 android/festago/app/src/main/java/com/festago/festago/presentation/model/UserProfileUiModel.kt diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationMapper.kt deleted file mode 100644 index e69de29bb..000000000 diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationTicketMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationTicketMapper.kt deleted file mode 100644 index 4f17bb0f2..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/ReservationTicketMapper.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.ReservationTicket -import com.festago.festago.presentation.model.ReservationTicketUiModel - -fun ReservationTicket.toPresentation() = ReservationTicketUiModel( - id = id, - remainAmount = remainAmount, - ticketType = ticketType, - totalAmount = totalAmount, -) - -fun ReservationTicketUiModel.toDomain() = ReservationTicket( - id = id, - remainAmount = remainAmount, - ticketType = ticketType, - totalAmount = totalAmount, -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/StageMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/StageMapper.kt deleted file mode 100644 index f6ca17e9b..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/StageMapper.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.Stage -import com.festago.festago.presentation.model.StageUiModel - -fun Stage.toPresentation() = StageUiModel( - id = id, - startTime = startTime, -) - -fun StageUiModel.toDomain() = Stage( - id = id, - startTime = startTime, -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketCodeMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketCodeMapper.kt deleted file mode 100644 index 56117dafd..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketCodeMapper.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.TicketCode -import com.festago.festago.presentation.model.TicketCodeUiModel - -fun TicketCode.toPresentation(): TicketCodeUiModel = TicketCodeUiModel(code = code, period = period) - -fun TicketCodeUiModel.toDomain(): TicketCode = TicketCode(code = code, period = period) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketMapper.kt deleted file mode 100644 index 9c8506a44..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketMapper.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.Ticket -import com.festago.festago.presentation.model.TicketUiModel - -fun Ticket.toPresentation(): TicketUiModel = TicketUiModel( - id = id, - number = number, - entryTime = entryTime, - condition = condition.toPresentation(), - stage = stage.toPresentation(), - reserveAt = reserveAt, - festivalId = festivalTicket.id, - festivalName = festivalTicket.name, - festivalThumbnail = festivalTicket.thumbnail, -) - -fun List.toPresentation(): List = - this.map { ticket -> ticket.toPresentation() } diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketStateMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketStateMapper.kt deleted file mode 100644 index c74b34fd7..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/TicketStateMapper.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.TicketCondition -import com.festago.festago.presentation.model.TicketConditionUiModel - -fun TicketCondition.toPresentation(): TicketConditionUiModel = - when (this) { - TicketCondition.BEFORE_ENTRY -> TicketConditionUiModel.BEFORE_ENTRY - TicketCondition.AFTER_ENTRY -> TicketConditionUiModel.AFTER_ENTRY - TicketCondition.AWAY -> TicketConditionUiModel.AWAY - } - -fun TicketConditionUiModel.toDomain(): TicketCondition = - when (this) { - TicketConditionUiModel.BEFORE_ENTRY -> TicketCondition.BEFORE_ENTRY - TicketConditionUiModel.AFTER_ENTRY -> TicketCondition.AFTER_ENTRY - TicketConditionUiModel.AWAY -> TicketCondition.AWAY - } diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/UserProfileMapper.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/UserProfileMapper.kt deleted file mode 100644 index a959a0af5..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/mapper/UserProfileMapper.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.festago.festago.presentation.mapper - -import com.festago.festago.model.UserProfile -import com.festago.festago.presentation.model.UserProfileUiModel - -fun UserProfile.toPresentation(): UserProfileUiModel = UserProfileUiModel( - memberId = memberId, - nickName = nickName, - profileImage = profileImage, -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/ReservationTicketUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/ReservationTicketUiModel.kt deleted file mode 100644 index add00010f..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/ReservationTicketUiModel.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.festago.festago.presentation.model - -import android.os.Parcelable -import kotlinx.parcelize.Parcelize - -@Parcelize -data class ReservationTicketUiModel( - val id: Int, - val remainAmount: Int, - val ticketType: String, - val totalAmount: Int, -) : Parcelable diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/StageUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/StageUiModel.kt deleted file mode 100644 index 7ab8bc6e4..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/StageUiModel.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.festago.festago.presentation.model - -import java.time.LocalDateTime - -data class StageUiModel( - val id: Int = -1, - val startTime: LocalDateTime = LocalDateTime.MIN, -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketCodeUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketCodeUiModel.kt deleted file mode 100644 index 6c7d699b1..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketCodeUiModel.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.festago.festago.presentation.model - -data class TicketCodeUiModel( - val code: String, - val period: Int, -) { - companion object { - val EMPTY = TicketCodeUiModel(code = "code", period = 0) - } -} diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketConditionUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketConditionUiModel.kt deleted file mode 100644 index 53fabaa82..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketConditionUiModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.festago.festago.presentation.model - -import androidx.annotation.StringRes -import com.festago.festago.R - -enum class TicketConditionUiModel(@StringRes val stateName: Int) { - - BEFORE_ENTRY(R.string.all_ticket_state_before_entry), - AFTER_ENTRY(R.string.all_ticket_state_after_entry), - AWAY(R.string.all_ticket_state_away), -} diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketUiModel.kt deleted file mode 100644 index 432bf2ae6..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/TicketUiModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.festago.festago.presentation.model - -import java.time.LocalDateTime - -data class TicketUiModel( - val id: Long = -1, - val number: Int = -1, - val entryTime: LocalDateTime = LocalDateTime.MIN, - val reserveAt: LocalDateTime = LocalDateTime.MIN, - val condition: TicketConditionUiModel = TicketConditionUiModel.BEFORE_ENTRY, - val stage: StageUiModel = StageUiModel(), - val festivalId: Int = -1, - val festivalName: String = "", - val festivalThumbnail: String = "", -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/model/UserProfileUiModel.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/model/UserProfileUiModel.kt deleted file mode 100644 index 223f24371..000000000 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/model/UserProfileUiModel.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.festago.festago.presentation.model - -data class UserProfileUiModel( - val memberId: Long = -1, - val nickName: String = "", - val profileImage: String = "", -) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/ui/ticketentry/TicketEntryActivity.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/ui/ticketentry/TicketEntryActivity.kt index 6d7a3184f..ec654e3d0 100644 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/ui/ticketentry/TicketEntryActivity.kt +++ b/android/festago/app/src/main/java/com/festago/festago/presentation/ui/ticketentry/TicketEntryActivity.kt @@ -8,7 +8,6 @@ import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.core.content.res.ResourcesCompat import com.festago.festago.databinding.ActivityTicketEntryBinding -import com.festago.festago.presentation.mapper.toPresentation import com.festago.festago.presentation.ui.FestagoViewModelFactory import com.google.zxing.BarcodeFormat import com.journeyapps.barcodescanner.BarcodeEncoder @@ -66,7 +65,7 @@ class TicketEntryActivity : AppCompatActivity() { private fun handleSuccess(uiState: TicketEntryUiState.Success) { binding.successState = uiState - val ticketCode = uiState.ticketCode.toPresentation() + val ticketCode = uiState.ticketCode val bitmap = BarcodeEncoder().encodeBitmap( ticketCode.code,