package com.yaoai.api.dto.agent;

import com.yaoai.domain.entity.GraphStep;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class AgentStepDTO {
    private Long id;
    private String stepKey;
    private String stepName;
    private String agentType;
    private String status;
    private String score;
    private String scoreDetail;
    private String output;
    private Long durationMs;
    private LocalDateTime startedAt;
    private LocalDateTime doneAt;
    private Integer seq;

    public static AgentStepDTO from(GraphStep step) {
        AgentStepDTO dto = new AgentStepDTO();
        dto.setId(step.getId());
        dto.setStepKey(step.getStepKey());
        dto.setStepName(step.getStepName());
        dto.setAgentType(step.getAgentType());
        dto.setStatus(step.getStatus());
        dto.setScore(step.getScore());
        dto.setScoreDetail(step.getScoreDetail());
        dto.setOutput(step.getOutput());
        dto.setDurationMs(step.getDurationMs());
        dto.setStartedAt(step.getStartedAt());
        dto.setDoneAt(step.getDoneAt());
        dto.setSeq(step.getSeq());
        return dto;
    }
}
