package tech.easyflow.agent.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.FastjsonTypeHandler;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Agent 运行事件摘要实体。
 */
@Table("tb_agent_run_event")
public class AgentRunEventRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private BigInteger id;
    @Column(tenantId = true)
    private BigInteger tenantId;
    private BigInteger agentId;
    private BigInteger chatSessionId;
    private BigInteger roundId;
    private Integer roundNo;
    private Integer variantIndex;
    private String requestId;
    private String eventId;
    private String eventType;
    private String eventPhase;
    private String toolCallId;
    @Column(typeHandler = FastjsonTypeHandler.class)
    private Map<String, Object> payloadJson = new LinkedHashMap<>();
    @Column(typeHandler = FastjsonTypeHandler.class)
    private Map<String, Object> metadataJson = new LinkedHashMap<>();
    private Date created;
    private BigInteger createdBy;

    public BigInteger getId() { return id; }
    public void setId(BigInteger id) { this.id = id; }
    public BigInteger getTenantId() { return tenantId; }
    public void setTenantId(BigInteger tenantId) { this.tenantId = tenantId; }
    public BigInteger getAgentId() { return agentId; }
    public void setAgentId(BigInteger agentId) { this.agentId = agentId; }
    public BigInteger getChatSessionId() { return chatSessionId; }
    public void setChatSessionId(BigInteger chatSessionId) { this.chatSessionId = chatSessionId; }
    public BigInteger getRoundId() { return roundId; }
    public void setRoundId(BigInteger roundId) { this.roundId = roundId; }
    public Integer getRoundNo() { return roundNo; }
    public void setRoundNo(Integer roundNo) { this.roundNo = roundNo; }
    public Integer getVariantIndex() { return variantIndex; }
    public void setVariantIndex(Integer variantIndex) { this.variantIndex = variantIndex; }
    public String getRequestId() { return requestId; }
    public void setRequestId(String requestId) { this.requestId = requestId; }
    public String getEventId() { return eventId; }
    public void setEventId(String eventId) { this.eventId = eventId; }
    public String getEventType() { return eventType; }
    public void setEventType(String eventType) { this.eventType = eventType; }
    public String getEventPhase() { return eventPhase; }
    public void setEventPhase(String eventPhase) { this.eventPhase = eventPhase; }
    public String getToolCallId() { return toolCallId; }
    public void setToolCallId(String toolCallId) { this.toolCallId = toolCallId; }
    public Map<String, Object> getPayloadJson() { return payloadJson; }
    public void setPayloadJson(Map<String, Object> payloadJson) { this.payloadJson = payloadJson == null ? new LinkedHashMap<>() : payloadJson; }
    public Map<String, Object> getMetadataJson() { return metadataJson; }
    public void setMetadataJson(Map<String, Object> metadataJson) { this.metadataJson = metadataJson == null ? new LinkedHashMap<>() : metadataJson; }
    public Date getCreated() { return created; }
    public void setCreated(Date created) { this.created = created; }
    public BigInteger getCreatedBy() { return createdBy; }
    public void setCreatedBy(BigInteger createdBy) { this.createdBy = createdBy; }
}
