package com.craigvg.lichun_android.domain.models import androidx.compose.ui.graphics.Color import com.craigvg.lichun_android.ui.theme.AppColors import kotlinx.serialization.Serializable /** * Daily quest system models with progress tracking * Ported from iOS DailyQuest.swift */ @Serializable data class DailyQuestsState( val quests: List, val lastResetDate: String, val nextResetDate: String ) @Serializable enum class QuestCategory(val displayName: String) { SOCIAL("Social"), CAREER("Career"), ACTIVITIES("Activities"), EDUCATION("Education"), WEALTH("Wealth"); val icon: String get() = when (this) { SOCIAL -> "users" CAREER -> "briefcase" ACTIVITIES -> "activity" EDUCATION -> "book" WEALTH -> "dollar-sign" } val color: Color get() = when (this) { SOCIAL -> AppColors.primary CAREER -> AppColors.secondary ACTIVITIES -> AppColors.energy EDUCATION -> AppColors.intelligence WEALTH -> AppColors.money } } @Serializable data class DailyQuest( val id: String, val name: String, val description: String, val category: QuestCategory, val reward: QuestReward, val progress: Int, val target: Int, val completed: Boolean = false, val claimed: Boolean = false ) { val progressPercentage: Float get() { if (target <= 0) return if (completed) 1f else 0f return (progress.toFloat() / target.toFloat()).coerceIn(0f, 1f) } val progressText: String get() = "$progress/$target" val canClaim: Boolean get() = completed && !claimed } @Serializable data class QuestReward( val diamonds: Int, val energy: Int? = null, val money: Double? = null ) { val displayReward: String get() { val parts = mutableListOf() if (diamonds > 0) parts.add("$diamonds Diamonds") energy?.let { if (it > 0) parts.add("$it Energy") } money?.let { if (it > 0) parts.add("$${it.toInt()}") } return parts.joinToString(" + ") } }