package cn.pluss.platform.vo;

import cn.pluss.platform.entity.DeviceDetail;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * @author SSS
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DeviceDetailVO extends DeviceDetail {

    /**
     * 该字段与unitPrice等价，app接口使用的字段为price
     */
    private BigDecimal price;

    private String name;

    private String value;

    /**
     * 全部库存，暂未用到
     */
    private Long totalCount;

    /**
     * 已售总数
     */
    private Long totalSold;

    /**
     * 剩余库存
     */
    private Long stockNum;

    @Override
    public DeviceDetail setUnitPrice(BigDecimal unitPrice) {
        setPrice(unitPrice);
        return super.setUnitPrice(unitPrice);
    }

    @Override
    public DeviceDetail setTypeDesc(String typeDesc) {
        setName(typeDesc);
        return super.setTypeDesc(typeDesc);
    }

    @Override
    public DeviceDetail setType(String type) {
        setValue(type);
        return super.setType(type);
    }


}
