mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-16 11:46:56 +02:00
feat(story-1.3): add user registration API with Argon2 password hashing
This commit is contained in:
1 parent
caa1d885b6
commit
e186a4dd87
7 files changed
+361
-4
No files matched your search
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user