package com.lingyue.extract.dto.request;

import com.lingyue.extract.dto.config.VariableLocation;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Map;

/**
 * 添加变量请求
 * 
 * @author lingyue
 * @since 2026-01-23
 */
@Data
@Schema(description = "添加变量请求")
public class AddVariableRequest {
    
    @NotBlank(message = "变量名不能为空")
    @Schema(description = "变量名（程序用），模板内唯一", required = true)
    private String name;
    
    @NotBlank(message = "显示名称不能为空")
    @Schema(description = "显示名称", required = true)
    private String displayName;
    
    @Schema(description = "变量分组")
    private String variableGroup;
    
    @Schema(description = "变量类别（前端显示用）: entity/concept/data/location/asset")
    private String category;
    
    @NotNull(message = "变量位置不能为空")
    @Schema(description = "变量在文档中的位置", required = true)
    private VariableLocation location;
    
    @Schema(description = "示例值（原文档中的值）")
    private String exampleValue;
    
    @Schema(description = "值类型: text/date/number/table", defaultValue = "text")
    private String valueType = "text";
    
    @Schema(description = "来源文件别名")
    private String sourceFileAlias;
    
    @NotBlank(message = "来源类型不能为空")
    @Schema(description = "来源类型: document/manual/reference/fixed", required = true)
    private String sourceType;
    
    @Schema(description = "来源配置")
    private Map<String, Object> sourceConfig;
    
    @Schema(description = "提取类型: direct/ai_extract/ai_summarize")
    private String extractType;
    
    @Schema(description = "提取配置")
    private Map<String, Object> extractConfig;
}
