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

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 商品发布模板明细行，可为规格维度（关联 mall_spec）或扩展属性定义。
 *
 * @author jeesharp
 * @since 2026-05-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("mall_product_template_item")
@Schema(description = "商品发布模板明细")
public class MallProductTemplateItem extends BaseEntity<MallProductTemplateItem> {

    @Schema(description = "模板ID")
    private String templateId;

    /**
     * 行类型：1-规格 2-属性
     *
     * @see com.jeesharp.business.modules.mall.enums.MallProductTemplateItemTypeEnum
     */
    @Schema(description = "行类型：1-规格维度 2-扩展属性")
    private Integer itemType;

    @Schema(description = "规格ID（item_type=1）")
    private String specId;

    @Schema(description = "属性键（item_type=2 时必填，对应 mall_spu_ext_attr.attr_key）")
    private String attrKey;

    @Schema(description = "属性展示名")
    private String attrName;

    /**
     * 录入方式：1-文本 2-数字 3-单选 4-多选 5-日期
     *
     * @see com.jeesharp.business.modules.mall.enums.MallProductTemplateAttrInputTypeEnum
     */
    @Schema(description = "录入方式：1-文本 2-数字 3-单选 4-多选 5-日期")
    private Integer inputType;

    @Schema(description = "可选项 JSON 数组字符串")
    private String optionsJson;

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

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