linting
This commit is contained in:
@@ -23,7 +23,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
this.snapshots.set(snapshot.id, snapshot);
|
||||
this.logger.info(`AnalyticsSnapshot ${snapshot.id} saved successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving AnalyticsSnapshot ${snapshot.id}:`, error);
|
||||
this.logger.error(`Error saving AnalyticsSnapshot ${snapshot.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
}
|
||||
return snapshot;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding AnalyticsSnapshot by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding AnalyticsSnapshot by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
this.logger.info(`Found ${snapshots.length} AnalyticsSnapshots for entity ${entityId}.`);
|
||||
return snapshots;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding AnalyticsSnapshots for entity ${entityId}:`, error);
|
||||
this.logger.error(`Error finding AnalyticsSnapshots for entity ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
}
|
||||
return snapshot;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding AnalyticsSnapshot by period for entity ${entityId}:`, error);
|
||||
this.logger.error(`Error finding AnalyticsSnapshot by period for entity ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
}
|
||||
return snapshot;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding latest AnalyticsSnapshot for entity ${entityId}:`, error);
|
||||
this.logger.error(`Error finding latest AnalyticsSnapshot for entity ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRe
|
||||
this.logger.info(`Found ${snapshots.length} historical AnalyticsSnapshots for entity ${entityId}, period ${period}.`);
|
||||
return snapshots;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting historical AnalyticsSnapshots for entity ${entityId}:`, error);
|
||||
this.logger.error(`Error getting historical AnalyticsSnapshots for entity ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* In-memory implementation of IEngagementRepository for development/testing.
|
||||
*/
|
||||
|
||||
import type { IEngagementRepository } from '../../domain/repositories/IEngagementRepository';
|
||||
import { EngagementEvent, type EngagementAction, type EngagementEntityType } from '../../domain/entities/EngagementEvent';
|
||||
import type { IEngagementRepository } from '@core/analytics/domain/repositories/IEngagementRepository';
|
||||
import { EngagementEvent, type EngagementAction, type EngagementEntityType } from '@core/analytics/domain/entities/EngagementEvent';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.events.set(event.id, event);
|
||||
this.logger.info(`Successfully saved engagement event: ${event.id}`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving engagement event ${event.id}:`, error);
|
||||
this.logger.error(`Error saving engagement event ${event.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
}
|
||||
return event;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding engagement event by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding engagement event by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.logger.info(`Found ${events.length} engagement events for entityType: ${entityType}, entityId: ${entityId}`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding engagement events by entity ID ${entityId}:`, error);
|
||||
this.logger.error(`Error finding engagement events by entity ID ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.logger.info(`Found ${events.length} engagement events for action: ${action}`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding engagement events by action ${action}:`, error);
|
||||
this.logger.error(`Error finding engagement events by action ${action}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.logger.info(`Found ${events.length} engagement events for date range.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding engagement events by date range:`, error);
|
||||
this.logger.error(`Error finding engagement events by date range:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.logger.info(`Counted ${count} engagement events for action: ${action}, entityId: ${entityId}`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error counting engagement events by action ${action}:`, error);
|
||||
this.logger.error(`Error counting engagement events by action ${action}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
this.logger.info(`Counted ${count} sponsor clicks for entity ID: ${entityId}`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting sponsor clicks for entity ID ${entityId}:`, error);
|
||||
this.logger.error(`Error getting sponsor clicks for entity ID ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
events.forEach(e => this.events.set(e.id, e));
|
||||
this.logger.info(`Successfully seeded ${events.length} engagement events.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding engagement events:`, error);
|
||||
this.logger.error(`Error seeding engagement events:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* In-memory implementation of IPageViewRepository for development/testing.
|
||||
*/
|
||||
|
||||
import type { IPageViewRepository } from '../../domain/repositories/IPageViewRepository';
|
||||
import { PageView, type EntityType } from '../../domain/entities/PageView';
|
||||
import type { IPageViewRepository } from '@core/analytics/application/repositories/IPageViewRepository';
|
||||
import { PageView, type EntityType } from '@core/analytics/domain/entities/PageView';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
@@ -23,7 +23,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.pageViews.set(pageView.id, pageView);
|
||||
this.logger.info(`Successfully saved page view: ${pageView.id}`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving page view ${pageView.id}:`, error);
|
||||
this.logger.error(`Error saving page view ${pageView.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
}
|
||||
return pageView;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding page view by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding page view by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.logger.info(`Found ${pageViews.length} page views for entityType: ${entityType}, entityId: ${entityId}`);
|
||||
return pageViews;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding page views by entity ID ${entityId}:`, error);
|
||||
this.logger.error(`Error finding page views by entity ID ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.logger.info(`Found ${pageViews.length} page views for date range.`);
|
||||
return pageViews;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding page views by date range:`, error);
|
||||
this.logger.error(`Error finding page views by date range:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.logger.info(`Found ${pageViews.length} page views for session ID: ${sessionId}`);
|
||||
return pageViews;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding page views by session ID ${sessionId}:`, error);
|
||||
this.logger.error(`Error finding page views by session ID ${sessionId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.logger.info(`Counted ${count} page views for entityType: ${entityType}, entityId: ${entityId}`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error counting page views by entity ID ${entityId}:`, error);
|
||||
this.logger.error(`Error counting page views by entity ID ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
this.logger.info(`Counted ${visitors.size} unique visitors for entityType: ${entityType}, entityId: ${entityId}`);
|
||||
return visitors.size;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error counting unique visitors for entity ID ${entityId}:`, error);
|
||||
this.logger.error(`Error counting unique visitors for entity ID ${entityId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
pageViews.forEach(pv => this.pageViews.set(pv.id, pv));
|
||||
this.logger.info(`Successfully seeded ${pageViews.length} page views.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding page views:`, error);
|
||||
this.logger.error(`Error seeding page views:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ILogger as Logger } from "@gridpilot/core/shared/application";
|
||||
import { Logger } from "@core/shared/application";
|
||||
|
||||
export class ConsoleLogger implements Logger {
|
||||
debug(message: string, ...args: any[]): void {
|
||||
|
||||
@@ -33,7 +33,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
}
|
||||
return notification;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding notification by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding notification by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Found ${notifications.length} notifications for recipient ID: ${recipientId}.`);
|
||||
return notifications;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error finding notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Found ${notifications.length} unread notifications for recipient ID: ${recipientId}.`);
|
||||
return notifications;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding unread notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error finding unread notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.info(`Counted ${count} unread notifications for recipient ID: ${recipientId}.`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error counting unread notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error counting unread notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.notifications.set(notification.id, notification);
|
||||
this.logger.info(`Notification ${notification.id} created successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating notification ${notification.id}:`, error);
|
||||
this.logger.error(`Error creating notification ${notification.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.notifications.set(notification.id, notification);
|
||||
this.logger.info(`Notification ${notification.id} updated successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating notification ${notification.id}:`, error);
|
||||
this.logger.error(`Error updating notification ${notification.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
this.logger.warn(`Notification with ID ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting notification ${id}:`, error);
|
||||
this.logger.error(`Error deleting notification ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
toDelete.forEach(id => this.notifications.delete(id));
|
||||
this.logger.info(`Deleted ${toDelete.length} notifications for recipient ID: ${recipientId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting all notifications for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error deleting all notifications for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
});
|
||||
this.logger.info(`Marked ${toUpdate.length} notifications as read for recipient ID: ${recipientId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error marking all notifications as read for recipient ID ${recipientId}:`, error);
|
||||
this.logger.error(`Error marking all notifications as read for recipient ID ${recipientId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
}
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding car by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding car by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all cars:', error);
|
||||
this.logger.error('Error finding all cars:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for game ID: ${gameId}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by game ID ${gameId}:`, error);
|
||||
this.logger.error(`Error finding cars by game ID ${gameId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for class: ${carClass}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by class ${carClass}:`, error);
|
||||
this.logger.error(`Error finding cars by class ${carClass}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for license: ${license}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by license ${license}:`, error);
|
||||
this.logger.error(`Error finding cars by license ${license}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for manufacturer: ${manufacturer}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by manufacturer ${manufacturer}:`, error);
|
||||
this.logger.error(`Error finding cars by manufacturer ${manufacturer}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars matching search query: ${query}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error searching cars by name query ${query}:`, error);
|
||||
this.logger.error(`Error searching cars by name query ${query}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car ${car.id} created successfully.`);
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating car ${car.id}:`, error);
|
||||
this.logger.error(`Error creating car ${car.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car ${car.id} updated successfully.`);
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating car ${car.id}:`, error);
|
||||
this.logger.error(`Error updating car ${car.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.cars.delete(id);
|
||||
this.logger.info(`Car ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting car ${id}:`, error);
|
||||
this.logger.error(`Error deleting car ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car with ID ${id} existence check: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of car with ID ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of car with ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
}
|
||||
return wallet;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding league wallet by id ${id}:`, error);
|
||||
this.logger.error(`Error finding league wallet by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
this.logger.warn(`No league wallet found for league id: ${leagueId}.`);
|
||||
return null;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding league wallet by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding league wallet by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
this.logger.info(`LeagueWallet ${wallet.id} created successfully.`);
|
||||
return wallet;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating league wallet ${wallet.id}:`, error);
|
||||
this.logger.error(`Error creating league wallet ${wallet.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
this.logger.info(`LeagueWallet ${wallet.id} updated successfully.`);
|
||||
return wallet;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating league wallet ${wallet.id}:`, error);
|
||||
this.logger.error(`Error updating league wallet ${wallet.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
this.logger.warn(`LeagueWallet with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting league wallet ${id}:`, error);
|
||||
this.logger.error(`Error deleting league wallet ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
this.logger.debug(`LeagueWallet ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of league wallet with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of league wallet with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
}
|
||||
return livery;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding driver livery by id ${id}:`, error);
|
||||
this.logger.error(`Error finding driver livery by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`Found ${liveries.length} driver liveries for driver id: ${driverId}.`);
|
||||
return liveries;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding driver liveries by driver id ${driverId}:`, error);
|
||||
this.logger.error(`Error finding driver liveries by driver id ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`Found ${liveries.length} driver liveries for game id: ${gameId}.`);
|
||||
return liveries;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding driver liveries by game id ${gameId}:`, error);
|
||||
this.logger.error(`Error finding driver liveries by game id ${gameId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`DriverLivery ${livery.id} created successfully.`);
|
||||
return livery;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating driver livery ${livery.id}:`, error);
|
||||
this.logger.error(`Error creating driver livery ${livery.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`DriverLivery ${livery.id} updated successfully.`);
|
||||
return livery;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating driver livery ${livery.id}:`, error);
|
||||
this.logger.error(`Error updating driver livery ${livery.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.warn(`DriverLivery with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting driver livery ${id}:`, error);
|
||||
this.logger.error(`Error deleting driver livery ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
}
|
||||
return template;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding livery template by id ${id}:`, error);
|
||||
this.logger.error(`Error finding livery template by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`Found ${templates.length} livery templates for season id: ${seasonId}.`);
|
||||
return templates;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding livery templates by season id ${seasonId}:`, error);
|
||||
this.logger.error(`Error finding livery templates by season id ${seasonId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`LiveryTemplate ${template.id} created successfully.`);
|
||||
return template;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating livery template ${template.id}:`, error);
|
||||
this.logger.error(`Error creating livery template ${template.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -218,7 +218,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.info(`LiveryTemplate ${template.id} updated successfully.`);
|
||||
return template;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating livery template ${template.id}:`, error);
|
||||
this.logger.error(`Error updating livery template ${template.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
this.logger.warn(`LiveryTemplate with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting livery template ${id}:`, error);
|
||||
this.logger.error(`Error deleting livery template ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
}
|
||||
return penalty;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalty by id ${id}:`, error);
|
||||
this.logger.error(`Error finding penalty by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for race id: ${raceId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by race id ${raceId}:`, error);
|
||||
this.logger.error(`Error finding penalties by race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for driver id: ${driverId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by driver id ${driverId}:`, error);
|
||||
this.logger.error(`Error finding penalties by driver id ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for protest id: ${protestId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by protest id ${protestId}:`, error);
|
||||
this.logger.error(`Error finding penalties by protest id ${protestId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} pending penalties.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding pending penalties:', error);
|
||||
this.logger.error('Error finding pending penalties:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties issued by steward: ${stewardId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties issued by steward ${stewardId}:`, error);
|
||||
this.logger.error(`Error finding penalties issued by steward ${stewardId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.penalties.set(penalty.id, penalty);
|
||||
this.logger.info(`Penalty ${penalty.id} created successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating penalty ${penalty.id}:`, error);
|
||||
this.logger.error(`Error creating penalty ${penalty.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.penalties.set(penalty.id, penalty);
|
||||
this.logger.info(`Penalty ${penalty.id} updated successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating penalty ${penalty.id}:`, error);
|
||||
this.logger.error(`Error updating penalty ${penalty.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.debug(`Penalty ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of penalty with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of penalty with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
}
|
||||
return event;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding race event by id ${id}:`, error);
|
||||
this.logger.error(`Error finding race event by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Found ${events.length} race events.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all race events:', error);
|
||||
this.logger.error('Error finding all race events:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Found ${events.length} race events for season id: ${seasonId}.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding race events by season id ${seasonId}:`, error);
|
||||
this.logger.error(`Error finding race events by season id ${seasonId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Found ${events.length} race events for league id: ${leagueId}.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding race events by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding race events by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Found ${events.length} race events with status: ${status}.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding race events by status ${status}:`, error);
|
||||
this.logger.error(`Error finding race events by status ${status}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Found ${events.length} race events awaiting stewarding close.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding race events awaiting stewarding close:', error);
|
||||
this.logger.error('Error finding race events awaiting stewarding close:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Race event ${raceEvent.id} created successfully.`);
|
||||
return raceEvent;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating race event ${raceEvent.id}:`, error);
|
||||
this.logger.error(`Error creating race event ${raceEvent.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Race event ${raceEvent.id} updated successfully.`);
|
||||
return raceEvent;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating race event ${raceEvent.id}:`, error);
|
||||
this.logger.error(`Error updating race event ${raceEvent.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.warn(`Race event with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting race event ${id}:`, error);
|
||||
this.logger.error(`Error deleting race event ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.debug(`Race event ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of race event with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of race event with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
this.logger.info(`Retrieved ${events.length} race events.`);
|
||||
return events;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting all race events:`, error);
|
||||
this.logger.error(`Error getting all race events:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
}
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding result by id ${id}:`, error);
|
||||
this.logger.error(`Error finding result by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all results:', error);
|
||||
this.logger.error('Error finding all results:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for race id: ${raceId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error finding results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for driver id: ${driverId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for driver id ${driverId}:`, error);
|
||||
this.logger.error(`Error finding results for driver id ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for driver ${driverId} in league ${leagueId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for driver ${driverId} and league ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding results for driver ${driverId} and league ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Result ${result.id} created successfully.`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating result ${result.id}:`, error);
|
||||
this.logger.error(`Error creating result ${result.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
|
||||
return created;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating many results:`, error);
|
||||
this.logger.error(`Error creating many results:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Result ${result.id} updated successfully.`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating result ${result.id}:`, error);
|
||||
this.logger.error(`Error updating result ${result.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.results.delete(id);
|
||||
this.logger.info(`Result ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting result ${id}:`, error);
|
||||
this.logger.error(`Error deleting result ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
});
|
||||
this.logger.info(`Deleted ${raceResults.length} results for race id: ${raceId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error deleting results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.debug(`Result ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of result with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of result with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.debug(`Results for race ${raceId} exist: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error checking existence of results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ export class InMemoryGameRepository implements IGameRepository {
|
||||
}
|
||||
return game;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding game by id ${id}:`, error);
|
||||
this.logger.error(`Error finding game by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ export class InMemoryGameRepository implements IGameRepository {
|
||||
this.logger.info(`Found ${games.length} games.`);
|
||||
return games;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all games:', error);
|
||||
this.logger.error('Error finding all games:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ export class InMemoryGameRepository implements IGameRepository {
|
||||
this.games.push(game);
|
||||
this.logger.info(`Game ${game.id} seeded successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding game ${game.id}:`, error);
|
||||
this.logger.error(`Error seeding game ${game.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -333,7 +333,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
}
|
||||
return season;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding season by id ${id}:`, error);
|
||||
this.logger.error(`Error finding season by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -345,7 +345,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.logger.info(`Found ${seasons.length} seasons for league id: ${leagueId}.`);
|
||||
return seasons;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding seasons by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding seasons by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.logger.info(`Season ${season.id} created successfully.`);
|
||||
return season;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating season ${season.id}:`, error);
|
||||
this.logger.error(`Error creating season ${season.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -369,7 +369,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.seasons.push(season);
|
||||
this.logger.info(`Season ${season.id} added successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error adding season ${season.id}:`, error);
|
||||
this.logger.error(`Error adding season ${season.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -386,7 +386,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.seasons[index] = season;
|
||||
this.logger.info(`Season ${season.id} updated successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating season ${season.id}:`, error);
|
||||
this.logger.error(`Error updating season ${season.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -398,7 +398,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.logger.info(`Found ${seasons.length} seasons for league id: ${leagueId}.`);
|
||||
return seasons;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error listing seasons by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error listing seasons by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -412,7 +412,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.logger.info(`Found ${seasons.length} active seasons for league id: ${leagueId}.`);
|
||||
return seasons;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error listing active seasons by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error listing active seasons by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -423,7 +423,7 @@ export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
this.seasons.push(season);
|
||||
this.logger.info(`Season ${season.id} seeded successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding season ${season.id}:`, error);
|
||||
this.logger.error(`Error seeding season ${season.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,7 @@ export class InMemoryLeagueScoringConfigRepository
|
||||
}
|
||||
return config;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding league scoring config for seasonId ${seasonId}:`, error);
|
||||
this.logger.error(`Error finding league scoring config for seasonId ${seasonId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -472,7 +472,7 @@ export class InMemoryLeagueScoringConfigRepository
|
||||
}
|
||||
return config;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving league scoring config ${config.id}:`, error);
|
||||
this.logger.error(`Error saving league scoring config ${config.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -483,7 +483,7 @@ export class InMemoryLeagueScoringConfigRepository
|
||||
this.configs.push(config);
|
||||
this.logger.info(`League scoring config ${config.id} seeded successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding league scoring config ${config.id}:`, error);
|
||||
this.logger.error(`Error seeding league scoring config ${config.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -524,7 +524,7 @@ export class InMemoryChampionshipStandingRepository
|
||||
this.standings = standings;
|
||||
this.logger.info(`${standings.length} championship standings saved.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving championship standings:`, error);
|
||||
this.logger.error(`Error saving championship standings:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -535,7 +535,7 @@ export class InMemoryChampionshipStandingRepository
|
||||
this.standings.push(standing);
|
||||
this.logger.info(`Championship standing ${standing.id} seeded successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding championship standing ${standing.id}:`, error);
|
||||
this.logger.error(`Error seeding championship standing ${standing.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -547,7 +547,7 @@ export class InMemoryChampionshipStandingRepository
|
||||
this.logger.info(`Retrieved ${standings.length} championship standings.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting all championship standings:`, error);
|
||||
this.logger.error(`Error getting all championship standings:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Mock repository for testing and development
|
||||
*/
|
||||
|
||||
import type { SeasonSponsorship, SponsorshipTier } from '../../domain/entities/SeasonSponsorship';
|
||||
import type { ISeasonSponsorshipRepository } from '../../domain/repositories/ISeasonSponsorshipRepository';
|
||||
import type { SeasonSponsorship, SponsorshipTier } from '@core/racing/domain/entities/SeasonSponsorship';
|
||||
import type { ISeasonSponsorshipRepository } from '@core/racing/domain/repositories/ISeasonSponsorshipRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRepository {
|
||||
@@ -31,7 +31,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
}
|
||||
return sponsorship;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding season sponsorship by id ${id}:`, error);
|
||||
this.logger.error(`Error finding season sponsorship by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.info(`Found ${sponsorships.length} season sponsorships for season id: ${seasonId}.`);
|
||||
return sponsorships;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding season sponsorships by season id ${seasonId}:`, error);
|
||||
this.logger.error(`Error finding season sponsorships by season id ${seasonId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.info(`Found ${sponsorships.length} season sponsorships for league id: ${leagueId}.`);
|
||||
return sponsorships;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding season sponsorships by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding season sponsorships by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.info(`Found ${sponsorships.length} season sponsorships for sponsor id: ${sponsorId}.`);
|
||||
return sponsorships;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding season sponsorships by sponsor id ${sponsorId}:`, error);
|
||||
this.logger.error(`Error finding season sponsorships by sponsor id ${sponsorId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.info(`SeasonSponsorship ${sponsorship.id} created successfully.`);
|
||||
return sponsorship;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating season sponsorship ${sponsorship.id}:`, error);
|
||||
this.logger.error(`Error creating season sponsorship ${sponsorship.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.info(`SeasonSponsorship ${sponsorship.id} updated successfully.`);
|
||||
return sponsorship;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating season sponsorship ${sponsorship.id}:`, error);
|
||||
this.logger.error(`Error updating season sponsorship ${sponsorship.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.warn(`SeasonSponsorship with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting season sponsorship ${id}:`, error);
|
||||
this.logger.error(`Error deleting season sponsorship ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
this.logger.debug(`SeasonSponsorship ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of season sponsorship with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of season sponsorship with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRe
|
||||
}
|
||||
this.logger.info(`Successfully seeded ${sponsorships.length} season sponsorships.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding season sponsorships:`, error);
|
||||
this.logger.error(`Error seeding season sponsorships:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
}
|
||||
return session;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding session by id ${id}:`, error);
|
||||
this.logger.error(`Error finding session by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Found ${sessions.length} sessions.`);
|
||||
return sessions;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all sessions:', error);
|
||||
this.logger.error('Error finding all sessions:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Found ${sessions.length} sessions for race event id: ${raceEventId}.`);
|
||||
return sessions;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding sessions by race event id ${raceEventId}:`, error);
|
||||
this.logger.error(`Error finding sessions by race event id ${raceEventId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Found ${sessions.length} sessions with status: ${status}.`);
|
||||
return sessions;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding sessions by status ${status}:`, error);
|
||||
this.logger.error(`Error finding sessions by status ${status}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Session ${session.id} created successfully.`);
|
||||
return session;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating session ${session.id}:`, error);
|
||||
this.logger.error(`Error creating session ${session.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Session ${session.id} updated successfully.`);
|
||||
return session;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating session ${session.id}:`, error);
|
||||
this.logger.error(`Error updating session ${session.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.warn(`Session with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting session ${id}:`, error);
|
||||
this.logger.error(`Error deleting session ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.debug(`Session ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of session with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of session with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class InMemorySessionRepository implements ISessionRepository {
|
||||
this.logger.info(`Retrieved ${sessions.length} sessions.`);
|
||||
return sessions;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error getting all sessions:`, error);
|
||||
this.logger.error(`Error getting all sessions:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* InMemory implementation of ISponsorshipPricingRepository
|
||||
*/
|
||||
|
||||
import type { ISponsorshipPricingRepository } from '../../domain/repositories/ISponsorshipPricingRepository';
|
||||
import { SponsorshipPricing } from '../../domain/value-objects/SponsorshipPricing';
|
||||
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
|
||||
import type { ISponsorshipPricingRepository } from '@core/racing/domain/repositories/ISponsorshipPricingRepository';
|
||||
import { SponsorshipPricing } from '@core/racing/domain/value-objects/SponsorshipPricing';
|
||||
import type { SponsorableEntityType } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
interface StorageKey {
|
||||
@@ -103,7 +103,7 @@ export class InMemorySponsorshipPricingRepository implements ISponsorshipPricing
|
||||
this.logger.info(`Found ${accepting.length} entities accepting applications for type: ${entityType}.`);
|
||||
return accepting;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding accepting applications for entity type ${entityType}:`, error);
|
||||
this.logger.error(`Error finding accepting applications for entity type ${entityType}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ export class InMemorySponsorshipPricingRepository implements ISponsorshipPricing
|
||||
}
|
||||
this.logger.info(`Successfully seeded ${data.length} sponsorship pricing entries.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error seeding sponsorship pricing data:`, error);
|
||||
this.logger.error(`Error seeding sponsorship pricing data:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`Found ${standings.length} standings for league id: ${leagueId}.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding standings for league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding standings for league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`Found ${standings.length} standings.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all standings:', error);
|
||||
this.logger.error('Error finding all standings:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`${standings.length} standings saved successfully.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving many standings:`, error);
|
||||
this.logger.error(`Error saving many standings:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
});
|
||||
this.logger.info(`Deleted ${toDelete.length} standings for league id: ${leagueId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting standings by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error deleting standings by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
}
|
||||
|
||||
// Add points from this result
|
||||
standing = standing.addRaceResult(result.position, pointsSystem);
|
||||
standing = standing.addRaceResult(result.position, resolvedPointsSystem);
|
||||
standingsMap.set(result.driverId, standing);
|
||||
this.logger.debug(`Driver ${result.driverId} in league ${leagueId} accumulated ${standing.points} points.`);
|
||||
});
|
||||
@@ -288,7 +288,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
|
||||
return updatedStandings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error recalculating standings for league ${leagueId}:`, error);
|
||||
this.logger.error(`Error recalculating standings for league ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.logger.info(`[getActiveMembershipForDriver] Not found - no active membership for driver: ${driverId}.`);
|
||||
return null;
|
||||
} catch (error) {
|
||||
this.logger.error(`[getActiveMembershipForDriver] Error getting active membership for driver ${driverId}:`, error);
|
||||
this.logger.error(`[getActiveMembershipForDriver] Error getting active membership for driver ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.logger.info(`[getTeamMembers] Success - found ${members.length} members for team: ${teamId}.`);
|
||||
return members;
|
||||
} catch (error) {
|
||||
this.logger.error(`[getTeamMembers] Error getting team members for team ${teamId}:`, error);
|
||||
this.logger.error(`[getTeamMembers] Error getting team members for team ${teamId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.logger.info(`[countByTeamId] Success - counted ${count} active members for team: ${teamId}.`);
|
||||
return count;
|
||||
} catch (error) {
|
||||
this.logger.error(`[countByTeamId] Error counting members for team ${teamId}:`, error);
|
||||
this.logger.error(`[countByTeamId] Error counting members for team ${teamId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.logger.info(`[getJoinRequests] Success - found ${requests.length} join requests for team: ${teamId}.`);
|
||||
return requests;
|
||||
} catch (error) {
|
||||
this.logger.error(`[getJoinRequests] Error getting join requests for team ${teamId}:`, error);
|
||||
this.logger.error(`[getJoinRequests] Error getting join requests for team ${teamId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.joinRequestsByTeam.set(request.teamId, list);
|
||||
return request;
|
||||
} catch (error) {
|
||||
this.logger.error(`[saveJoinRequest] Error saving join request ${request.id}:`, error);
|
||||
this.logger.error(`[saveJoinRequest] Error saving join request ${request.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ async getMembership(teamId: string, driverId: string): Promise<TeamMembership |
|
||||
this.logger.warn(`[removeJoinRequest] Not found - join request with ID ${requestId} not found for removal.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`[removeJoinRequest] Error removing join request ${requestId}:`, error);
|
||||
this.logger.error(`[removeJoinRequest] Error removing join request ${requestId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
}
|
||||
return team;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding team by id ${id}:`, error);
|
||||
this.logger.error(`Error finding team by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.logger.info(`Found ${teams.length} teams.`);
|
||||
return teams;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all teams:', error);
|
||||
this.logger.error('Error finding all teams:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.logger.info(`Found ${teams.length} teams for league id: ${leagueId}.`);
|
||||
return teams;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding teams by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding teams by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.logger.info(`Team ${team.id} created successfully.`);
|
||||
return team;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating team ${team.id}:`, error);
|
||||
this.logger.error(`Error creating team ${team.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.logger.info(`Team ${team.id} updated successfully.`);
|
||||
return team;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating team ${team.id}:`, error);
|
||||
this.logger.error(`Error updating team ${team.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.teams.delete(id);
|
||||
this.logger.info(`Team ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting team ${id}:`, error);
|
||||
this.logger.error(`Error deleting team ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
|
||||
this.logger.debug(`Team ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of team with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of team with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
}
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding track by id ${id}:`, error);
|
||||
this.logger.error(`Error finding track by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all tracks:', error);
|
||||
this.logger.error('Error finding all tracks:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for game id: ${gameId}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by game id ${gameId}:`, error);
|
||||
this.logger.error(`Error finding tracks by game id ${gameId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for category: ${category}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by category ${category}:`, error);
|
||||
this.logger.error(`Error finding tracks by category ${category}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for country: ${country}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by country ${country}:`, error);
|
||||
this.logger.error(`Error finding tracks by country ${country}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks matching search query: ${query}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error searching tracks by name query ${query}:`, error);
|
||||
this.logger.error(`Error searching tracks by name query ${query}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Track ${track.id} created successfully.`);
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating track ${track.id}:`, error);
|
||||
this.logger.error(`Error creating track ${track.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Track ${track.id} updated successfully.`);
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating track ${track.id}:`, error);
|
||||
this.logger.error(`Error updating track ${track.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.tracks.delete(id);
|
||||
this.logger.info(`Track ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting track ${id}:`, error);
|
||||
this.logger.error(`Error deleting track ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.debug(`Track ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of track with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of track with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
}
|
||||
return transaction;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding transaction by id ${id}:`, error);
|
||||
this.logger.error(`Error finding transaction by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.info(`Found ${transactions.length} transactions for wallet id: ${walletId}.`);
|
||||
return transactions;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding transactions by wallet id ${walletId}:`, error);
|
||||
this.logger.error(`Error finding transactions by wallet id ${walletId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.info(`Found ${transactions.length} transactions of type: ${type}.`);
|
||||
return transactions;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding transactions by type ${type}:`, error);
|
||||
this.logger.error(`Error finding transactions by type ${type}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.info(`Transaction ${transaction.id} created successfully.`);
|
||||
return transaction;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating transaction ${transaction.id}:`, error);
|
||||
this.logger.error(`Error creating transaction ${transaction.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.info(`Transaction ${transaction.id} updated successfully.`);
|
||||
return transaction;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating transaction ${transaction.id}:`, error);
|
||||
this.logger.error(`Error updating transaction ${transaction.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.warn(`Transaction with id ${id} not found for deletion.`);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting transaction ${id}:`, error);
|
||||
this.logger.error(`Error deleting transaction ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
this.logger.debug(`Transaction ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of transaction with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of transaction with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user