package com.izouma.jiashanxia.dto;

import com.izouma.jiashanxia.domain.PackageGoods;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "套餐商品")
public class PackageGoodsVO {
    private Long id;

    private Long packageId;

    private Long goodsInfoId;

    private String name;

    private String unit;

    @ApiModelProperty(value = "数量")
    private Integer num;

    @ApiModelProperty(value = "价格")
    private BigDecimal price;

    private String remark;

    public PackageGoodsVO(PackageGoods packageGoods) {
        this.id = packageGoods.getId();
        this.packageId = packageGoods.getPackageId();
        this.goodsInfoId = packageGoods.getGoodsInfoId();
        this.num = packageGoods.getNum();
        this.remark = packageGoods.getRemark();
        this.price = BigDecimal.ZERO;
    }

}
