package com.emotion.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.emotion.common.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 实现路径实体类
 * 存储基于剧本生成的实现路径规划
 *
 * @author huazhongmin
 * @date 2025-12-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "t_life_path", autoResultMap = true)
public class LifePath extends BaseEntity {

    /**
     * 用户ID (关联t_user.id)
     */
    @TableField("user_id")
    private String userId;

    /**
     * 关联剧本ID (关联t_epic_script.id)
     */
    @TableField("script_id")
    private String scriptId;

    /**
     * 路径标题
     */
    @TableField("title")
    private String title;

    /**
     * 路径描述
     */
    @TableField("description")
    private String description;

    /**
     * 路径步骤列表 (JSON数组)
     * 每个步骤包含: phase, time, content, action, resources, habit
     */
    @TableField(value = "steps", typeHandler = JacksonTypeHandler.class)
    private List<Map<String, Object>> steps;

    /**
     * 状态: active-进行中, completed-已完成, archived-已归档
     */
    @TableField("status")
    private String status;

    /**
     * 完成进度百分比
     */
    @TableField("progress")
    private BigDecimal progress;
}
