add user management functionality with OTP verification and consent handling, DI introduced
This commit is contained in:
27
internal/api/user/domain/user_domain.go
Normal file
27
internal/api/user/domain/user_domain.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user