package models

import "time"

type UserOTP struct {
	ID               uint       `gorm:"primaryKey;column:id" json:"id"`
	UserID           *uint      `gorm:"column:user_id;index"`
	Mobile           string     `gorm:"column:mobile;index"`
	Email            string     `gorm:"column:email;index"`
	MobileOTP        string     `gorm:"column:mobile_otp" json:"mobile_otp"`
	EmailOTP         string     `gorm:"column:email_otp" json:"email_otp"`
	MobileAttempts   int        `gorm:"column:mobile_attempts" json:"mobile_attempts"`
	EmailAttempts    int        `gorm:"column:email_attempts" json:"email_attempts"`
	MaxAttempts      int        `gorm:"column:max_attempts" json:"max_attempts"`
	ResendCount      int        `gorm:"column:resend_count" json:"resend_count"`
	IsMobileVerified bool       `gorm:"column:is_mobile_verified" json:"is_mobile_verified"`
	IsEmailVerified  bool       `gorm:"column:is_email_verified" json:"is_email_verified"`
	ExpiresAt        *time.Time `gorm:"column:expires_at" json:"expires_at"`
	CreatedAt        *time.Time `gorm:"column:created_at" json:"created_at"`
	UpdatedAt        *time.Time `gorm:"column:updated_at" json:"updated_at"`
}

func (UserOTP) TableName() string {
	return "user_otps"
}
