package app.closer.domain.model

data class QuestionMessage(
    val id: String = "",
    val userId: String = "",
    val text: String = "",
    /** "text", "image" (also GIFs/stickers/Bitmoji), or "voice". */
    val type: String = "text",
    /** Download URL of the ENCRYPTED media bytes in Storage (empty for text messages). */
    val mediaUrl: String = "",
    /** Voice-note length in milliseconds (0 for non-voice). */
    val durationMs: Long = 0L,
    /** Emoji reactions keyed by reactor uid, e.g. {uid: "❤️"}. */
    val reactions: Map<String, String> = emptyMap(),
    /** True once the author has unsent (tombstoned) the message. */
    val deleted: Boolean = false,
    val createdAt: Long = 0L
) {
    val isImage: Boolean get() = type == "image" && mediaUrl.isNotBlank() && !deleted
    val isVoice: Boolean get() = type == "voice" && mediaUrl.isNotBlank() && !deleted
}
