package model

import "time"

type User struct {
	ID             uint64     `gorm:"primaryKey" json:"id"`
	Phone          string     `gorm:"size:32;not null;uniqueIndex" json:"phone"`
	Nickname       string     `gorm:"size:64;not null;default:''" json:"nickname"`
	AvatarURL      string     `gorm:"size:512;not null;default:''" json:"avatar_url"`
	RealnameStatus string     `gorm:"size:32;not null;default:'unverified'" json:"realname_status"`
	RiskStatus     string     `gorm:"size:32;not null;default:'normal'" json:"risk_status"`
	CreditScore    int        `gorm:"not null;default:100" json:"credit_score"`
	Status         string     `gorm:"size:32;not null;default:'active'" json:"status"`
	LastLoginAt    *time.Time `json:"last_login_at"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
}

func (User) TableName() string {
	return "users"
}
