package com.wzj.soopin.goods.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import org.dromara.common.excel.annotation.Excel;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.io.Serial;
import java.math.BigDecimal;

/**
 * 商品信息对象 pms_product
 *
 * @author zcc
 */
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商品信息对象")
@Data
@TableName("pms_product")
public class Product extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

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

    @Schema(description = "当前快照id")
    private Long productSnapshotId;

    @Schema(description = "BRAND_ID")
    @Excel(name = "BRAND_ID")
    private Long brandId;

    @Schema(description = "CATEGORY_ID")
    @Excel(name = "CATEGORY_ID")
    private Long categoryId;

    @Schema(description = "商品编码")
    @Excel(name = "商品编码")
    private String outProductId;

    @Schema(description = "NAME")
    @Excel(name = "NAME")
    private String name;

    @Schema(description = "主图")
    @Excel(name = "主图")
    private String pic;

    @Schema(description = "画册图片，连产品图片限制为5张，以逗号分割")
    @Excel(name = "画册图片，连产品图片限制为5张，以逗号分割")
    private String albumPics;

    @Schema(description = "上架状态：0->下架；1->上架")
    @Excel(name = "上架状态：0->下架；1->上架")
    private Integer publishStatus;

    @Schema(description = "排序")
    @Excel(name = "排序")
    private Integer sort;

    @Schema(description = "PRICE")
    @Excel(name = "PRICE")
    private BigDecimal price;

    @Schema(description = "单位")
    @Excel(name = "单位")
    private String unit;

    @Schema(description = "商品重量，默认为克")
    @Excel(name = "商品重量，默认为克")
    private BigDecimal weight;

    @Schema(description = "商品销售属性，json格式")
    @Excel(name = "商品销售属性，json格式")
    private String productAttr;

    @Schema(description = "产品详情网页内容")
    @Excel(name = "产品详情网页内容")
    private String detailHtml;

    @Schema(description = "移动端网页详情")
    @Excel(name = "移动端网页详情")
    private String detailMobileHtml;

    @Schema(description = "品牌名称")
    @Excel(name = "品牌名称")
    private String brandName;

    @Schema(description = "商品分类名称")
    @Excel(name = "商品分类名称")
    private String productCategoryName;

    @Schema(description = "商品类型 1.团购;->2.拼团;3->秒杀")
    @Excel(name = "商品类型 1.团购;->2.拼团;3->秒杀")
    private Integer type;

    @Schema(description = "店铺id")
    @Excel(name = "店铺id")
    private String tenantId;

    @Schema(description = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
    @Excel(name = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
    private Integer authFlag;

    @Schema(description = "销量")
    @Excel(name = "销量")
    private String sales;

    @Schema(description = "驳回原因")
    @Excel(name = "驳回原因")
    private String reasons;

    @Schema(description = "删除标志（0代表存在，1代表删除）")
    @TableLogic(value ="0", delval = "1")
    @TableField(value ="del_flag",fill = FieldFill.INSERT, jdbcType = JdbcType.CHAR)
    private String delFlag;
}
