package com.ycwl.basic.model.mobile.order;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class IsBuyRespVO {
    private boolean buy;
    private boolean free;
    private Long orderId;
    private int goodsType;
    private Long goodsId;
    private BigDecimal origPrice = BigDecimal.ZERO;
    private Integer couponId;
    private Integer couponRecordId;
    private BigDecimal couponPrice = BigDecimal.ZERO;
    private BigDecimal slashPrice;

    public BigDecimal getPrice() {
        return origPrice.subtract(couponPrice);
    }
    public BigDecimal getDiscountPrice() {
        if (slashPrice == null) {
            return BigDecimal.ZERO;
        }
        if (slashPrice.compareTo(BigDecimal.ZERO) <= 0) {
            return BigDecimal.ZERO;
        }
        return slashPrice.subtract(origPrice);
    }
}
