package com.izouma.nineth.domain;

import com.izouma.nineth.annotations.Searchable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;

@Data
@Entity
@Table(indexes = {
        @Index(columnList = "bindOrderNo", unique = true),
        @Index(columnList = "unbindOrderNo", unique = true),
})
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserBankCard extends BaseEntity {

    @Searchable
    private Long userId;

    private String bank;

    private String bankName;

    private String cardType;

    private String cardTypeDesc;

    private String bankNo;

    @Searchable
    private String phone;

    private String realName;

    private String idNo;


    /**
     * 绑卡的支付平台
     */
    private String payPlatform;

    /**
     * 第三方账户ID
     */
    private String thirdAccountId;

    /**
     * 第三方绑卡ID
     */
    private String thirdBankId;

    /**
     * 绑卡订单号
     */
    private String bindOrderNo;

    /**
     * 授权令牌
     */
    private String token;

    /**
     * 解绑订单号
     */
    private String unbindOrderNo;


    /**
     * 是否存在钱包账户
     */
    @Transient
    private boolean hasWallet;

}
