Skip to content

Commit

Permalink
feat : 카톡 선물 전송에 날짜 정보 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Jul 19, 2024
1 parent 952eb83 commit 6d3cf4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 {
Expand All @@ -31,6 +33,7 @@ data class GiftResponse(
senderPhoneNumber = senderPhoneNumber,
recipientName = recipientName,
recipientPhoneNumber = recipientPhoneNumber,
salesEndTime = salesEndTime.toLocalDate(),
isDone = isDone,
)
}
Expand Down
3 changes: 3 additions & 0 deletions domain/src/main/java/com/nexters/boolti/domain/model/Gift.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.nexters.boolti.domain.model

import java.time.LocalDate

data class Gift(
val id: String,
val uuid: String,
Expand All @@ -12,5 +14,6 @@ data class Gift(
val senderPhoneNumber: String,
val recipientName: String,
val recipientPhoneNumber: String,
val salesEndTime: LocalDate,
val isDone: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6d3cf4c

Please sign in to comment.