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 javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

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

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

    @Column(name = "`storage_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "存酒信息id")
    private Integer storageId;

    @Column(name = "`content`")
    @ApiModelProperty(value = "记录")
    private String content;

    @Column(name = "`time`")
    @ApiModelProperty(value = "操作时间")
    private Timestamp time;

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