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

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

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

    @Column(name = "`shop_id`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "店铺Id")
    private String shopId;

    @Column(name = "`purveyor_name`")
    @ApiModelProperty(value = "供应商名字")
    private String purveyorName;

    @Column(name = "`purveyor_id`")
    @ApiModelProperty(value = "供应商Id")
    private String purveyorId;

    @Column(name = "`status`")
    @ApiModelProperty(value = "0待付款1已付款 -1是否作废")
    private Integer status;

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

    @Column(name = "`created_at`")
    @ApiModelProperty(value = "createdAt")
    private Long createdAt;

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

    @Column(name = "`total_amount`")
    @ApiModelProperty(value = "应付金额")
    private BigDecimal totalAmount;

    @Column(name = "`wait_amount`")
    @ApiModelProperty(value = "待付款金额")
    private BigDecimal waitAmount;

    @Column(name = "`paid_amount`")
    @ApiModelProperty(value = "已支付金额")
    private BigDecimal paidAmount;

    @Column(name = "`paid_at`")
    @ApiModelProperty(value = "paidAt")
    private Long paidAt;

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

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




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