package de.kif.common.model

import de.kif.common.SearchElement
import kotlinx.serialization.Serializable

@Serializable
data class WorkGroup(
    override val id: Long?,
    val name: String,
    val description: String,
    val interested: Int,
    val track: Track?,
    val projector: Boolean,
    val resolution: Boolean,
    val internet: Boolean,
    val whiteboard: Boolean,
    val blackboard: Boolean,
    val accessible: Boolean,
    val length: Int,
    val language: Language,
    val constraints: List<Constraint>,
    override val createdAt: Long = 0,
    override val updateAt: Long = 0
) : Model {

    override fun createSearch() = SearchElement(
        mapOf(
            "name" to name,
            "track" to (track?.name ?: ""),
            "language" to language.localeName
        ), mapOf(
            "projector" to projector,
            "resolution" to resolution
        ), mapOf(
            "interested" to interested.toDouble(),
            "length" to length.toDouble()
        )
    )
}
