/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.mybatis.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
* @author admin
* @date 2024-09-02
**/
@Entity
@Data
@Table(name="tb_shop_user_flow")
public class TbShopUserFlow implements Serializable {

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

    @Column(name = "`shop_user_id`")
    @ApiModelProperty(value = "shopUserId")
    private Integer shopUserId;

    @Column(name = "`amount`")
    @ApiModelProperty(value = "amount")
    private BigDecimal amount;

    @Column(name = "`balance`")
    @ApiModelProperty(value = "balance")
    private BigDecimal balance;

    @Column(name = "`biz_code`")
    @ApiModelProperty(value = "bizCode")
    private String bizCode;

    @Column(name = "`biz_name`")
    @ApiModelProperty(value = "bizName")
    private String bizName;

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

    @Column(name = "`type`")
    @ApiModelProperty(value = "type")
    private String type;

    @Column(name = "`is_return`")
    @ApiModelProperty(value = "是否退款 1 已退款  0 未退款")
    private String isReturn;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

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