This commit is contained in:
2025-12-16 13:53:23 +01:00
parent 84f05598a6
commit 29dc11deb9
127 changed files with 538 additions and 547 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}