feat(notif): add PARTNER_OPENED_ANSWER notification type + deep-link routing

This commit is contained in:
null 2026-06-26 12:40:54 -05:00
parent df32229f3b
commit f7418df700
1 changed files with 8 additions and 0 deletions

View File

@ -189,6 +189,12 @@ enum class PartnerNotificationType(
channelId = NotificationChannelSetup.CHANNEL_PARTNER_ACTIONS,
rateType = NotificationRateLimiter.Type.PARTNER_TRIGGER
),
PARTNER_OPENED_ANSWER(
title = "Your partner opened your answers.",
body = "Open to see what you each said.",
channelId = NotificationChannelSetup.CHANNEL_PARTNER_ACTIONS,
rateType = NotificationRateLimiter.Type.PARTNER_TRIGGER
),
PARTNER_STARTED_GAME(
title = "Your partner started a game for the two of you.",
body = "Tap to join them.",
@ -277,6 +283,7 @@ enum class PartnerNotificationType(
fun routeFor(payload: PartnerNotificationPayload, coupleId: String = ""): String = when (this) {
PARTNER_ANSWERED -> AppRoute.DAILY_QUESTION
REVEAL_READY -> payload.questionId?.let { AppRoute.answerReveal(it) } ?: AppRoute.ANSWER_HISTORY
PARTNER_OPENED_ANSWER -> payload.questionId?.let { AppRoute.answerReveal(it) } ?: AppRoute.DAILY_QUESTION
// Deep link straight into the waiting game (each game screen auto-joins the couple's active
// session on open), not the generic Play hub — the push says "Tap to join". Falls back to the
// hub only if the server didn't send game_type. E-003.
@ -307,6 +314,7 @@ enum class PartnerNotificationType(
companion object {
fun fromRemoteType(type: String): PartnerNotificationType? = when (type) {
"partner_answered" -> PARTNER_ANSWERED
"partner_opened_answer" -> PARTNER_OPENED_ANSWER
"reveal_ready" -> REVEAL_READY
"partner_started_game" -> PARTNER_STARTED_GAME
"partner_completed_part" -> PARTNER_COMPLETED_PART