package app.closer.domain.model

// Answer config for different question types
data class WrittenAnswerConfig(
    val minLength: Int = 1,
    val maxLength: Int = 1000,
    val placeholder: String = "Write your answer..."
)

data class ChoiceAnswerConfig(
    val options: List<ChoiceOption>,
    val maxSelections: Int = 0
)

data class ChoiceOption(
    val id: String,
    val text: String
)

data class ScaleAnswerConfig(
    val minScale: Int,
    val maxScale: Int,
    val minLabel: String,
    val maxLabel: String,
    val scaleStep: Int = 1
)

data class ThisOrThatAnswerConfig(
    val optionA: ChoiceOption,
    val optionB: ChoiceOption
)

sealed interface AnswerConfig {
    val type: String
}

data class WrittenAnswerConfigImpl(
    override val type: String = "written",
    val config: WrittenAnswerConfig
) : AnswerConfig

data class ChoiceAnswerConfigImpl(
    override val type: String = "single_choice",
    val config: ChoiceAnswerConfig
) : AnswerConfig

data class ScaleAnswerConfigImpl(
    override val type: String = "scale",
    val config: ScaleAnswerConfig
) : AnswerConfig

data class ThisOrThatAnswerConfigImpl(
    override val type: String = "this_or_that",
    val config: ThisOrThatAnswerConfig
) : AnswerConfig

data class Question(
    val id: String = "",
    val text: String = "",
    val category: String = "",
    val depthLevel: Int = 1,
    val isPremium: Boolean = false,
    val type: String = "written",
    val tags: List<String> = emptyList(),
    val answerConfig: AnswerConfig? = null,
    val packId: String? = null,
    val createdAt: Long = System.currentTimeMillis(),
    val status: String = "active",
    val sex: String? = null
)
