package app.closer.domain.repository

import app.closer.domain.model.QuestionAnswer
import app.closer.domain.model.QuestionMessage
import app.closer.domain.model.QuestionReaction
import app.closer.domain.model.QuestionThread
import kotlinx.coroutines.flow.Flow

interface QuestionThreadRepository {
    suspend fun findOrCreateThreadId(coupleId: String, questionId: String, categoryId: String, userId: String): String
    fun observeThread(coupleId: String, threadId: String): Flow<QuestionThread>
    suspend fun submitAnswer(coupleId: String, threadId: String, userId: String, answer: QuestionAnswer)
    fun observeAnswers(coupleId: String, threadId: String): Flow<List<QuestionAnswer>>
    suspend fun sendMessage(coupleId: String, threadId: String, message: QuestionMessage)
    suspend fun sendImageMessage(coupleId: String, threadId: String, userId: String, imageBytes: ByteArray)
    suspend fun loadDecryptedMedia(coupleId: String, mediaUrl: String): ByteArray?
    fun observeMessages(coupleId: String, threadId: String): Flow<List<QuestionMessage>>
    suspend fun addReaction(coupleId: String, threadId: String, reaction: QuestionReaction)
    fun observeReactions(coupleId: String, threadId: String): Flow<List<QuestionReaction>>
}
