From 6d3cf4cca88ded27bed657bca8bb5d8f85ba7f45 Mon Sep 17 00:00:00 2001 From: algosketch Date: Sat, 20 Jul 2024 02:20:20 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=B9=B4=ED=86=A1=20=EC=84=A0?= =?UTF-8?q?=EB=AC=BC=20=EC=A0=84=EC=86=A1=EC=97=90=20=EB=82=A0=EC=A7=9C=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nexters/boolti/data/network/response/GiftResponse.kt | 3 +++ domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt | 3 +++ .../presentation/screen/giftcomplete/GiftCompleteScreen.kt | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/com/nexters/boolti/data/network/response/GiftResponse.kt b/data/src/main/java/com/nexters/boolti/data/network/response/GiftResponse.kt index 25d6be37..d331171f 100644 --- a/data/src/main/java/com/nexters/boolti/data/network/response/GiftResponse.kt +++ b/data/src/main/java/com/nexters/boolti/data/network/response/GiftResponse.kt @@ -1,5 +1,6 @@ package com.nexters.boolti.data.network.response +import com.nexters.boolti.data.util.toLocalDate import com.nexters.boolti.domain.model.Gift import kotlinx.serialization.Serializable @@ -16,6 +17,7 @@ data class GiftResponse( val senderPhoneNumber: String, val recipientName: String, val recipientPhoneNumber: String, + val salesEndTime: String, val isDone: Boolean, ) { fun toDomain(): Gift { @@ -31,6 +33,7 @@ data class GiftResponse( senderPhoneNumber = senderPhoneNumber, recipientName = recipientName, recipientPhoneNumber = recipientPhoneNumber, + salesEndTime = salesEndTime.toLocalDate(), isDone = isDone, ) } diff --git a/domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt b/domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt index 70b72c4f..f0cbdaab 100644 --- a/domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt +++ b/domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt @@ -1,5 +1,7 @@ package com.nexters.boolti.domain.model +import java.time.LocalDate + data class Gift( val id: String, val uuid: String, @@ -12,5 +14,6 @@ data class Gift( val senderPhoneNumber: String, val recipientName: String, val recipientPhoneNumber: String, + val salesEndTime: LocalDate, val isDone: Boolean, ) diff --git a/presentation/src/main/java/com/nexters/boolti/presentation/screen/giftcomplete/GiftCompleteScreen.kt b/presentation/src/main/java/com/nexters/boolti/presentation/screen/giftcomplete/GiftCompleteScreen.kt index b4e5ca49..db1bd238 100644 --- a/presentation/src/main/java/com/nexters/boolti/presentation/screen/giftcomplete/GiftCompleteScreen.kt +++ b/presentation/src/main/java/com/nexters/boolti/presentation/screen/giftcomplete/GiftCompleteScreen.kt @@ -80,7 +80,9 @@ fun GiftCompleteScreen( .padding(innerPadding) .padding(horizontal = marginHorizontal) ) { - val dateText = stringResource(id = R.string.gift_expiration_date, 0, 0) // TODO: 0 대신 날짜(월, 일) 입력 + val month = gift?.salesEndTime?.month ?: 0 + val day = gift?.salesEndTime?.dayOfMonth ?: 0 + val dateText = stringResource(id = R.string.gift_expiration_date, month, day) val buttonsText = stringResource(id = R.string.gift_check) Text(