package com.example.elva.ui.health

import java.util.*

/**
 * Общая модель метрики здоровья
 */
sealed class HealthMetric(
    open val id: String,
    open val timestamp: Long = System.currentTimeMillis()
)

/**
 * Метрика калорий
 */
data class CalorieEntry(
    override val id: String = UUID.randomUUID().toString(),
    val consumed: Int,
    val goal: Int,
    override val timestamp: Long = System.currentTimeMillis()
) : HealthMetric(id, timestamp)

/**
 * Метрика воды
 */
data class WaterEntry(
    override val id: String = UUID.randomUUID().toString(),
    val consumed: Int, // в мл
    val goal: Int, // в мл
    override val timestamp: Long = System.currentTimeMillis()
) : HealthMetric(id, timestamp)

/**
 * Метрика веса
 */
data class WeightEntry(
    override val id: String = UUID.randomUUID().toString(),
    val weight: Float, // в кг
    val goal: Float?, // целевой вес в кг
    override val timestamp: Long = System.currentTimeMillis()
) : HealthMetric(id, timestamp)

/**
 * Метрика сна
 */
data class SleepEntry(
    override val id: String = UUID.randomUUID().toString(),
    val hours: Float,
    val goal: Float,
    val quality: SleepQuality = SleepQuality.GOOD,
    override val timestamp: Long = System.currentTimeMillis()
) : HealthMetric(id, timestamp)

enum class SleepQuality {
    EXCELLENT,
    GOOD,
    FAIR,
    POOR
}

/**
 * Запись в журнале
 */
data class HealthNote(
    val id: String = UUID.randomUUID().toString(),
    val title: String,
    val content: String,
    val category: NoteCategory,
    val timestamp: Long = System.currentTimeMillis()
)

enum class NoteCategory {
    SYMPTOMS,
    MOOD,
    EXERCISE,
    MEDICATION,
    OTHER
}

/**
 * Данные периода для календаря
 */
data class PeriodData(
    val id: String = UUID.randomUUID().toString(),
    val startDate: Long,
    val endDate: Long?,
    val cycleLength: Int = 28,
    val periodLength: Int = 5
)

