add user model

This commit is contained in:
juancwu 2025-12-10 16:22:11 -05:00
commit 8db61212d9

17
internal/model/user.go Normal file
View file

@ -0,0 +1,17 @@
package model
import "time"
type User struct {
ID string `db:"id"`
Email string `db:"email"`
// Allow null for passwordless users
PasswordHash *string `db:"password_hash"`
PendingEmail *string `db:"pending_email"`
EmailVerifiedAt *time.Time `db:"email_verified_at"`
CreatedAt time.Time `db:"created_at"`
}
func (u *User) HasPassword() bool {
return u.PasswordHash != nil && *u.PasswordHash != ""
}