package com.jeesharp.business.modules.mall.dto;

import com.jeesharp.framework.pojo.dto.BaseSaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 商品发布模板保存请求，含头信息与明细行列表。
 *
 * @author jeesharp
 * @since 2026-05-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商品发布模板保存")
public class MallProductTemplateSaveDTO extends BaseSaveDTO {

    @NotBlank(message = "模板名称不能为空")
    @Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String templateName;

    @Schema(description = "模板编码")
    private String templateCode;

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

    @Schema(description = "状态：0-禁用 1-启用")
    private Integer status;

    @Valid
    @Schema(description = "模板明细行")
    private List<MallProductTemplateItemSaveDTO> items;
}
