refactor
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { IAnalyticsSnapshotRepository } from '../../domain/repositories/IAnalyticsSnapshotRepository';
|
||||
import { AnalyticsSnapshot, type SnapshotPeriod, type SnapshotEntityType } from '../../domain/entities/AnalyticsSnapshot';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryAnalyticsSnapshotRepository implements IAnalyticsSnapshotRepository {
|
||||
private snapshots: Map<string, AnalyticsSnapshot> = new Map();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { IEngagementRepository } from '../../domain/repositories/IEngagementRepository';
|
||||
import { EngagementEvent, type EngagementAction, type EngagementEntityType } from '../../domain/entities/EngagementEvent';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
|
||||
export class InMemoryEngagementRepository implements IEngagementRepository {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { IPageViewRepository } from '../../domain/repositories/IPageViewRepository';
|
||||
import { PageView, type EntityType } from '../../domain/entities/PageView';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryPageViewRepository implements IPageViewRepository {
|
||||
private pageViews: Map<string, PageView> = new Map();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { LogLevel } from '@gridpilot/automation/application/ports/LoggerLogLevel';
|
||||
import type { LogLevel } from '@core/automation/application/ports/LoggerLogLevel';
|
||||
|
||||
export type LogEnvironment = 'development' | 'production' | 'test';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SignupWithEmailUseCase } from '../../core/identity/application/use-cases/SignupWithEmailUseCase';
|
||||
import { SignupWithEmailUseCase } from '@core/identity/application/use-cases/SignupWithEmailUseCase';
|
||||
|
||||
/**
|
||||
* EnsureInitialData - Bootstrap script to ensure initial data exists.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* In-memory implementation of IAchievementRepository
|
||||
*/
|
||||
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
import {
|
||||
Achievement,
|
||||
AchievementCategory,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { IAuthRepository } from '@gridpilot/core/identity/domain/repositories/IAuthRepository';
|
||||
import { IUserRepository, StoredUser } from '@gridpilot/core/identity/domain/repositories/IUserRepository';
|
||||
import { IPasswordHashingService } from '@gridpilot/core/identity/domain/services/PasswordHashingService';
|
||||
import { User } from '@gridpilot/core/identity/domain/entities/User';
|
||||
import { IAuthRepository } from '@core/identity/domain/repositories/IAuthRepository';
|
||||
import { IUserRepository, StoredUser } from '@core/identity/domain/repositories/IUserRepository';
|
||||
import { IPasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
|
||||
import { EmailAddress } from '@gridpilot/core/identity/domain/value-objects/EmailAddress';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryAuthRepository implements IAuthRepository {
|
||||
constructor(
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { ISponsorAccountRepository } from '../../domain/repositories/ISponsorAccountRepository';
|
||||
import type { SponsorAccount } from '../../domain/entities/SponsorAccount';
|
||||
import type { UserId } from '../../domain/value-objects/UserId';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemorySponsorAccountRepository implements ISponsorAccountRepository {
|
||||
private accounts: Map<string, SponsorAccount> = new Map();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { UserRating } from '../../domain/value-objects/UserRating';
|
||||
import type { IUserRatingRepository } from '../../domain/repositories/IUserRatingRepository';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
private ratings: Map<string, UserRating> = new Map();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Stores users in memory for demo/development purposes.
|
||||
*/
|
||||
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { Logger } from '@core/shared/application';
|
||||
import type { IUserRepository, StoredUser } from '../../domain/repositories/IUserRepository';
|
||||
|
||||
export class InMemoryUserRepository implements IUserRepository {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* NOT FOR PRODUCTION USE - uses a simple string reversal as "hashing".
|
||||
*/
|
||||
|
||||
import type { IPasswordHashingService } from '@gridpilot/core/identity/domain/services/PasswordHashingService';
|
||||
import type { IPasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
|
||||
export class InMemoryPasswordHashingService implements IPasswordHashingService {
|
||||
async hash(plain: string): Promise<string> {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* Manages user session using cookies. This is a placeholder implementation.
|
||||
*/
|
||||
|
||||
import type { AuthenticatedUserDTO } from '@gridpilot/core/identity/application/dto/AuthenticatedUserDTO';
|
||||
import type { AuthSessionDTO } from '@gridpilot/core/identity/application/dto/AuthSessionDTO';
|
||||
import type { IdentitySessionPort } from '@gridpilot/core/identity/application/ports/IdentitySessionPort';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import type { AuthenticatedUserDTO } from '@core/identity/application/dto/AuthenticatedUserDTO';
|
||||
import type { AuthSessionDTO } from '@core/identity/application/dto/AuthSessionDTO';
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class CookieIdentitySessionAdapter implements IdentitySessionPort {
|
||||
private currentSession: AuthSessionDTO | null = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IAvatarGenerationRepository } from '@gridpilot/core/media/domain/repositories/IAvatarGenerationRepository';
|
||||
import { AvatarGenerationRequest } from '@gridpilot/core/media/domain/entities/AvatarGenerationRequest';
|
||||
import { Logger } from '@gridpilot/core/shared/application';
|
||||
import { IAvatarGenerationRepository } from '@core/media/domain/repositories/IAvatarGenerationRepository';
|
||||
import { AvatarGenerationRequest } from '@core/media/domain/entities/AvatarGenerationRequest';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
export class InMemoryAvatarGenerationRepository implements IAvatarGenerationRepository {
|
||||
private requests: Map<string, AvatarGenerationRequest> = new Map(); // Key: requestId
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { FaceValidationPort, FaceValidationResult } from '@gridpilot/core/media/application/ports/FaceValidationPort';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { FaceValidationPort, FaceValidationResult } from '@core/media/application/ports/FaceValidationPort';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryFaceValidationAdapter implements FaceValidationPort {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { IImageServicePort } from '@gridpilot/racing/application/ports/IImageServicePort';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { IImageServicePort } from '@core/racing/application/ports/IImageServicePort';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryImageServiceAdapter implements IImageServicePort {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { INotificationPreferenceRepository } from '@gridpilot/core/notifications/domain/repositories/INotificationPreferenceRepository';
|
||||
import { NotificationPreference } from '@gridpilot/core/notifications/domain/entities/NotificationPreference';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { INotificationPreferenceRepository } from '@core/notifications/domain/repositories/INotificationPreferenceRepository';
|
||||
import { NotificationPreference } from '@core/notifications/domain/entities/NotificationPreference';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryNotificationPreferenceRepository implements INotificationPreferenceRepository {
|
||||
private preferences: Map<string, NotificationPreference> = new Map();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Notification } from '../../domain/entities/Notification';
|
||||
import type { INotificationRepository } from '../../domain/repositories/INotificationRepository';
|
||||
import type { NotificationType } from '../../domain/types/NotificationTypes';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryNotificationRepository implements INotificationRepository {
|
||||
private notifications: Map<string, Notification> = new Map();
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* In-Memory Implementation: InMemoryMembershipFeeRepository
|
||||
*/
|
||||
|
||||
import type { Logger } from '@gridpilot/shared/application/Logger';
|
||||
import type { IMembershipFeeRepository, IMemberPaymentRepository } from '../../../../core/payments/domain/repositories/IMembershipFeeRepository';
|
||||
import type { MembershipFee } from '../../../../core/payments/domain/entities/MembershipFee';
|
||||
import type { MemberPayment } from '../../../../core/payments/domain/entities/MemberPayment';
|
||||
import type { Logger } from '@core/shared/application/Logger';
|
||||
import type { IMembershipFeeRepository, IMemberPaymentRepository } from '@core/payments/domain/repositories/IMembershipFeeRepository';
|
||||
import type { MembershipFee } from '@core/payments/domain/entities/MembershipFee';
|
||||
import type { MemberPayment } from '@core/payments/domain/entities/MemberPayment';
|
||||
|
||||
const membershipFees: Map<string, MembershipFee> = new Map();
|
||||
const memberPayments: Map<string, MemberPayment> = new Map();
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* In-Memory Implementation: InMemoryPaymentRepository
|
||||
*/
|
||||
|
||||
import type { Logger } from '@gridpilot/shared/application/Logger';
|
||||
import type { IPaymentRepository } from '../../../../core/payments/domain/repositories/IPaymentRepository';
|
||||
import type { Payment, PaymentType } from '../../../../core/payments/domain/entities/Payment';
|
||||
import type { Logger } from '@core/shared/application/Logger';
|
||||
import type { IPaymentRepository } from '@core/payments/domain/repositories/IPaymentRepository';
|
||||
import type { Payment, PaymentType } from '@core/payments/domain/entities/Payment';
|
||||
|
||||
const payments: Map<string, Payment> = new Map();
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* In-Memory Implementation: InMemoryPrizeRepository
|
||||
*/
|
||||
|
||||
import type { Logger } from '@gridpilot/shared/application/Logger';
|
||||
import type { IPrizeRepository } from '../../../../core/payments/domain/repositories/IPrizeRepository';
|
||||
import type { Prize } from '../../../../core/payments/domain/entities/Prize';
|
||||
import type { Logger } from '@core/shared/application/Logger';
|
||||
import type { IPrizeRepository } from '@core/payments/domain/repositories/IPrizeRepository';
|
||||
import type { Prize } from '@core/payments/domain/entities/Prize';
|
||||
|
||||
const prizes: Map<string, Prize> = new Map();
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* In-Memory Implementation: InMemoryWalletRepository
|
||||
*/
|
||||
|
||||
import type { Logger } from '@gridpilot/shared/application/Logger';
|
||||
import type { IWalletRepository, ITransactionRepository } from '../../../../core/payments/domain/repositories/IWalletRepository';
|
||||
import type { Wallet, Transaction } from '../../../../core/payments/domain/entities/Wallet';
|
||||
import type { Logger } from '@core/shared/application/Logger';
|
||||
import type { IWalletRepository, ITransactionRepository } from '@core/payments/domain/repositories/IWalletRepository';
|
||||
import type { Wallet, Transaction } from '@core/payments/domain/entities/Wallet';
|
||||
|
||||
const wallets: Map<string, Wallet> = new Map();
|
||||
const transactions: Map<string, Transaction> = new Map();
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Car, CarClass, CarLicense } from '@gridpilot/racing/domain/entities/Car';
|
||||
import type { ICarRepository } from '@gridpilot/racing/domain/repositories/ICarRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { Car, CarClass, CarLicense } from '@core/racing/domain/entities/Car';
|
||||
import type { ICarRepository } from '@core/racing/domain/repositories/ICarRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryCarRepository implements ICarRepository {
|
||||
private cars: Map<string, Car>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IDriverRepository } from '@gridpilot/racing/domain/repositories/IDriverRepository';
|
||||
import { Driver } from '@gridpilot/racing/domain/entities/Driver';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { IDriverRepository } from '@core/racing/domain/repositories/IDriverRepository';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryDriverRepository implements IDriverRepository {
|
||||
private drivers: Map<string, Driver> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IGameRepository } from '@gridpilot/racing/domain/repositories/IGameRepository';
|
||||
import { Game } from '@gridpilot/racing/domain/entities/Game';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { IGameRepository } from '@core/racing/domain/repositories/IGameRepository';
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryGameRepository implements IGameRepository {
|
||||
private games: Map<string, Game> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ILeagueMembershipRepository } from '@gridpilot/racing/domain/repositories/ILeagueMembershipRepository';
|
||||
import { LeagueMembership, JoinRequest } from '@gridpilot/racing/domain/entities/LeagueMembership';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ILeagueMembershipRepository } from '@core/racing/domain/repositories/ILeagueMembershipRepository';
|
||||
import { LeagueMembership, JoinRequest } from '@core/racing/domain/entities/LeagueMembership';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLeagueMembershipRepository implements ILeagueMembershipRepository {
|
||||
private memberships: Map<string, LeagueMembership> = new Map(); // Key: `${leagueId}:${driverId}`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ILeagueRepository } from '@gridpilot/core/racing/domain/repositories/ILeagueRepository';
|
||||
import { League } from '@gridpilot/core/racing/domain/entities/League';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ILeagueRepository } from '@core/racing/domain/repositories/ILeagueRepository';
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLeagueRepository implements ILeagueRepository {
|
||||
private leagues: Map<string, League> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ILeagueScoringConfigRepository } from '@gridpilot/racing/domain/repositories/ILeagueScoringConfigRepository';
|
||||
import { LeagueScoringConfig } from '@gridpilot/racing/domain/entities/LeagueScoringConfig';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ILeagueScoringConfigRepository } from '@core/racing/domain/repositories/ILeagueScoringConfigRepository';
|
||||
import { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLeagueScoringConfigRepository implements ILeagueScoringConfigRepository {
|
||||
private configs: Map<string, LeagueScoringConfig> = new Map(); // Key: seasonId
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import type {
|
||||
LeagueScoringPresetDTO,
|
||||
LeagueScoringPresetProvider,
|
||||
} from '@gridpilot/racing/application/ports/LeagueScoringPresetProvider';
|
||||
} from '@core/racing/application/ports/LeagueScoringPresetProvider';
|
||||
|
||||
/**
|
||||
* Infrastructure adapter exposing the in-memory scoring preset registry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ILeagueStandingsRepository, RawStanding } from '@gridpilot/core/league/application/ports/ILeagueStandingsRepository';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ILeagueStandingsRepository, RawStanding } from '@core/league/application/ports/ILeagueStandingsRepository';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLeagueStandingsRepository implements ILeagueStandingsRepository {
|
||||
private standings: Map<string, RawStanding[]> = new Map(); // Key: leagueId
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { LeagueWallet } from '../../domain/entities/LeagueWallet';
|
||||
import type { ILeagueWalletRepository } from '../../domain/repositories/ILeagueWalletRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLeagueWalletRepository implements ILeagueWalletRepository {
|
||||
private wallets: Map<string, LeagueWallet> = new Map();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import type { DriverLivery } from '../../domain/entities/DriverLivery';
|
||||
import type { LiveryTemplate } from '../../domain/entities/LiveryTemplate';
|
||||
import type { ILiveryRepository } from '../../domain/repositories/ILiveryRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryLiveryRepository implements ILiveryRepository {
|
||||
private driverLiveries: Map<string, DriverLivery> = new Map();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Penalty } from '../../domain/entities/Penalty';
|
||||
import type { IPenaltyRepository } from '../../domain/repositories/IPenaltyRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
private penalties: Map<string, Penalty> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IProtestRepository } from '@gridpilot/racing/domain/repositories/IProtestRepository';
|
||||
import { Protest, ProtestStatus } from '@gridpilot/racing/domain/entities/Protest';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { IProtestRepository } from '@core/racing/domain/repositories/IProtestRepository';
|
||||
import { Protest, ProtestStatus } from '@core/racing/domain/entities/Protest';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryProtestRepository implements IProtestRepository {
|
||||
private protests: Map<string, Protest> = new Map();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import type { IRaceEventRepository } from '../../domain/repositories/IRaceEventRepository';
|
||||
import type { RaceEvent } from '../../domain/entities/RaceEvent';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryRaceEventRepository implements IRaceEventRepository {
|
||||
private raceEvents: Map<string, RaceEvent> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IRaceRegistrationRepository } from '@gridpilot/racing/domain/repositories/IRaceRegistrationRepository';
|
||||
import { RaceRegistration } from '@gridpilot/racing/domain/entities/RaceRegistration';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { IRaceRegistrationRepository } from '@core/racing/domain/repositories/IRaceRegistrationRepository';
|
||||
import { RaceRegistration } from '@core/racing/domain/entities/RaceRegistration';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryRaceRegistrationRepository implements IRaceRegistrationRepository {
|
||||
private registrations: Map<string, RaceRegistration> = new Map(); // Key: `${raceId}:${driverId}`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IRaceRepository } from '@gridpilot/racing/domain/repositories/IRaceRepository';
|
||||
import { Race, RaceStatus } from '@gridpilot/racing/domain/entities/Race';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { IRaceRepository } from '@core/racing/domain/repositories/IRaceRepository';
|
||||
import { Race, RaceStatus } from '@core/racing/domain/entities/Race';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryRaceRepository implements IRaceRepository {
|
||||
private races: Map<string, Race> = new Map();
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Result } from '@gridpilot/racing/domain/entities/Result';
|
||||
import type { IResultRepository } from '@gridpilot/racing/domain/repositories/IResultRepository';
|
||||
import type { IRaceRepository } from '@gridpilot/racing/domain/repositories/IRaceRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { Result } from '@core/racing/domain/entities/Result';
|
||||
import type { IResultRepository } from '@core/racing/domain/repositories/IResultRepository';
|
||||
import type { IRaceRepository } from '@core/racing/domain/repositories/IRaceRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryResultRepository implements IResultRepository {
|
||||
private results: Map<string, Result>;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { Game } from '@gridpilot/racing/domain/entities/Game';
|
||||
import { Season } from '@gridpilot/racing/domain/entities/Season';
|
||||
import type { LeagueScoringConfig } from '@gridpilot/racing/domain/entities/LeagueScoringConfig';
|
||||
import { PointsTable } from '@gridpilot/racing/domain/value-objects/PointsTable';
|
||||
import type { ChampionshipConfig } from '@gridpilot/racing/domain/types/ChampionshipConfig';
|
||||
import type { SessionType } from '@gridpilot/racing/domain/types/SessionType';
|
||||
import type { BonusRule } from '@gridpilot/racing/domain/types/BonusRule';
|
||||
import type { DropScorePolicy } from '@gridpilot/racing/domain/types/DropScorePolicy';
|
||||
import type { IGameRepository } from '@gridpilot/racing/domain/repositories/IGameRepository';
|
||||
import type { ISeasonRepository } from '@gridpilot/racing/domain/repositories/ISeasonRepository';
|
||||
import type { ILeagueScoringConfigRepository } from '@gridpilot/racing/domain/repositories/ILeagueScoringConfigRepository';
|
||||
import type { IChampionshipStandingRepository } from '@gridpilot/racing/domain/repositories/IChampionshipStandingRepository';
|
||||
import { ChampionshipStanding } from '@gridpilot/racing/domain/entities/ChampionshipStanding';
|
||||
import type { ChampionshipType } from '@gridpilot/racing/domain/types/ChampionshipType';
|
||||
import type { ParticipantRef } from '@gridpilot/racing/domain/types/ParticipantRef';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import { Season } from '@core/racing/domain/entities/Season';
|
||||
import type { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import { PointsTable } from '@core/racing/domain/value-objects/PointsTable';
|
||||
import type { ChampionshipConfig } from '@core/racing/domain/types/ChampionshipConfig';
|
||||
import type { SessionType } from '@core/racing/domain/types/SessionType';
|
||||
import type { BonusRule } from '@core/racing/domain/types/BonusRule';
|
||||
import type { DropScorePolicy } from '@core/racing/domain/types/DropScorePolicy';
|
||||
import type { IGameRepository } from '@core/racing/domain/repositories/IGameRepository';
|
||||
import type { ISeasonRepository } from '@core/racing/domain/repositories/ISeasonRepository';
|
||||
import type { ILeagueScoringConfigRepository } from '@core/racing/domain/repositories/ILeagueScoringConfigRepository';
|
||||
import type { IChampionshipStandingRepository } from '@core/racing/domain/repositories/IChampionshipStandingRepository';
|
||||
import { ChampionshipStanding } from '@core/racing/domain/entities/ChampionshipStanding';
|
||||
import type { ChampionshipType } from '@core/racing/domain/types/ChampionshipType';
|
||||
import type { ParticipantRef } from '@core/racing/domain/types/ParticipantRef';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
class SilentLogger implements Logger {
|
||||
debug(..._args: unknown[]): void {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ISeasonRepository } from '@gridpilot/racing/domain/repositories/ISeasonRepository';
|
||||
import { Season } from '@gridpilot/racing/domain/entities/Season';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ISeasonRepository } from '@core/racing/domain/repositories/ISeasonRepository';
|
||||
import { Season } from '@core/racing/domain/entities/Season';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemorySeasonRepository implements ISeasonRepository {
|
||||
private seasons: Map<string, Season> = new Map(); // Key: seasonId
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { SeasonSponsorship, SponsorshipTier } from '../../domain/entities/SeasonSponsorship';
|
||||
import type { ISeasonSponsorshipRepository } from '../../domain/repositories/ISeasonSponsorshipRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemorySeasonSponsorshipRepository implements ISeasonSponsorshipRepository {
|
||||
private sponsorships: Map<string, SeasonSponsorship> = new Map();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import type { ISessionRepository } from '../../domain/repositories/ISessionRepository';
|
||||
import type { Session } from '../../domain/entities/Session';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemorySessionRepository implements ISessionRepository {
|
||||
private sessions: Map<string, Session> = new Map();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ISponsorRepository } from '@gridpilot/core/racing/domain/repositories/ISponsorRepository';
|
||||
import { Sponsor } from '@gridpilot/core/racing/domain/entities/Sponsor';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ISponsorRepository } from '@core/racing/domain/repositories/ISponsorRepository';
|
||||
import { Sponsor } from '@core/racing/domain/entities/Sponsor';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemorySponsorRepository implements ISponsorRepository {
|
||||
private sponsors: Map<string, Sponsor> = new Map();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import type { ISponsorshipPricingRepository } from '../../domain/repositories/ISponsorshipPricingRepository';
|
||||
import { SponsorshipPricing } from '../../domain/value-objects/SponsorshipPricing';
|
||||
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
interface StorageKey {
|
||||
entityType: SponsorableEntityType;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ISponsorshipRequestRepository } from '@gridpilot/racing/domain/repositories/ISponsorshipRequestRepository';
|
||||
import { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '@gridpilot/racing/domain/entities/SponsorshipRequest';
|
||||
import { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { ISponsorshipRequestRepository } from '@core/racing/domain/repositories/ISponsorshipRequestRepository';
|
||||
import { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemorySponsorshipRequestRepository implements ISponsorshipRequestRepository {
|
||||
private requests: Map<string, SponsorshipRequest> = new Map();
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
* Stores data in Map structure and calculates standings from race results.
|
||||
*/
|
||||
|
||||
import { Standing } from '@gridpilot/racing/domain/entities/Standing';
|
||||
import type { IStandingRepository } from '@gridpilot/racing/domain/repositories/IStandingRepository';
|
||||
import type { IResultRepository } from '@gridpilot/racing/domain/repositories/IResultRepository';
|
||||
import type { IRaceRepository } from '@gridpilot/racing/domain/repositories/IRaceRepository';
|
||||
import type { ILeagueRepository } from '@gridpilot/racing/domain/repositories/ILeagueRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { Standing } from '@core/racing/domain/entities/Standing';
|
||||
import type { IStandingRepository } from '@core/racing/domain/repositories/IStandingRepository';
|
||||
import type { IResultRepository } from '@core/racing/domain/repositories/IResultRepository';
|
||||
import type { IRaceRepository } from '@core/racing/domain/repositories/IRaceRepository';
|
||||
import type { ILeagueRepository } from '@core/racing/domain/repositories/ILeagueRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
/**
|
||||
* Points systems presets
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
import type {
|
||||
TeamMembership,
|
||||
TeamJoinRequest,
|
||||
} from '@gridpilot/racing/domain/types/TeamMembership';
|
||||
import type { ITeamMembershipRepository } from '@gridpilot/racing/domain/repositories/ITeamMembershipRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
} from '@core/racing/domain/types/TeamMembership';
|
||||
import type { ITeamMembershipRepository } from '@core/racing/domain/repositories/ITeamMembershipRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryTeamMembershipRepository implements ITeamMembershipRepository {
|
||||
private membershipsByTeam: Map<string, TeamMembership[]>;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* Stores data in a Map structure.
|
||||
*/
|
||||
|
||||
import type { Team } from '@gridpilot/racing/domain/entities/Team';
|
||||
import type { ITeamRepository } from '@gridpilot/racing/domain/repositories/ITeamRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Team } from '@core/racing/domain/entities/Team';
|
||||
import type { ITeamRepository } from '@core/racing/domain/repositories/ITeamRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryTeamRepository implements ITeamRepository {
|
||||
private teams: Map<string, Team>;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Track, TrackCategory } from '@gridpilot/racing/domain/entities/Track';
|
||||
import type { ITrackRepository } from '@gridpilot/racing/domain/repositories/ITrackRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import { Track, TrackCategory } from '@core/racing/domain/entities/Track';
|
||||
import type { ITrackRepository } from '@core/racing/domain/repositories/ITrackRepository';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryTrackRepository implements ITrackRepository {
|
||||
private tracks: Map<string, Track>;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Transaction, TransactionType } from '../../domain/entities/Transaction';
|
||||
import type { ITransactionRepository } from '../../domain/repositories/ITransactionRepository';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryTransactionRepository implements ITransactionRepository {
|
||||
private transactions: Map<string, Transaction> = new Map();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DriverRatingProvider } from '@gridpilot/racing/application/ports/DriverRatingProvider';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { DriverRatingProvider } from '@core/racing/application/ports/DriverRatingProvider';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryDriverRatingProvider implements DriverRatingProvider {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { IDriverStatsService, DriverStats } from '@gridpilot/racing/domain/services/IDriverStatsService';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { IDriverStatsService, DriverStats } from '@core/racing/domain/services/IDriverStatsService';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryDriverStatsService implements IDriverStatsService {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { IRankingService, DriverRanking } from '@gridpilot/racing/domain/services/IRankingService';
|
||||
import type { Logger } from '@gridpilot/shared/logging/Logger';
|
||||
import type { IRankingService, DriverRanking } from '@core/racing/domain/services/IRankingService';
|
||||
import type { Logger } from '@core/shared/logging/Logger';
|
||||
|
||||
export class InMemoryRankingService implements IRankingService {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../", // Base URL is the project root
|
||||
"paths": {
|
||||
"@gridpilot/core/*": ["core/*"],
|
||||
"@gridpilot/shared/*": ["core/shared/*"],
|
||||
"@gridpilot/identity/application/dto/*": ["core/identity/application/dto/*"],
|
||||
"@gridpilot/identity/application/ports/*": ["core/identity/application/ports/*"],
|
||||
"@gridpilot/identity/domain/repositories/*": ["core/identity/domain/repositories/*"],
|
||||
"@gridpilot/identity/domain/services/*": ["core/identity/domain/services/*"],
|
||||
"@gridpilot/racing/domain/repositories/*": ["core/racing/domain/repositories/*"],
|
||||
"@gridpilot/racing/domain/entities/*": ["core/racing/domain/entities/*"],
|
||||
"@gridpilot/racing/application/ports/*": ["core/racing/application/ports/*"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"composite": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "../" // Root directory is the project root
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"paths": {
|
||||
"@/*": ["./*"],
|
||||
"@core/*": ["../core/*"],
|
||||
"@adapters/*": ["./*"],
|
||||
"@testing/*": ["../testing/*"]
|
||||
}
|
||||
},
|
||||
"include": ["**/*", "../core/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/*.spec.ts"]
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.test.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user