package com.liquidnet.service.goblin.dto.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@ApiModel(value = "GoblinGoodsSkuInfoDetailVo", description = "商品SKU信息，详情")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
    private static final long serialVersionUID = 7139250447538358198L;

    @ApiModelProperty(position = 24, value = "购买限制[0-全部用户|1-仅会员|2-指定用户]")
    private String buyFactor;
    @ApiModelProperty(position = 40, value = "单品规格信息")
    private List<GoblinGoodsSpecDto> skuSpecList;
    @ApiModelProperty(position = 22, value = "单品会员价格[20,2]")
    private BigDecimal priceMember;
    @ApiModelProperty(position = 10, value = "商品单品ID")
    private String skuId;
    @ApiModelProperty(position = 15, value = "单品默认图片的URL[256]")
    private String skuPic;
    @ApiModelProperty(position = 21, value = "单品现价[20,2]")
    private BigDecimal price;
    @ApiModelProperty(position = 33, value = "自定义展示[0-默认展示|1-隐藏不可购买]")
    private String skuAppear;
    @ApiModelProperty(position = 11, value = "商品ID[64]")
    private String spuId;
    @ApiModelProperty(position = 12, value = "是否无库存（实时：Redis 库存 getSkuStock，stock<=0 为 true；售罄判断优先用此字段或 restStock）")
    private boolean stockLess;
    @ApiModelProperty(position = 13, value = "限购维度可买数：buyLimit=0 时为 -9999 表示不限购；否则为 buyLimit-用户已购数（与 restStock 无强制取小，下单仍以库存为准）")
    private int canBuy;
    @ApiModelProperty(position = 13, value = "单品的名称[100]")
    private String name;
    @ApiModelProperty(position = 20, value = "单品销售价-原价[20,2]")
    private BigDecimal sellPrice;

    @ApiModelProperty(value = "收钱吧商品(spuType=33)演出关联换购价（元）；其他商品类型恒为 null；SQB 且传入 performancesId 且后台已配置时返回")
    private BigDecimal settlementPrice;

    @ApiModelProperty(position = 26, value = "限量[0-无限制|X:限购数量]")
    private Integer buyLimit;
    @ApiModelProperty(position = 27, value = "剩余库存（实时：Redis getSkuStock）")
    private Integer restStock;
    @ApiModelProperty(position = 28, value = "单品是否可买[0-否|1-是]（来自 Redis/Mongo SKU 文档，BeanUtils 拷贝；与 stockLess 可能不同步时以 stockLess/restStock 为准）")
    private String skuCanbuy;
    @ApiModelProperty(position = 29, value = "是否售罄标记[0-否|1-是]（SKU 主数据字段；列表/详情中实时售罄以 stockLess、restStock 为准）")
    private String soldoutStatus;
    @ApiModelProperty(position = 51, value = "是否实名[0-否｜1-是，表示该商品需要实名关联]")
    private Integer isTrueName;

    private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo();

    public static GoblinGoodsSkuInfoDetailVo getNew() {
        try {
            return (GoblinGoodsSkuInfoDetailVo) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new GoblinGoodsSkuInfoDetailVo();
        }
    }
}
