package com.gzzm.lobster.plan;

import com.gzzm.lobster.common.PlanStatus;
import net.cyan.thunwind.annotation.ColumnDescription;
import net.cyan.thunwind.annotation.Entity;
import net.cyan.thunwind.annotation.Index;

import java.util.Date;

/**
 * Plan —— LLM 自主生成的任务计划 / LLM-generated task plan.
 *
 * <p>计划是**可选**增强层：simple task 直接走纯 ReAct，不强制。
 * 计划生成后持久化，以便 run 重启时自然恢复。
 *
 * <p>Plans are optional. Simple tasks skip them entirely.
 * Once created a plan is persisted so a run can resume naturally.
 */
@Entity(table = "AI_PLAN", keys = "planId")
public class Plan {

    @ColumnDescription(type = "varchar(40)")
    private String planId;

    @Index
    @ColumnDescription(type = "varchar(40)", nullable = false)
    private String threadId;

    @ColumnDescription(type = "varchar(40)", nullable = false)
    private String userId;

    @ColumnDescription(type = "varchar(300)")
    private String title;

    @ColumnDescription(type = "varchar(40)")
    private String skillId;

    private PlanStatus status;

    private Date createTime;
    private Date updateTime;

    public Plan() {}

    public String getPlanId() { return planId; }
    public void setPlanId(String planId) { this.planId = planId; }
    public String getThreadId() { return threadId; }
    public void setThreadId(String threadId) { this.threadId = threadId; }
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }
    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }
    public String getSkillId() { return skillId; }
    public void setSkillId(String skillId) { this.skillId = skillId; }
    public PlanStatus getStatus() { return status; }
    public void setStatus(PlanStatus status) { this.status = status; }
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    public Date getUpdateTime() { return updateTime; }
    public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
}
