package com.sunxung.factoring.entity.credit;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sunxung.factoring.entity.BaseEntity;
import com.sunxung.factoring.entity.sys.FileStorage;
import com.sunxung.factoring.entity.sys.FileStorageDO;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

import static com.sunxung.factoring.component.util.DecimalFormatUtil.pattern;

@Getter
@Setter
public class CreditInfo extends BaseEntity {

    //名称
    private String name;

    //类型，0：个人，1：企业
    private Integer type;

    //证件类型
    private Integer documentType;

    //证件号码
    private String cardNo;

    //手机号码
    private String phone;

    //身份证正面
    private String cardPhoto;

    //身份证正面文件
    @TableField(exist = false)
    private FileStorage cardPhotoFile;

    //身份证反面
    private String cardRevPhoto;

    //身份证反面文件
    @TableField(exist = false)
    private FileStorage cardRevPhotoFile;

    //最近征信查询时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchDate;

    //授权书地址
    @TableField(exist = false)
    private String authAddress;

    //授权书地址
    @TableField(exist = false)
    private FileStorage authAddressFile;

    //征信地址
    @TableField(exist = false)
    private String creditAddress;

    //征信地址
    @TableField(exist = false)
    private FileStorage creditAddressFile;

    //征信详情
    @TableField(exist = false)
    private List<CreditDetail> creditDetails;


}
