From 8db61212d99127d5832f422b38e4f66eaf115cba Mon Sep 17 00:00:00 2001 From: juancwu <46619361+juancwu@users.noreply.github.com> Date: Wed, 10 Dec 2025 16:22:11 -0500 Subject: [PATCH] add user model --- internal/model/user.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 internal/model/user.go diff --git a/internal/model/user.go b/internal/model/user.go new file mode 100644 index 0000000..a823efd --- /dev/null +++ b/internal/model/user.go @@ -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 != "" +}