package com.ycwl.basic.integration.questionnaire.dto.question;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.List;

@Data
public class CreateQuestionRequest {
    @JsonProperty("id")
    private Long id;
    
    @NotBlank(message = "问题标题不能为空")
    @Size(max = 500, message = "问题标题长度不能超过500字符")
    @JsonProperty("title")
    private String title;
    
    @NotNull(message = "问题类型不能为空")
    @Min(value = 1, message = "问题类型无效")
    @Max(value = 5, message = "问题类型无效")
    @JsonProperty("type")
    private Integer type; // 1:单选 2:多选 3:填空 4:文本域 5:评分
    
    @JsonProperty("isRequired")
    private Boolean isRequired = false;
    
    @JsonProperty("sort")
    private Integer sort = 0;
    
    @Valid
    @JsonProperty("options")
    private List<CreateQuestionOptionRequest> options;
}