package app.closer.domain.repository

import app.closer.domain.model.DateIdea
import app.closer.domain.model.DateMatch
import app.closer.domain.model.DateSwipe
import app.closer.domain.model.SwipeAction
import kotlinx.coroutines.flow.Flow

/**
 * Repository for the Date Match feature.
 *
 * Responsibilities:
 * - Surface date ideas to swipe
 * - Record a user's swipe action
 * - Reveal mutual love matches in real time
 * - Surface secondary "maybe" suggestions
 */
interface DateMatchRepository {

    /** Load all available date ideas. */
    suspend fun getDateIdeas(): List<DateIdea>

    /** Record the current user's swipe and return the resulting match if it was mutual love. */
    suspend fun recordSwipe(coupleId: String, userId: String, dateIdeaId: String, action: SwipeAction): Result<DateMatch?>

    /** Get the current user's own swipe for a date. */
    suspend fun getOwnSwipe(coupleId: String, userId: String, dateIdeaId: String): DateSwipe?

    /** Observe all swipes made by the current user. */
    fun observeOwnSwipes(coupleId: String, userId: String): Flow<List<DateSwipe>>

    /** Observe all revealed mutual matches for the couple. */
    fun observeMatches(coupleId: String): Flow<List<DateMatch>>

    /** Get partner's swipe actions for the current user to compute maybe suggestions. */
    suspend fun getPartnerSwipes(coupleId: String, partnerId: String): List<DateSwipe>
}
