fix: manually delete user when invite could not be consumed - since transactions in the handler are not yet supported

This commit is contained in:
2026-08-31 21:31:53 +02:00
parent 4b91e7b32c
commit 8479b8ac4b
3 changed files with 36 additions and 3 deletions
+9
View File
@@ -24,6 +24,7 @@ type User struct {
type UserRepository interface {
CreateUser(ctx context.Context, email string, name string, passwordHash string) (*User, error)
DeleteUser(ctx context.Context, userID string) error
ChangePassword(ctx context.Context, userID string, passwordHash string) error
GetUserByEmail(ctx context.Context, email string) (*User, error)
}
@@ -55,6 +56,14 @@ func (s *UserService) CreateUser(ctx context.Context, email string, name string,
return s.repo.CreateUser(ctx, email, name, string(hash))
}
func (s *UserService) DeleteUser(ctx context.Context, userID string) error {
if len(userID) == 0 {
return ErrUserIDMissing
}
return s.repo.DeleteUser(ctx, userID)
}
func (s *UserService) ChangePassword(ctx context.Context, userID string, password string) error {
if len(userID) == 0 {
return ErrUserIDMissing