From 01378a06a52083a0072390cc5b1f4a403ce04f2b Mon Sep 17 00:00:00 2001 From: senke Date: Thu, 12 Mar 2026 05:47:47 +0100 Subject: [PATCH] fix(v0.12.6.1): update in-memory UserRepositoryImpl to accept context.Context Aligns the in-memory implementation with the updated services.UserRepository interface for consistency (HIGH-003 context propagation). Co-Authored-By: Claude Opus 4.6 --- .../internal/repository/user_repository.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/veza-backend-api/internal/repository/user_repository.go b/veza-backend-api/internal/repository/user_repository.go index 888343dc9..32afcf1d1 100644 --- a/veza-backend-api/internal/repository/user_repository.go +++ b/veza-backend-api/internal/repository/user_repository.go @@ -1,6 +1,7 @@ package repository import ( + "context" "errors" "sync" @@ -27,7 +28,7 @@ func NewUserRepository() *UserRepositoryImpl { } // GetByID récupère un utilisateur par son ID -func (r *UserRepositoryImpl) GetByID(id string) (*models.User, error) { +func (r *UserRepositoryImpl) GetByID(_ context.Context, id string) (*models.User, error) { r.mutex.RLock() defer r.mutex.RUnlock() @@ -42,7 +43,7 @@ func (r *UserRepositoryImpl) GetByID(id string) (*models.User, error) { } // GetByEmail récupère un utilisateur par son email -func (r *UserRepositoryImpl) GetByEmail(email string) (*models.User, error) { +func (r *UserRepositoryImpl) GetByEmail(_ context.Context, email string) (*models.User, error) { r.mutex.RLock() defer r.mutex.RUnlock() @@ -62,7 +63,7 @@ func (r *UserRepositoryImpl) GetByEmail(email string) (*models.User, error) { } // GetByUsername récupère un utilisateur par son username -func (r *UserRepositoryImpl) GetByUsername(username string) (*models.User, error) { +func (r *UserRepositoryImpl) GetByUsername(_ context.Context, username string) (*models.User, error) { r.mutex.RLock() defer r.mutex.RUnlock() @@ -82,7 +83,7 @@ func (r *UserRepositoryImpl) GetByUsername(username string) (*models.User, error } // Create crée un nouvel utilisateur -func (r *UserRepositoryImpl) Create(user *models.User) error { +func (r *UserRepositoryImpl) Create(_ context.Context, user *models.User) error { r.mutex.Lock() defer r.mutex.Unlock() @@ -116,7 +117,7 @@ func (r *UserRepositoryImpl) Create(user *models.User) error { } // Update met à jour un utilisateur existant -func (r *UserRepositoryImpl) Update(user *models.User) error { +func (r *UserRepositoryImpl) Update(_ context.Context, user *models.User) error { r.mutex.Lock() defer r.mutex.Unlock() @@ -158,7 +159,7 @@ func (r *UserRepositoryImpl) Update(user *models.User) error { } // Delete supprime un utilisateur -func (r *UserRepositoryImpl) Delete(id string) error { +func (r *UserRepositoryImpl) Delete(_ context.Context, id string) error { r.mutex.Lock() defer r.mutex.Unlock()