This commit is contained in:
Timur Kh.
2025-12-15 22:28:01 +03:00
parent 4a17c75d6f
commit f7a7b19275
25 changed files with 1383 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
package domain
import "errors"
var (
ErrUserNotFound = errors.New("user not found")
ErrInvalidEmail = errors.New("invalid email")
ErrInvalidPassword = errors.New("invalid password")
ErrUserAlreadyExists = errors.New("user already exists")
ErrInvalidToken = errors.New("invalid token")
)
+13
View File
@@ -0,0 +1,13 @@
package domain
import "github.com/google/uuid"
type ID = uuid.UUID
func NewID() ID {
return uuid.New()
}
func ParseID(s string) (ID, error) {
return uuid.Parse(s)
}
+19
View File
@@ -0,0 +1,19 @@
package domain
import "time"
type User struct {
ID ID
Email string
Username string
Password string
CreatedAt time.Time
UpdatedAt time.Time
}
type UserWithoutPassword struct {
ID ID
Email string
Username string
CreatedAt time.Time
}