diff --git a/app/src/main/java/app/closer/domain/model/DateSuggestion.kt b/app/src/main/java/app/closer/domain/model/DateSuggestion.kt new file mode 100644 index 00000000..9f32929c --- /dev/null +++ b/app/src/main/java/app/closer/domain/model/DateSuggestion.kt @@ -0,0 +1,46 @@ +package app.closer.domain.model + +/** + * A generated date suggestion surfaced to a couple at a useful moment. + * + * This model carries only metadata: what activity to suggest, why it was triggered, + * and how strongly it should be prioritized. It never contains private answer text. + * + * @property triggerReason why the suggestion was generated + * @property suggestedActivity human-readable activity suggestion + * @property priority higher numbers are more urgent/interesting + * @property categoryId optional question/date category that informed the suggestion + * @property sourceFlags bitmap describing which inputs influenced this suggestion; + * revealed answers are explicitly tagged as [SourceFlag.REVEALED_ANSWER] + * and hidden answer text is never used + */ +data class DateSuggestion( + val triggerReason: DateSuggestionTrigger, + val suggestedActivity: String, + val priority: Int, + val categoryId: String? = null, + val sourceFlags: List = emptyList() +) { + /** + * True when the suggestion was informed by an already-revealed answer. + * Used to drive privacy-safe copy and analytics. + */ + val isFromRevealedAnswer: Boolean + get() = SourceFlag.REVEALED_ANSWER in sourceFlags +} + +enum class DateSuggestionTrigger { + CATEGORY_SURGE, + WEEKLY_RECAP_COMPLETED, + CHALLENGE_COMPLETED, + PARTNER_SAVED_DATE_IDEA, + SHARED_INTEREST_REVEALED +} + +enum class SourceFlag { + CATEGORY_METADATA, + REVEALED_ANSWER, + PARTNER_ACTION, + CHALLENGE_CONTEXT, + RECAP_CONTEXT +} diff --git a/app/src/main/java/app/closer/ui/answers/AnswerRevealViewModel.kt b/app/src/main/java/app/closer/ui/answers/AnswerRevealViewModel.kt index fa57cd6b..5b2a2ec7 100644 --- a/app/src/main/java/app/closer/ui/answers/AnswerRevealViewModel.kt +++ b/app/src/main/java/app/closer/ui/answers/AnswerRevealViewModel.kt @@ -161,9 +161,12 @@ class AnswerRevealViewModel @Inject constructor( val bothRevealed = partnerAnswer?.isRevealed == true val options = mutableListOf() options += FollowUpOption.DEEPER_FOLLOW_UP - options += if (bothRevealed) FollowUpOption.DATE_IDEA else FollowUpOption.SAVE_MEMORY - if (category.isNotBlank()) { - options += FollowUpOption.ANOTHER_QUESTION + options += if (category.isNotBlank()) { + FollowUpOption.ANOTHER_QUESTION + } else if (bothRevealed) { + FollowUpOption.DATE_IDEA + } else { + FollowUpOption.SAVE_MEMORY } return options.take(2) }