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

import com.fasterxml.jackson.annotation.JsonProperty;
import com.ycwl.basic.integration.questionnaire.dto.question.CreateQuestionRequest;
import lombok.Data;

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

@Data
public class CreateQuestionnaireRequest {
    
    @NotBlank(message = "问卷名称不能为空")
    @Size(max = 255, message = "问卷名称长度不能超过255字符")
    @JsonProperty("name")
    private String name;
    
    @JsonProperty("description")
    private String description;
    
    @JsonProperty("startTime")
    private String startTime; // 格式: "2024-01-01 00:00:00"
    
    @JsonProperty("endTime")
    private String endTime; // 格式: "2024-12-31 23:59:59"
    
    @JsonProperty("isAnonymous")
    private Boolean isAnonymous = true;
    
    @JsonProperty("maxAnswers")
    private Integer maxAnswers = 0;
    
    @Valid
    @JsonProperty("questions")
    private List<CreateQuestionRequest> questions;
}