package com.nanri.aiimage.modules.productrisk.model.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.nanri.aiimage.modules.productrisk.model.vo.ProductRiskShopQueueItemVo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@Schema(description = "创建商品风险处理任务请求体：在推 Python 队列前调用，落库任务与各店结果占位行")
public class ProductRiskCreateTaskRequest {

    @NotNull(message = "user_id 不能为空")
    @JsonProperty("user_id")
    @Schema(description = "任务归属用户 ID，写入 biz_file_task.user_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long userId;

    @NotEmpty(message = "items 不能为空")
    @Valid
    @Schema(
            description = "已匹配店铺列表（结构同 /match-shops 的 items 元素），每项须 matched=true；"
                    + "店名会去重；每店生成一条 biz_file_result（含 resultId）。",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private List<ProductRiskShopQueueItemVo> items = new ArrayList<>();
}
