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

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;

import java.math.BigDecimal;

/**
 * sku信息
 */
@Schema(description="sku信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "wzj_soopin.pms_sku_snapshot")
public class SkuSnapshot {

    @TableId(value = "id")
    private Long id;

    /**
     * skuid
     */
    @TableField(value = "sku_id")
    @Schema(description="skuid")
    private Long skuId;

    /**
     * 商品快照id
     */
    @TableField(value = "product_snapshot_id")
    @Schema(description="商品快照id")
    private Long productSnapshotId;

    /**
     * sku编码
     */
    @TableField(value = "out_sku_id")
    @Schema(description="sku编码")
    @Size(max = 64,message = "sku编码最大长度要小于 64")
    private String outSkuId;

    @TableField(value = "price")
    @Schema(description="")
    @NotNull(message = "不能为null")
    private BigDecimal price;

    /**
     * 展示图片
     */
    @TableField(value = "pic")
    @Schema(description="展示图片")
    @Size(max = 255,message = "展示图片最大长度要小于 255")
    private String pic;

    /**
     * 商品销售属性，json格式
     */
    @TableField(value = "sp_data")
    @Schema(description="商品销售属性，json格式")
    @Size(max = 500,message = "商品销售属性，json格式最大长度要小于 500")
    private String spData;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
    @Schema(description="租户id")
    @Size(max = 255,message = "租户id最大长度要小于 255")
    private String tenantId;

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