package com.pixelized.headache.repository.event

import androidx.compose.ui.graphics.Color

data class Event(
    val id: Long,
    val title: String,
    val description: String?,
    val date: Date,
    val pills: List<Pill>,
    val isValid: Boolean,
    val isMisspelled: Boolean,
) {
    data class Date(
        val day: Int,
        val month: Int,
        val year: Int,
    ) : Comparable<Date> {
        override fun compareTo(other: Date): Int = when {
            year < other.year -> -1
            year > other.year -> 1
            month < other.month -> -1
            month > other.month -> 1
            day < other.day -> -1
            day > other.day -> 1
            else -> 0
        }
    }

    data class Pill(
        val id: Id,
        val label: String,
        val amount: Int,
        val description: String,
        val color: Color,
        val isValid: Boolean,
        val isMisspelled: Boolean,
    ) {
        enum class Id(val value: Long) {
            UNKNOWN(-1L),
            IBUPROFENE_400(0L),
            PARACETAMOL_1000(1L),
            SPIFEN_400(2L),
            ELETRIPTAN_40(3L),
        }
    }
}
