package org.springblade.modules.mall.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * Author pangqijun
 * Date 2022/7/28
 * Description
 */
@Data
public class ShoppingCartVO {

	@ApiModelProperty(value = "购物车id")
	private Long shoppingCartId;

	@ApiModelProperty(value = "商品id")
	private Long goodsInfoId;

	@ApiModelProperty(value = "商品名称")
	private String goodsInfoName;

	@ApiModelProperty(value = "商品上架状态;1-上架  0-下架")
	private Integer isSale;

	@ApiModelProperty(value = "专区类型")
	private Integer zoneType;

	@ApiModelProperty(value = "商品价格")
	private BigDecimal salePrice;

	@ApiModelProperty(value = "商品图片")
	private String cover;

	@ApiModelProperty(value = "购买时获得的积分数")
	private BigDecimal obtainIntegral;

	@ApiModelProperty(value = "积分兑换时需要扣除的金额")
	private BigDecimal needAmount;

	@ApiModelProperty(value = "抵扣所需积分")
	private BigDecimal needIntegral;

	/** 规格id */
	@ApiModelProperty(value = "规格id")
	private Long goodsSpecId;

	@ApiModelProperty(value = "规格名称")
	private String goodsSpecName;

	/** 商品数量 */
	@ApiModelProperty(value = "商品数量")
	private Integer goodsNum;

	@ApiModelProperty(value = "是否参加活动;1-是  0-否")
	private Integer isActivity;

	@JsonIgnore
	private String goodsInfoImg;

	@JsonIgnore
	private String goodsSpecImg;

	@JsonIgnore
	private BigDecimal agreementPrice;

	public BigDecimal getSalePrice() {
		return salePrice != null ? salePrice.setScale(2, BigDecimal.ROUND_HALF_UP) : null;
	}
}
