// Models generated by mesh dev cli,@Author: David Yan(david.yan@qq.com).
package models

import (
	"time"

	"git.apinb.com/bsm-sdk/core/database"
	"git.apinb.com/bsm-sdk/core/types"
)

/*
 * PassportExtend
 * Comment: 通行证帐号认证表
 * Version: 10
 * Created: 2022-04-12 10:50:54 , Updated:0001-01-01 00:00:00
 */
type PassportVerify struct {
	types.Std_ID
	types.Std_Passport

	// 验证时间戳
	EmailVerifyAt    *time.Time
	PhoneVerifyAt    *time.Time
	FaceVerifyAt     *time.Time
	DocumentVerifyAt *time.Time
	KycVerifyAt      *time.Time

	// 验证相关 token/代码
	EmailVerifyToken     string `gorm:"type:varchar(100)"`
	PhoneVerifyCode      string `gorm:"type:varchar(10)"`
	FaceVerifyReject     string `gorm:"type:text"`
	PhoneVerifyExpiresAt *time.Time

	// 证件相关字段
	DocumentType   string `gorm:"type:varchar(50)"` // 如: 'id_card', 'passport'
	DocumentName   string `gorm:"type:varchar(100)"`
	DocumentNumber string `gorm:"type:varchar(100)"`
	DocumentFront  string `gorm:"type:varchar(255)"` // 证件正面
	DocumentBack   string `gorm:"type:varchar(255)"` // 证件反面

	// KYC 相关字段
	KycDocumentBack string `gorm:"type:varchar(255)"`
	KycStatus       string `gorm:"type:varchar(20);default:'pending'"` // pending, approved, rejected
	KycRejectReason string `gorm:"type:text"`
}

func init() {
	database.AppendMigrate(&PassportVerify{})
}

// TableName .
func (pv *PassportVerify) TableName() string {
	return "passport_verify" //对应数据库表名
}
