/*
*  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.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.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-02-23
**/
@Entity
@Data
@Table(name="tb_merchant_register")
public class TbMerchantRegister implements Serializable {

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

    @Column(name = "`register_code`")
    @ApiModelProperty(value = "激活码")
    private String registerCode;

    @Column(name = "`app_code`")
    @ApiModelProperty(value = "授权token")
    private String appCode;

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

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

    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "店铺id")
    private String shopId;

    @Column(name = "`type`")
    @ApiModelProperty(value = "版本类型")
    private String type;

    @Column(name = "`amount`")
    @ApiModelProperty(value = "激活码金额")
    private BigDecimal amount;

    @Column(name = "`period_year`")
    @ApiModelProperty(value = "激活时长（月）")
    private Integer periodYear;

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

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

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

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

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

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态0未使用1已使用")
    private Integer status;

    @Column(name = "`limit_shop_number`")
    @ApiModelProperty(value = "limitShopNumber")
    private Integer limitShopNumber;

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

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "创建时间")
    private Long createdAt;

    @Column(name = "`updated_at`")
    @ApiModelProperty(value = "updatedAt")
    private Long updatedAt;

    @Column(name = "proxy_id")
    @ApiModelProperty(value = "代理id")
    private String proxyId;


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