website refactor
This commit is contained in:
@@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import { InMemoryAchievementRepository } from '@adapters/identity/persistence/inmemory/InMemoryAchievementRepository';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type { PageViewRepository } from '@core/analytics/application/repositories/PageViewRepository';
|
||||
import type { AnalyticsSnapshotRepository } from '@core/analytics/domain/repositories/AnalyticsSnapshotRepository';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
import type { PasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import { InMemoryAuthRepository } from '@adapters/identity/persistence/inmemory/InMemoryAuthRepository';
|
||||
import { InMemoryCompanyRepository } from '@adapters/identity/persistence/inmemory/InMemoryCompanyRepository';
|
||||
|
||||
@@ -2,25 +2,25 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type { IAvatarGenerationRepository } from '@core/media/domain/repositories/AvatarGenerationRepository';
|
||||
import type { IAvatarRepository } from '@core/media/domain/repositories/AvatarRepository';
|
||||
import type { IMediaRepository } from '@core/media/domain/repositories/MediaRepository';
|
||||
import type { AvatarGenerationRepository } from '@core/media/domain/repositories/AvatarGenerationRepository';
|
||||
import type { AvatarRepository } from '@core/media/domain/repositories/AvatarRepository';
|
||||
import type { MediaRepository } from '@core/media/domain/repositories/MediaRepository';
|
||||
|
||||
import { InMemoryAvatarGenerationRepository } from '@adapters/media/persistence/inmemory/InMemoryAvatarGenerationRepository';
|
||||
|
||||
import { AVATAR_GENERATION_REPOSITORY_TOKEN, AVATAR_REPOSITORY_TOKEN, MEDIA_REPOSITORY_TOKEN } from '../media/MediaPersistenceTokens';
|
||||
|
||||
// Mock implementations for Media and Avatar repositories (inmemory only has AvatarGeneration)
|
||||
class MockMediaRepository implements IMediaRepository {
|
||||
class MockMediaRepository implements MediaRepository {
|
||||
async save(): Promise<void> {}
|
||||
async findById(): Promise<null> { return null; }
|
||||
async findByUploadedBy(): Promise<[]> { return []; }
|
||||
async delete(): Promise<void> {}
|
||||
}
|
||||
|
||||
class MockAvatarRepository implements IAvatarRepository {
|
||||
class MockAvatarRepository implements AvatarRepository {
|
||||
async save(): Promise<void> {}
|
||||
async findById(): Promise<null> { return null; }
|
||||
async findActiveByDriverId(): Promise<null> { return null; }
|
||||
@@ -33,7 +33,7 @@ class MockAvatarRepository implements IAvatarRepository {
|
||||
providers: [
|
||||
{
|
||||
provide: AVATAR_GENERATION_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IAvatarGenerationRepository =>
|
||||
useFactory: (logger: Logger): AvatarGenerationRepository =>
|
||||
new InMemoryAvatarGenerationRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
|
||||
@@ -2,12 +2,12 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type { NotificationGatewayRegistry } from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { NotificationService } from '@core/notifications/application/ports/NotificationService';
|
||||
import type { INotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { INotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { NotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
|
||||
import { InMemoryNotificationPreferenceRepository } from '@adapters/notifications/persistence/inmemory/InMemoryNotificationPreferenceRepository';
|
||||
import { InMemoryNotificationRepository } from '@adapters/notifications/persistence/inmemory/InMemoryNotificationRepository';
|
||||
@@ -24,13 +24,13 @@ export const NOTIFICATION_GATEWAY_REGISTRY_TOKEN = 'INotificationGatewayRegistry
|
||||
providers: [
|
||||
{
|
||||
provide: NOTIFICATION_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): INotificationRepository =>
|
||||
useFactory: (logger: Logger): NotificationRepository =>
|
||||
new InMemoryNotificationRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: NOTIFICATION_PREFERENCE_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): INotificationPreferenceRepository =>
|
||||
useFactory: (logger: Logger): NotificationPreferenceRepository =>
|
||||
new InMemoryNotificationPreferenceRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
@@ -43,8 +43,8 @@ export const NOTIFICATION_GATEWAY_REGISTRY_TOKEN = 'INotificationGatewayRegistry
|
||||
{
|
||||
provide: NOTIFICATION_SERVICE_TOKEN,
|
||||
useFactory: (
|
||||
notificationRepo: INotificationRepository,
|
||||
preferenceRepo: INotificationPreferenceRepository,
|
||||
notificationRepo: NotificationRepository,
|
||||
preferenceRepo: NotificationPreferenceRepository,
|
||||
gatewayRegistry: NotificationGatewayRegistry,
|
||||
logger: Logger,
|
||||
): NotificationService =>
|
||||
|
||||
@@ -2,15 +2,15 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type {
|
||||
IMemberPaymentRepository,
|
||||
IMembershipFeeRepository,
|
||||
MemberPaymentRepository,
|
||||
MembershipFeeRepository,
|
||||
} from '@core/payments/domain/repositories/MembershipFeeRepository';
|
||||
import type { IPaymentRepository } from '@core/payments/domain/repositories/PaymentRepository';
|
||||
import type { IPrizeRepository } from '@core/payments/domain/repositories/PrizeRepository';
|
||||
import type { ITransactionRepository, IWalletRepository } from '@core/payments/domain/repositories/WalletRepository';
|
||||
import type { PaymentRepository } from '@core/payments/domain/repositories/PaymentRepository';
|
||||
import type { PrizeRepository } from '@core/payments/domain/repositories/PrizeRepository';
|
||||
import type { TransactionRepository, WalletRepository } from '@core/payments/domain/repositories/WalletRepository';
|
||||
|
||||
import { InMemoryMemberPaymentRepository, InMemoryMembershipFeeRepository } from '@adapters/payments/persistence/inmemory/InMemoryMembershipFeeRepository';
|
||||
import { InMemoryPaymentRepository } from '@adapters/payments/persistence/inmemory/InMemoryPaymentRepository';
|
||||
@@ -31,32 +31,32 @@ import {
|
||||
providers: [
|
||||
{
|
||||
provide: PAYMENTS_PAYMENT_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IPaymentRepository => new InMemoryPaymentRepository(logger),
|
||||
useFactory: (logger: Logger): PaymentRepository => new InMemoryPaymentRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_MEMBERSHIP_FEE_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IMembershipFeeRepository => new InMemoryMembershipFeeRepository(logger),
|
||||
useFactory: (logger: Logger): MembershipFeeRepository => new InMemoryMembershipFeeRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_MEMBER_PAYMENT_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IMemberPaymentRepository => new InMemoryMemberPaymentRepository(logger),
|
||||
useFactory: (logger: Logger): MemberPaymentRepository => new InMemoryMemberPaymentRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_PRIZE_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IPrizeRepository => new InMemoryPrizeRepository(logger),
|
||||
useFactory: (logger: Logger): PrizeRepository => new InMemoryPrizeRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_WALLET_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IWalletRepository => new InMemoryWalletRepository(logger),
|
||||
useFactory: (logger: Logger): WalletRepository => new InMemoryWalletRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_TRANSACTION_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): ITransactionRepository => new InMemoryTransactionRepository(logger),
|
||||
useFactory: (logger: Logger): TransactionRepository => new InMemoryTransactionRepository(logger),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type { DriverRepository } from '@core/racing/domain/repositories/DriverRepository';
|
||||
import type { DriverStatsRepository } from '@core/racing/domain/repositories/DriverStatsRepository';
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import type { IFeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { ISocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
import type { FeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { SocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
|
||||
import {
|
||||
InMemoryFeedRepository,
|
||||
@@ -19,13 +19,13 @@ import { SOCIAL_FEED_REPOSITORY_TOKEN, SOCIAL_GRAPH_REPOSITORY_TOKEN } from '../
|
||||
providers: [
|
||||
{
|
||||
provide: SOCIAL_FEED_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): IFeedRepository =>
|
||||
useFactory: (logger: Logger): FeedRepository =>
|
||||
new InMemoryFeedRepository(logger, { drivers: [], friendships: [], feedEvents: [] }),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
{
|
||||
provide: SOCIAL_GRAPH_REPOSITORY_TOKEN,
|
||||
useFactory: (logger: Logger): ISocialGraphRepository =>
|
||||
useFactory: (logger: Logger): SocialGraphRepository =>
|
||||
new InMemorySocialGraphRepository(logger, { drivers: [], friendships: [], feedEvents: [] }),
|
||||
inject: ['Logger'],
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule, getDataSourceToken } from '@nestjs/typeorm';
|
||||
import type { DataSource } from 'typeorm';
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { DataSource } from 'typeorm';
|
||||
|
||||
import type { NotificationGatewayRegistry } from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { NotificationService } from '@core/notifications/application/ports/NotificationService';
|
||||
import type { INotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { INotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { NotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import { NotificationOrmEntity } from '@adapters/notifications/persistence/typeorm/entities/NotificationOrmEntity';
|
||||
import { NotificationPreferenceOrmEntity } from '@adapters/notifications/persistence/typeorm/entities/NotificationPreferenceOrmEntity';
|
||||
@@ -58,8 +58,8 @@ const typeOrmFeatureImports = [
|
||||
{
|
||||
provide: NOTIFICATION_SERVICE_TOKEN,
|
||||
useFactory: (
|
||||
notificationRepo: INotificationRepository,
|
||||
preferenceRepo: INotificationPreferenceRepository,
|
||||
notificationRepo: NotificationRepository,
|
||||
preferenceRepo: NotificationPreferenceRepository,
|
||||
gatewayRegistry: NotificationGatewayRegistry,
|
||||
logger: Logger,
|
||||
): NotificationService =>
|
||||
|
||||
@@ -4,10 +4,10 @@ import type { DataSource } from 'typeorm';
|
||||
|
||||
import { LoggingModule } from '../../domain/logging/LoggingModule';
|
||||
|
||||
import type { IMemberPaymentRepository, IMembershipFeeRepository } from '@core/payments/domain/repositories/MembershipFeeRepository';
|
||||
import type { IPaymentRepository } from '@core/payments/domain/repositories/PaymentRepository';
|
||||
import type { IPrizeRepository } from '@core/payments/domain/repositories/PrizeRepository';
|
||||
import type { ITransactionRepository, IWalletRepository } from '@core/payments/domain/repositories/WalletRepository';
|
||||
import type { MemberPaymentRepository, MembershipFeeRepository } from '@core/payments/domain/repositories/MembershipFeeRepository';
|
||||
import type { PaymentRepository } from '@core/payments/domain/repositories/PaymentRepository';
|
||||
import type { PrizeRepository } from '@core/payments/domain/repositories/PrizeRepository';
|
||||
import type { TransactionRepository, WalletRepository } from '@core/payments/domain/repositories/WalletRepository';
|
||||
|
||||
import { PaymentsMemberPaymentOrmEntity } from '@adapters/payments/persistence/typeorm/entities/PaymentsMemberPaymentOrmEntity';
|
||||
import { PaymentsMembershipFeeOrmEntity } from '@adapters/payments/persistence/typeorm/entities/PaymentsMembershipFeeOrmEntity';
|
||||
@@ -58,37 +58,37 @@ const typeOrmFeatureImports = [
|
||||
|
||||
{
|
||||
provide: PAYMENTS_WALLET_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsWalletOrmMapper): IWalletRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsWalletOrmMapper): WalletRepository =>
|
||||
new TypeOrmWalletRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsWalletOrmMapper],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_TRANSACTION_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsWalletOrmMapper): ITransactionRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsWalletOrmMapper): TransactionRepository =>
|
||||
new TypeOrmTransactionRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsWalletOrmMapper],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_PAYMENT_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsPaymentOrmMapper): IPaymentRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsPaymentOrmMapper): PaymentRepository =>
|
||||
new TypeOrmPaymentRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsPaymentOrmMapper],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_PRIZE_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsPrizeOrmMapper): IPrizeRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsPrizeOrmMapper): PrizeRepository =>
|
||||
new TypeOrmPrizeRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsPrizeOrmMapper],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_MEMBERSHIP_FEE_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsMembershipFeeOrmMapper): IMembershipFeeRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsMembershipFeeOrmMapper): MembershipFeeRepository =>
|
||||
new TypeOrmMembershipFeeRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsMembershipFeeOrmMapper],
|
||||
},
|
||||
{
|
||||
provide: PAYMENTS_MEMBER_PAYMENT_REPOSITORY_TOKEN,
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsMemberPaymentOrmMapper): IMemberPaymentRepository =>
|
||||
useFactory: (dataSource: DataSource, mapper: PaymentsMemberPaymentOrmMapper): MemberPaymentRepository =>
|
||||
new TypeOrmMemberPaymentRepository(dataSource, mapper),
|
||||
inject: [getDataSourceToken(), PaymentsMemberPaymentOrmMapper],
|
||||
},
|
||||
|
||||
@@ -113,7 +113,7 @@ import { TeamMembershipOrmMapper, TeamOrmMapper } from '@adapters/racing/persist
|
||||
import { TeamStatsOrmMapper } from '@adapters/racing/persistence/typeorm/mappers/TeamStatsOrmMapper';
|
||||
|
||||
import { getPointsSystems } from '@adapters/bootstrap/PointsSystems';
|
||||
import type { Logger } from '@core/shared/application/UseCaseOutputPort/UseCaseOutputPort/UseCaseOutputPort_TEMP_TEMP/Logger';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
const RACING_POINTS_SYSTEMS_TOKEN = 'RACING_POINTS_SYSTEMS_TOKEN';
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import { DatabaseModule } from '../../domain/database/DatabaseModule';
|
||||
import { PostgresSocialPersistenceModule } from '../postgres/PostgresSocialPersistenceModule';
|
||||
import { SOCIAL_FEED_REPOSITORY_TOKEN, SOCIAL_GRAPH_REPOSITORY_TOKEN } from './SocialPersistenceTokens';
|
||||
|
||||
import type { IFeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { ISocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
import type { FeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { SocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
|
||||
import { DriverOrmEntity } from '@adapters/racing/persistence/typeorm/entities/DriverOrmEntity';
|
||||
import { FeedItemOrmEntity } from '@adapters/social/persistence/typeorm/entities/FeedItemOrmEntity';
|
||||
@@ -82,8 +82,8 @@ describe('PostgresSocialPersistenceModule (integration)', () => {
|
||||
|
||||
await feedOrmRepo.save(item);
|
||||
|
||||
const feedRepo = module.get<IFeedRepository>(SOCIAL_FEED_REPOSITORY_TOKEN);
|
||||
const socialGraphRepo = module.get<ISocialGraphRepository>(SOCIAL_GRAPH_REPOSITORY_TOKEN);
|
||||
const feedRepo = module.get<FeedRepository>(SOCIAL_FEED_REPOSITORY_TOKEN);
|
||||
const socialGraphRepo = module.get<SocialGraphRepository>(SOCIAL_GRAPH_REPOSITORY_TOKEN);
|
||||
|
||||
const friendIds = await socialGraphRepo.getFriendIds(driverA.id);
|
||||
expect(friendIds).toEqual([driverB.id]);
|
||||
|
||||
Reference in New Issue
Block a user