linting
This commit is contained in:
@@ -57,7 +57,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
}
|
||||
return achievement;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding achievement by id ${id}:`, error);
|
||||
this.logger.error(`Error finding achievement by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Found ${achievements.length} achievements.`);
|
||||
return achievements;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all achievements:', error);
|
||||
this.logger.error('Error finding all achievements:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Found ${achievements.length} achievements for category: ${category}.`);
|
||||
return achievements;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding achievements by category ${category}:`, error);
|
||||
this.logger.error(`Error finding achievements by category ${category}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Achievement ${achievement.id} created successfully.`);
|
||||
return achievement;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating achievement ${achievement.id}:`, error);
|
||||
this.logger.error(`Error creating achievement ${achievement.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
}
|
||||
return userAchievement;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user achievement by id ${id}:`, error);
|
||||
this.logger.error(`Error finding user achievement by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Found ${userAchievements.length} user achievements for user id: ${userId}.`);
|
||||
return userAchievements;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user achievements by user id ${userId}:`, error);
|
||||
this.logger.error(`Error finding user achievements by user id ${userId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.debug(`User ${userId} earned achievement ${achievementId}: ${hasEarned}.`);
|
||||
return hasEarned;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking if user ${userId} earned achievement ${achievementId}:`, error);
|
||||
this.logger.error(`Error checking if user ${userId} earned achievement ${achievementId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`UserAchievement ${userAchievement.id} created successfully.`);
|
||||
return userAchievement;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating user achievement ${userAchievement.id}:`, error);
|
||||
this.logger.error(`Error creating user achievement ${userAchievement.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`UserAchievement ${userAchievement.id} updated successfully.`);
|
||||
return userAchievement;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating user achievement ${userAchievement.id}:`, error);
|
||||
this.logger.error(`Error updating user achievement ${userAchievement.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Generated achievement leaderboard with ${leaderboard.length} entries.`);
|
||||
return leaderboard;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting achievement leaderboard:`, error);
|
||||
this.logger.error(`Error getting achievement leaderboard:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ export class InMemoryAchievementRepository implements IAchievementRepository {
|
||||
this.logger.info(`Generated achievement stats for user ${userId}:`, stats);
|
||||
return stats;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting user achievement stats for user ${userId}:`, error);
|
||||
this.logger.error(`Error getting user achievement stats for user ${userId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
this.accounts.set(account.getId().value, account);
|
||||
this.logger.info(`Sponsor account ${account.getId().value} saved successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving sponsor account ${account.getId().value}:`, error);
|
||||
this.logger.error(`Error saving sponsor account ${account.getId().value}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
}
|
||||
return account;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding sponsor account by id ${id.value}:`, error);
|
||||
this.logger.error(`Error finding sponsor account by id ${id.value}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
}
|
||||
return account;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding sponsor account by sponsor id ${sponsorId}:`, error);
|
||||
this.logger.error(`Error finding sponsor account by sponsor id ${sponsorId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
}
|
||||
return account;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding sponsor account by email ${email}:`, error);
|
||||
this.logger.error(`Error finding sponsor account by email ${email}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
this.logger.warn(`Sponsor account with id ${id.value} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting sponsor account ${id.value}:`, error);
|
||||
this.logger.error(`Error deleting sponsor account ${id.value}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ export class InMemorySponsorAccountRepository implements ISponsorAccountReposito
|
||||
});
|
||||
this.logger.info(`Successfully seeded ${accounts.length} sponsor accounts.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding sponsor accounts:`, error);
|
||||
this.logger.error(`Error seeding sponsor accounts:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
}
|
||||
return rating;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user rating for user id ${userId}:`, error);
|
||||
this.logger.error(`Error finding user rating for user id ${userId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.info(`User rating for user id ${rating.userId} saved successfully.`);
|
||||
return rating;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving user rating for user id ${rating.userId}:`, error);
|
||||
this.logger.error(`Error saving user rating for user id ${rating.userId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.info(`Retrieved ${topDrivers.length} top drivers.`);
|
||||
return topDrivers;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting top drivers:`, error);
|
||||
this.logger.error(`Error getting top drivers:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.info(`Retrieved ${topTrusted.length} top trusted users.`);
|
||||
return topTrusted;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting top trusted users:`, error);
|
||||
this.logger.error(`Error getting top trusted users:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.info(`Found ${eligibleStewards.length} eligible stewards.`);
|
||||
return eligibleStewards;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting eligible stewards:`, error);
|
||||
this.logger.error(`Error getting eligible stewards:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.info(`Found ${ratingsByTier.length} user ratings for driver tier: ${tier}.`);
|
||||
return ratingsByTier;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user ratings by driver tier ${tier}:`, error);
|
||||
this.logger.error(`Error finding user ratings by driver tier ${tier}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
this.logger.warn(`User rating for user id ${userId} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting user rating for user id ${userId}:`, error);
|
||||
this.logger.error(`Error deleting user rating for user id ${userId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { Logger } from '@core/shared/application';
|
||||
import type { IUserRepository, StoredUser } from '../../domain/repositories/IUserRepository';
|
||||
import type { IUserRepository, StoredUser } from '@core/identity/domain/repositories/IUserRepository';
|
||||
|
||||
export class InMemoryUserRepository implements IUserRepository {
|
||||
private users: Map<string, StoredUser> = new Map();
|
||||
@@ -38,7 +38,7 @@ export class InMemoryUserRepository implements IUserRepository {
|
||||
}
|
||||
return user;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user by email ${email}:`, error);
|
||||
this.logger.error(`Error finding user by email ${email}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export class InMemoryUserRepository implements IUserRepository {
|
||||
}
|
||||
return user;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding user by id ${id}:`, error);
|
||||
this.logger.error(`Error finding user by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export class InMemoryUserRepository implements IUserRepository {
|
||||
this.logger.info(`User ${user.id} (${user.email}) created successfully.`);
|
||||
return user;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating user ${user.id} (${user.email}):`, error);
|
||||
this.logger.error(`Error creating user ${user.id} (${user.email}):`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export class InMemoryUserRepository implements IUserRepository {
|
||||
this.logger.info(`User ${user.id} (${user.email}) updated successfully.`);
|
||||
return user;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating user ${user.id} (${user.email}):`, error);
|
||||
this.logger.error(`Error updating user ${user.id} (${user.email}):`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export class InMemoryUserRepository implements IUserRepository {
|
||||
this.logger.debug(`Email ${email} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of email ${email}:`, error);
|
||||
this.logger.error(`Error checking existence of email ${email}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user