package com.gamedog.vididin.main.fragments.task

data class TaskBean(
    val task_module_config: TaskModuleConfig
)

data class TaskModuleConfig(
    val basic_info: BasicInfo,
    val task_categories: List<TaskCategory>,
    val box_task: BoxTaskRoot
) {
    fun getTaskCategoryById(categoryId: String): TaskCategory? {
        return task_categories.find { it.category_id == categoryId }
    }
}

data class BasicInfo(
    val currency_display: List<String>,
    val layout_style: String,
    val module_name: String,
    val page_path: String
)

data class TaskCategory(
    val category_id: String,
    val category_name: String,
    val display_priority: Int,
    val tasks: List<Task>,
    val valid_period: String
) {
    fun getTaskById(taskId: String): Task? {
        return tasks.find { it.task_id == taskId }
    }
}

data class Task(
    val daily_limit: Int,
    val double_reward_method: String,
    val is_one_time: Boolean,
    val makeup_method: String,
    val reward_details: List<RewardDetail>,
    val reward_stackable: Boolean,
    val reward_type: String,
    val reward_value: Int,
    val status: String,
    val support_makeup: Boolean,
    val target_action: String,
    val task_desc: String,
    val task_id: String,
    val task_name: String
)

data class RewardDetail(
    val day: Int,
    val target_count: Int,
    val value: Int
)



//----------------------------- 宝箱任务配置 -----------------------------
data class BoxSubTask(
    val task_id: String,
    val task_name: String,
    val required_count: Int,
    val task_type: Int,
)

data class BoxTask(
    val chest_id: String,
    val chest_name: String,
    val duration_days: Int,
    val reward_type: String,
    val reward_value: Double,
    val is_one_time: Boolean,
    val status: String,
    val tasks: List<BoxSubTask>,
)

data class BoxTaskRoot(
    val category_id: String,
    val category_name: String,
    val valid_period: String,
    val display_priority: String,
    val chests: List<BoxTask>,
)