package org.springblade.modules.business.entity;

import org.springblade.common.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;

/**
 * 售货机货表实体类
 *
 * @author zzyd
 * @since 2024-07-16
 */
@Data
@TableName("t_facility_cargo_way")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "FacilityCargoWay对象", description = "售货机货表")
public class FacilityCargoWay extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 设备id
     */
    @ApiModelProperty(value = "设备id")
    private Long facilityId;
    /**
     * 货道状态
     */
    @ApiModelProperty(value = "货道状态")
    private Integer cargoStatus;
    /**
     * 货道容量
     */
    @ApiModelProperty(value = "货道容量")
    private Integer volume;
    /**
     * 货道启用状态
     */
    @ApiModelProperty(value = "货道启用状态")
    private Integer enable;
    /**
     * 货道编号
     */
    @ApiModelProperty(value = "货道编号")
    private String cargoNo;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    private Long goodsId;
    /**
     * 售价
     */
    @ApiModelProperty(value = "售价")
    private BigDecimal salePrice;
    /**
     * 折扣
     */
    @ApiModelProperty(value = "折扣")
    private Double discount;
    /**
     * 商品库存
     */
    @ApiModelProperty(value = "商品库存")
    private Integer goodsStore;
    /**
     * 货道总交易数量
     */
    @ApiModelProperty(value = "货道总交易数量")
    private Integer totalTrade;
    /**
     * 货道总交易金额
     */
    @ApiModelProperty(value = "货道总交易金额")
    private BigDecimal totalAmount;

    public Double getDiscount() {
        return discount == null ? 0.0 : discount;
    }
}
