package cn.ysk.cashier.pojo.shop;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
 * @author ww
 * @date 2024-05-21
 **/
@Entity
@Data
@Table(name="tb_shop_storage_good")
public class TbShopStorageGood implements Serializable {

    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`name`")
    @ApiModelProperty(value = "酒品名")
    private String name;

    @Column(name = "`img_url`")
    @ApiModelProperty(value = "图片地址")
    private String imgUrl;

    @Column(name = "`unit`")
    @ApiModelProperty(value = "单位")
    private String unit;

    @Column(name = "`period`")
    @ApiModelProperty(value = "有效期(天)")
    private Integer period;

    @Column(name = "`is_del`")
    @ApiModelProperty(value = "0:未删除；1:已删除")
    private Integer isDel;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "`source`")
    @ApiModelProperty(value = "0:手动；1:商品；")
    private Integer source;

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "商户Id")
    private Integer shopId;

    public void copy(TbShopStorageGood source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}