package com.agent.management.model.vo;

import com.agent.management.model.entity.Workflow;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 工作流列表 VO（含标签）
 */
@Data
public class WorkflowVO {

    private Long id;
    /** kebab-case 唯一标识，对外暴露 */
    private String name;
    /** 中文显示名 */
    private String displayName;
    private String description;
    private String graphData;
    private Long categoryId;
    private String categoryName;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    /**
     * 关联的标签列表
     */
    private List<TagBriefVO> tags;

    public static WorkflowVO from(Workflow wf) {
        WorkflowVO vo = new WorkflowVO();
        vo.setId(wf.getId());
        vo.setName(wf.getName());
        vo.setDisplayName(wf.getDisplayName());
        vo.setDescription(wf.getDescription());
        vo.setGraphData(wf.getGraphData());
        vo.setCategoryId(wf.getCategoryId());
        vo.setCreatedAt(wf.getCreatedAt());
        vo.setUpdatedAt(wf.getUpdatedAt());
        return vo;
    }
}
