add user management functionality with OTP verification and consent handling, DI introduced

This commit is contained in:
2025-08-10 10:38:49 +03:00
parent 6a9061a3de
commit 5d80a68b44
30 changed files with 828 additions and 528 deletions

View File

@ -0,0 +1,27 @@
package domain
import (
"context"
db "git.logidex.ru/fakz9/logidex-id/internal/db/generated"
)
type User struct {
Uuid string `json:"uuid"`
PhoneNumber string `json:"phone_number"`
}
type UserRepository interface {
GetUserByPhoneNumber(ctx context.Context, phoneNumber string) (*db.User, error)
GetUserByUuid(ctx context.Context, uuid string) (*db.User, error)
CreateUser(ctx context.Context, phoneNumber string) (*db.User, error)
VerifyUser(ctx context.Context, uuid string) (*db.User, error)
}
type ErrUserNotFound struct {
PhoneNumber string
}
func (e ErrUserNotFound) Error() string {
return "User not found with phone number: " + e.PhoneNumber
}