package entity

import (
	"github.com/google/uuid"
	"time"
)

type OneTimePasswords struct {
	ID         uint       `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	Email      string     `json:"email" gorm:"type:varchar"`
	Name       *string    `json:"name" gorm:"type:varchar"`
	Identity   *string    `json:"identity" gorm:"type:varchar"`
	OtpCode    string     `json:"otp_code" gorm:"type:varchar"`
	ValidUntil time.Time  `json:"valid_until" gorm:"default:(NOW() + INTERVAL '10 minutes')"`
	ClientId   *uuid.UUID `json:"client_id" gorm:"type:UUID"`
	IsActive   bool       `json:"is_active" gorm:"type:bool"`
	CreatedAt  time.Time  `json:"created_at" gorm:"default:now()"`
}
