Files
online-backend/internal/identity/auth/storage.go

17 lines
780 B
Go
Executable File

package auth
import "context"
type Repository interface {
Login(ctx context.Context, dto LoginDTO) (UserCredentials, error)
GetUserByID(ctx context.Context, id int) (UserCredentials, error)
GetProfile(ctx context.Context, id int) (UserProfileDTO, error)
UpdateProfile(ctx context.Context, id int, dto UpdateProfileDTO) (UserProfileDTO, error)
UserExists(ctx context.Context, username, phone string) (bool, error)
UsernameTaken(ctx context.Context, username, exceptPhone string) (bool, error)
UpsertVerification(ctx context.Context, v Verification) error
GetVerificationByPhone(ctx context.Context, phone string) (Verification, error)
IncrementVerifyAttempts(ctx context.Context, id int64) error
CompleteRegistration(ctx context.Context, v Verification) (int, error)
}