feat(gift): 받은 선물 상태별 문구를 표시한다
This commit is contained in:
@@ -429,6 +429,11 @@ internal fun Context.resolveGiftDetailText(text: GiftDetailText): String = when
|
||||
Key.CANCELED_BODY -> R.string.gift_detail_canceled_body
|
||||
Key.DISPOSAL_NON_RETURN_GUIDANCE -> R.string.gift_detail_disposal_guidance
|
||||
Key.RECIPIENT_ADDRESS_COMPLETED_TITLE -> R.string.gift_recipient_address_completed_title
|
||||
Key.RECIPIENT_ADDRESS_COMPLETED_BODY -> R.string.gift_recipient_address_completed_body
|
||||
Key.RECIPIENT_INSPECTION_IN_PROGRESS_TITLE -> R.string.gift_recipient_inspection_in_progress_title
|
||||
Key.RECIPIENT_INSPECTION_IN_PROGRESS_BODY -> R.string.gift_recipient_inspection_in_progress_body
|
||||
Key.RECIPIENT_INSPECTION_COMPLETED_TITLE -> R.string.gift_recipient_inspection_completed_title
|
||||
Key.RECIPIENT_INSPECTION_COMPLETED_BODY -> R.string.gift_recipient_inspection_completed_body
|
||||
Key.RECIPIENT_DELIVERED_TITLE -> R.string.gift_recipient_delivered_title
|
||||
Key.RECIPIENT_ADDRESS_REMOVAL_GUIDANCE -> R.string.gift_recipient_address_removal_guidance
|
||||
}
|
||||
|
||||
@@ -23,6 +23,11 @@ sealed interface GiftDetailText {
|
||||
CANCELED_BODY,
|
||||
DISPOSAL_NON_RETURN_GUIDANCE,
|
||||
RECIPIENT_ADDRESS_COMPLETED_TITLE,
|
||||
RECIPIENT_ADDRESS_COMPLETED_BODY,
|
||||
RECIPIENT_INSPECTION_IN_PROGRESS_TITLE,
|
||||
RECIPIENT_INSPECTION_IN_PROGRESS_BODY,
|
||||
RECIPIENT_INSPECTION_COMPLETED_TITLE,
|
||||
RECIPIENT_INSPECTION_COMPLETED_BODY,
|
||||
RECIPIENT_DELIVERED_TITLE,
|
||||
RECIPIENT_ADDRESS_REMOVAL_GUIDANCE
|
||||
}
|
||||
|
||||
@@ -136,7 +136,23 @@ object GiftDetailPresenter {
|
||||
addressForm = GiftDetailAddressForm
|
||||
)
|
||||
detail.status in receivedAddressCompletedStates -> GiftDetailReceived.AddressCompleted(
|
||||
hero = GiftDetailHero(null, Key.RECIPIENT_ADDRESS_COMPLETED_TITLE, null),
|
||||
hero = when (detail.status) {
|
||||
"TRACKING_REGISTERED" -> GiftDetailHero(
|
||||
null,
|
||||
Key.RECIPIENT_ADDRESS_COMPLETED_TITLE,
|
||||
Key.RECIPIENT_ADDRESS_COMPLETED_BODY
|
||||
)
|
||||
"ARRIVED_AT_MAILBOX" -> GiftDetailHero(
|
||||
null,
|
||||
Key.RECIPIENT_INSPECTION_IN_PROGRESS_TITLE,
|
||||
Key.RECIPIENT_INSPECTION_IN_PROGRESS_BODY
|
||||
)
|
||||
else -> GiftDetailHero(
|
||||
null,
|
||||
Key.RECIPIENT_INSPECTION_COMPLETED_TITLE,
|
||||
Key.RECIPIENT_INSPECTION_COMPLETED_BODY
|
||||
)
|
||||
},
|
||||
giftInfoRows = receivedGiftRows(detail, shippingRequestedDate),
|
||||
recipientAddress = detail.recipientAddress?.toUiModel()
|
||||
)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<resources>
|
||||
<string name="gift_recipient_address_completed_title">Delivery address saved!</string>
|
||||
<string name="gift_recipient_address_completed_body">We will deliver your gift as soon as possible.</string>
|
||||
<string name="gift_recipient_inspection_in_progress_title">Gift inspection in progress</string>
|
||||
<string name="gift_recipient_inspection_in_progress_body">Your gift has arrived at the mailbox and is being inspected.</string>
|
||||
<string name="gift_recipient_inspection_completed_title">Gift inspection complete</string>
|
||||
<string name="gift_recipient_inspection_completed_body">Your gift has passed inspection. We will send it to you as soon as possible.</string>
|
||||
<string name="gift_recipient_delivered_title">Gift delivered!</string>
|
||||
<string name="gift_recipient_address_removal_guidance">This information will be deleted 3 days after delivery.</string>
|
||||
<string name="gift_recipient_reason_header">Reason</string>
|
||||
@@ -39,7 +44,7 @@
|
||||
<string name="gift_detail_delivered_title">Your gift has been delivered to the creator</string>
|
||||
<string name="gift_detail_undeliverable_title">This item cannot be delivered</string>
|
||||
<string name="gift_detail_undeliverable_body">Under the SODALIVE gift policy, the gift you sent has been identified as an item that cannot be delivered to the creator.</string>
|
||||
<string name="gift_detail_disposal_guidance">Gifts that cannot be delivered will be disposed of and will not be returned.</string>
|
||||
<string name="gift_detail_disposal_guidance">If the necessary arrangements, such as returning this gift, are not completed within the storage period (up to 7 days, including the day it arrives at our facility), it may be disposed of in accordance with the terms and disposal consent you previously agreed to. Please contact customer support for more information.</string>
|
||||
<string name="gift_detail_canceled_title">Your gift request has been canceled</string>
|
||||
<string name="gift_detail_canceled_body">Your gift request for %1$s (%2$s) has been canceled.\nThis cannot be undone. To send another gift, please submit a new request.</string>
|
||||
<string name="gift_detail_creator">Creator</string>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<resources>
|
||||
<string name="gift_recipient_address_completed_title">配送先の入力が完了しました!</string>
|
||||
<string name="gift_recipient_address_completed_body">できるだけ早くギフトをお届けします。</string>
|
||||
<string name="gift_recipient_inspection_in_progress_title">ギフトを検品中</string>
|
||||
<string name="gift_recipient_inspection_in_progress_body">ギフトが私書箱に届き、現在検品中です。</string>
|
||||
<string name="gift_recipient_inspection_completed_title">ギフトの検品が完了しました</string>
|
||||
<string name="gift_recipient_inspection_completed_body">ギフトの検品が完了しました。できるだけ早く発送します。</string>
|
||||
<string name="gift_recipient_delivered_title">ギフトのお届けが完了しました!</string>
|
||||
<string name="gift_recipient_address_removal_guidance">この情報は配送完了から3日後に削除されます</string>
|
||||
<string name="gift_recipient_reason_header">理由</string>
|
||||
@@ -39,7 +44,7 @@
|
||||
<string name="gift_detail_delivered_title">クリエイターにギフトをお届けしました</string>
|
||||
<string name="gift_detail_undeliverable_title">お届けできない品目です</string>
|
||||
<string name="gift_detail_undeliverable_body">お送りいただいたギフトは、SODALIVEのギフトポリシーにより、クリエイターにお届けできない品目と確認されました。</string>
|
||||
<string name="gift_detail_disposal_guidance">お届けできないギフトは廃棄され、返送されません。</string>
|
||||
<string name="gift_detail_disposal_guidance">このギフトは、保管期間(入庫日を含め最大7日間)内に返送などの必要な対応が完了しない場合、事前に同意いただいた利用規約および廃棄への同意内容に基づき、廃棄されることがあります。詳しくはカスタマーサポートへお問い合わせください。</string>
|
||||
<string name="gift_detail_canceled_title">ギフトの申請がキャンセルされました</string>
|
||||
<string name="gift_detail_canceled_body">%1$sへのギフト申請(%2$s)がキャンセルされました。\nキャンセルは取り消せません。もう一度送るには、新しく申請してください。</string>
|
||||
<string name="gift_detail_creator">クリエイター</string>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<resources>
|
||||
<string name="gift_recipient_address_completed_title">배송지 입력 완료!</string>
|
||||
<string name="gift_recipient_address_completed_body">빠른 시일 내로 선물을 전달 드릴게요.</string>
|
||||
<string name="gift_recipient_inspection_in_progress_title">선물 검수 중</string>
|
||||
<string name="gift_recipient_inspection_in_progress_body">선물이 사서함에 도착하여 검수 중이에요.</string>
|
||||
<string name="gift_recipient_inspection_completed_title">선물 검수 완료</string>
|
||||
<string name="gift_recipient_inspection_completed_body">선물 검수를 완료했어요. 빠른 시일내로 보내드릴게요.</string>
|
||||
<string name="gift_recipient_delivered_title">선물 전달 완료!</string>
|
||||
<string name="gift_recipient_address_removal_guidance">배송 완료 3일 후 해당 정보는 사라져요</string>
|
||||
<string name="gift_recipient_reason_header">사유</string>
|
||||
@@ -39,7 +44,7 @@
|
||||
<string name="gift_detail_delivered_title">크리에이터에게 선물을 전달했어요</string>
|
||||
<string name="gift_detail_undeliverable_title">전달할 수 없는 품목입니다</string>
|
||||
<string name="gift_detail_undeliverable_body">보내주신 선물은 소다라이브 선물 정책에 따라 크리에이터에게 전달할 수 없는 품목으로 확인되었습니다.</string>
|
||||
<string name="gift_detail_disposal_guidance">전달할 수 없는 선물은 폐기되며, 반송되지 않습니다.</string>
|
||||
<string name="gift_detail_disposal_guidance">해당 선물은 보관기간(입고일 포함 최대 7일) 내에 반송 등 필요한 조치가 완료되지 않을 경우, 사전에 동의한 약관 및 폐기 동의 내용에 따라 폐기될 수 있습니다. 자세한 내용은 고객센터로 문의해 주세요.</string>
|
||||
<string name="gift_detail_canceled_title">선물 신청이 취소되었어요</string>
|
||||
<string name="gift_detail_canceled_body">%1$s에게 보내는 선물 신청(%2$s)이 취소되었습니다.\n취소한 신청은 되돌릴 수 없으며, 다시 보내려면 새로 신청해 주세요.</string>
|
||||
<string name="gift_detail_creator">크리에이터</string>
|
||||
|
||||
@@ -258,14 +258,31 @@ class GiftDetailPresenterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `받은 선물 배송지 입력 완료 모드는 진행 상태별 네 행과 선택 주소를 만든다`() {
|
||||
listOf("TRACKING_REGISTERED", "ARRIVED_AT_MAILBOX", "INSPECTION_COMPLETED").forEach { status ->
|
||||
fun `받은 선물 배송지 입력 완료 모드는 진행 상태별 hero와 네 행과 선택 주소를 만든다`() {
|
||||
val expectedHeroKeyNames = mapOf(
|
||||
"TRACKING_REGISTERED" to listOf(
|
||||
"RECIPIENT_ADDRESS_COMPLETED_TITLE",
|
||||
"RECIPIENT_ADDRESS_COMPLETED_BODY"
|
||||
),
|
||||
"ARRIVED_AT_MAILBOX" to listOf(
|
||||
"RECIPIENT_INSPECTION_IN_PROGRESS_TITLE",
|
||||
"RECIPIENT_INSPECTION_IN_PROGRESS_BODY"
|
||||
),
|
||||
"INSPECTION_COMPLETED" to listOf(
|
||||
"RECIPIENT_INSPECTION_COMPLETED_TITLE",
|
||||
"RECIPIENT_INSPECTION_COMPLETED_BODY"
|
||||
)
|
||||
)
|
||||
expectedHeroKeyNames.forEach { (status, expectedHero) ->
|
||||
val model = GiftDetailPresenter.present(
|
||||
receivedDetail(status = status, recipientAddress = GiftAddressResponse("수신자", "01000000003", "수신주소"))
|
||||
)
|
||||
|
||||
val mode = model.received as GiftDetailReceived.AddressCompleted
|
||||
assertEquals(Key.RECIPIENT_ADDRESS_COMPLETED_TITLE, mode.hero.title)
|
||||
assertEquals(expectedHero[0], (mode.hero.title as Key).name)
|
||||
assertEquals(expectedHero[1], (mode.hero.body as? Key)?.name)
|
||||
assertEquals(mode.hero, model.hero)
|
||||
assertNull(mode.hero.chip)
|
||||
assertEquals(
|
||||
listOf(
|
||||
R.string.gift_inbox_sender,
|
||||
@@ -279,6 +296,14 @@ class GiftDetailPresenterTest {
|
||||
assertEquals(setOf(GiftDetailAction.INQUIRY), model.actions)
|
||||
assertTrue(model.actions.none { it == GiftDetailAction.TRACKING || it == GiftDetailAction.CANCEL })
|
||||
}
|
||||
expectedHeroKeyNames.keys.forEach { status ->
|
||||
val model = GiftDetailPresenter.present(
|
||||
receivedDetail(status = status, recipientAddressRequired = true)
|
||||
)
|
||||
|
||||
assertTrue(model.received is GiftDetailReceived.AddressForm)
|
||||
assertEquals(GiftDetailHero(null, Key.RECEIVED_TITLE, Key.RECEIVED_BODY), model.hero)
|
||||
}
|
||||
listOf<String?>(null, "bad").forEach { shippingRequestedAt ->
|
||||
val missingDate = GiftDetailPresenter.present(
|
||||
receivedDetail(status = "TRACKING_REGISTERED").copy(
|
||||
@@ -345,6 +370,14 @@ class GiftDetailPresenterTest {
|
||||
assertNull(model.recipientAddress)
|
||||
assertFalse(model.toString().contains("수신주소"))
|
||||
assertTrue(model.actions.none { it == GiftDetailAction.TRACKING || it == GiftDetailAction.CANCEL })
|
||||
listOf("금지 품목", "", "서버 원문 사유\n반송 확인").forEach { serverReason ->
|
||||
val received = GiftDetailPresenter.present(
|
||||
receivedDetail(status = "UNDELIVERABLE", recipientAddressRequired = true).copy(
|
||||
delivery = GiftDeliveryResponse(null, null, serverReason)
|
||||
)
|
||||
).received as GiftDetailReceived.Undeliverable
|
||||
assertEquals(Raw(serverReason), received.reason.title)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -413,7 +446,7 @@ class GiftDetailPresenterTest {
|
||||
val fallback = GiftDetailPresenter.present(source).undeliverable!!
|
||||
assertEquals(Key.UNDELIVERABLE_LABEL, fallback.title)
|
||||
assertEquals(Key.DISPOSAL_NON_RETURN_GUIDANCE, fallback.guidance)
|
||||
listOf("금지 품목", "").forEach { serverReason ->
|
||||
listOf("금지 품목", "", "서버 원문 사유\n반송 확인").forEach { serverReason ->
|
||||
val reason = GiftDetailPresenter.present(
|
||||
source.copy(delivery = source.delivery.copy(undeliverableReason = serverReason))
|
||||
)
|
||||
|
||||
@@ -274,15 +274,37 @@ class GiftDetailViewModelTest {
|
||||
}
|
||||
)
|
||||
mapOf(
|
||||
Locale.KOREAN to listOf("크리에이터", "취소 완료", "받는 사서함", "받는 주소", "배송지 입력"),
|
||||
Locale.KOREAN to listOf(
|
||||
"크리에이터", "취소 완료", "받는 사서함", "받는 주소", "배송지 입력",
|
||||
"배송지 입력 완료!", "빠른 시일 내로 선물을 전달 드릴게요.",
|
||||
"선물 검수 중", "선물이 사서함에 도착하여 검수 중이에요.",
|
||||
"선물 검수 완료", "선물 검수를 완료했어요. 빠른 시일내로 보내드릴게요.",
|
||||
"해당 선물은 보관기간(입고일 포함 최대 7일) 내에 반송 등 필요한 조치가 완료되지 않을 경우, " +
|
||||
"사전에 동의한 약관 및 폐기 동의 내용에 따라 폐기될 수 있습니다. 자세한 내용은 고객센터로 문의해 주세요."
|
||||
),
|
||||
Locale.ENGLISH to listOf(
|
||||
"Creator",
|
||||
"Cancellation complete",
|
||||
"Receiving mailbox",
|
||||
"Delivery address",
|
||||
"Enter delivery address"
|
||||
"Enter delivery address",
|
||||
"Delivery address saved!", "We will deliver your gift as soon as possible.",
|
||||
"Gift inspection in progress", "Your gift has arrived at the mailbox and is being inspected.",
|
||||
"Gift inspection complete", "Your gift has passed inspection. We will send it to you as soon as possible.",
|
||||
"If the necessary arrangements, such as returning this gift, are not completed within the storage " +
|
||||
"period (up to 7 days, including the day it arrives at our facility), it may be disposed of in accordance " +
|
||||
"with the terms and disposal consent you previously agreed to. Please contact customer support " +
|
||||
"for more information."
|
||||
),
|
||||
Locale.JAPANESE to listOf("クリエイター", "キャンセル完了", "受取私書箱", "受取住所", "配送先を入力")
|
||||
Locale.JAPANESE to listOf(
|
||||
"クリエイター", "キャンセル完了", "受取私書箱", "受取住所", "配送先を入力",
|
||||
"配送先の入力が完了しました!", "できるだけ早くギフトをお届けします。",
|
||||
"ギフトを検品中", "ギフトが私書箱に届き、現在検品中です。",
|
||||
"ギフトの検品が完了しました", "ギフトの検品が完了しました。できるだけ早く発送します。",
|
||||
"このギフトは、保管期間(入庫日を含め最大7日間)内に返送などの必要な対応が完了しない場合、" +
|
||||
"事前に同意いただいた利用規約および廃棄への同意内容に基づき、廃棄されることがあります。" +
|
||||
"詳しくはカスタマーサポートへお問い合わせください。"
|
||||
)
|
||||
).forEach { (locale, expected) ->
|
||||
val localized = context.createConfigurationContext(
|
||||
Configuration(context.resources.configuration).apply {
|
||||
@@ -300,6 +322,21 @@ class GiftDetailViewModelTest {
|
||||
)
|
||||
assertTrue(inputId != 0)
|
||||
assertEquals(expected[4], localized.getString(inputId))
|
||||
assertEquals(
|
||||
expected[11],
|
||||
localized.resolveGiftDetailText(GiftDetailText.Key.DISPOSAL_NON_RETURN_GUIDANCE)
|
||||
)
|
||||
listOf(
|
||||
"RECIPIENT_ADDRESS_COMPLETED_TITLE",
|
||||
"RECIPIENT_ADDRESS_COMPLETED_BODY",
|
||||
"RECIPIENT_INSPECTION_IN_PROGRESS_TITLE",
|
||||
"RECIPIENT_INSPECTION_IN_PROGRESS_BODY",
|
||||
"RECIPIENT_INSPECTION_COMPLETED_TITLE",
|
||||
"RECIPIENT_INSPECTION_COMPLETED_BODY"
|
||||
).forEachIndexed { index, keyName ->
|
||||
val key = GiftDetailText.Key.entries.firstOrNull { it.name == keyName }
|
||||
assertEquals(expected[index + 5], key?.let { localized.resolveGiftDetailText(it) })
|
||||
}
|
||||
GiftDetailText.Key.entries.forEach { key ->
|
||||
val text = localized.resolveGiftDetailText(key)
|
||||
assertTrue(text.isNotBlank())
|
||||
|
||||
Reference in New Issue
Block a user