package com.seer.teach.mp.admin.controller.req;

import com.seer.teach.common.request.PageRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "活动表单字段查询请求")
public class ActivityFormFieldQueryReq extends PageRequest {

    @Schema(description = "ID")
    private Integer id;

    @Schema(description = "所属ID")
    @NotNull(message = "所属ID不能为空")
    private Integer formId;

    @Schema(description = "字段名称")
    @NotBlank(message = "字段名称不能为空")
    @Size(max = 255, message = "字段名称长度不能超过255个字符")
    private String fieldName;

    @Schema(description = "字段代码（英文标识）")
    @NotBlank(message = "字段代码不能为空")
    @Size(max = 100, message = "字段代码长度不能超过100个字符")
    private String fieldCode;

    @Schema(description = "字段类型：text, textarea, select, radio, checkbox, date, number等")
    @NotBlank(message = "字段类型不能为空")
    @Size(max = 50, message = "字段类型长度不能超过50个字符")
    private String fieldType;

    @Schema(description = "字段选项（JSON格式，适用于select, radio, checkbox等）")
    private String fieldOptions;

    @Schema(description = "占位符提示")
    @Size(max = 500, message = "占位符提示长度不能超过500个字符")
    private String placeholder;

    @Schema(description = "是否必填：0-否，1-是")
    private Integer isRequired;

    @Schema(description = "排序")
    private Integer sortOrder;

    @Schema(description = "验证规则（JSON格式）")
    private String validationRules;

    @Schema(description = "字段描述")
    private String description;

}