package com.atridad.openclimb.data.model

import kotlinx.serialization.Serializable
import java.time.LocalDateTime

@Serializable
data class ProblemProgress(
    val problemId: String,
    val totalAttempts: Int,
    val successfulAttempts: Int,
    val firstAttemptDate: String,
    val lastAttemptDate: String,
    val bestResult: AttemptResult,
    val averageAttempts: Double,
    val successRate: Double,
    val personalBest: String? = null, // Highest hold or completion details
    val notes: String? = null
)

@Serializable
data class SessionSummary(
    val sessionId: String,
    val date: String,
    val totalAttempts: Int,
    val successfulAttempts: Int,
    val uniqueProblems: Int,
    val avgDifficulty: Double,
    val maxDifficulty: DifficultyGrade,
    val climbTypes: List<ClimbType>,
    val duration: Long?, // in minutes
    val notes: String? = null
)

@Serializable
data class ClimbingStats(
    val totalSessions: Int,
    val totalAttempts: Int,
    val totalSuccesses: Int,
    val overallSuccessRate: Double,
    val uniqueProblemsAttempted: Int,
    val uniqueProblemsCompleted: Int,
    val averageSessionDuration: Double, // in minutes
    val favoriteGym: String?,
    val mostAttemptedDifficulty: DifficultyGrade?,
    val currentStreak: Int, // consecutive sessions
    val longestStreak: Int,
    val firstClimbDate: String?,
    val lastClimbDate: String?,
    val improvementTrend: String? = null // "improving", "stable", "declining"
)
