package app.closer.domain.model

/**
 * A single partner's swipe action on a date idea.
 *
 * Document path: couples/{coupleId}/date_swipes/{dateId}
 * The document contains a map of userId -> action.
 */
data class DateSwipe(
    val dateIdeaId: String = "",
    val userId: String = "",
    val action: SwipeAction = SwipeAction.SKIP,
    val swipedAt: Long = 0L
)

enum class SwipeAction {
    LOVE,
    MAYBE,
    SKIP;

    fun toFirestoreValue(): String = name.lowercase()

    companion object {
        fun fromFirestoreValue(value: String): SwipeAction = when (value) {
            "love" -> LOVE
            "maybe" -> MAYBE
            else -> SKIP
        }
    }
}
