feat(story-1.3): add user registration API with Argon2 password hashing

This commit is contained in:
Michael committed 2026-02-04 14:41:42 +01:00
1 parent caa1d885b6
commit e186a4dd87
7 files changed
+361 -4

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
// Package domain contains business logic entities and interfaces.
package domain
import (
"time"
"github.com/google/uuid"
)
// User represents a registered user in the system.
type User struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
PasswordHash string `json:"-"` // Never expose in JSON
IsAdmin bool `json:"is_admin"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// UserRepository defines the interface for user data access.
type UserRepository interface {
Create(user *User) error
GetByEmail(email string) (*User, error)
GetByID(id uuid.UUID) (*User, error)
Exists(email string) (bool, error)
}