package com.jeequan.jeepay.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jeequan.jeepay.core.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2024-01-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_pay_user")
@NoArgsConstructor
public class PayUser extends BaseModel {

    private static final long serialVersionUID=1L;

    /**
     * 支付用户id
     */
    @TableId(type = IdType.INPUT)
    private String payUserId;

    /**
     * 所属用户号
     */
    private String mchNo;

    /**
     * 初次关联的订单号
     */
    private String fastFlowNo;

    /**
     * 来源：WECHAT 微信 ALIPAY 支付宝 YSFPAY 云闪付 UNIONPAY 银联 OTHER 其他
     */
    private String type;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;


    public PayUser(PayOrder payOrder) {
        this.payUserId = payOrder.getChannelUser();
        this.mchNo = payOrder.getMchNo();
        this.type = payOrder.getWayCodeType();
        this.fastFlowNo = payOrder.getPayOrderId();
    }


}
