package com.infoepoch.pms.agent.platform.agent.application.dto;

import com.infoepoch.pms.agent.platform.agent.domain.AgentField;
import lombok.Getter;

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

/**
 * 智能体字段响应 DTO。
 */
@Getter
public class AgentFieldResponse {

    private final String id;
    private final String agentId;
    private final String fieldName;
    private final String fieldLabel;
    private final String fieldType;
    private final String dateFormat;
    private final List<String> enumOptions;
    private final boolean required;
    private final String description;
    private final int sortOrder;
    private final LocalDateTime createdAt;

    public AgentFieldResponse(AgentField field) {
        this.id = field.getId();
        this.agentId = field.getAgent() != null ? field.getAgent().getId() : field.getAgentId();
        this.fieldName = field.getFieldName();
        this.fieldLabel = field.getFieldLabel();
        this.fieldType = field.getFieldType();
        this.dateFormat = field.getDateFormat();
        this.enumOptions = field.getEnumOptions();
        this.required = field.isRequired();
        this.description = field.getDescription();
        this.sortOrder = field.getSortOrder();
        this.createdAt = field.getCreatedAt();
    }
}
