57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
import { Provider } from '@nestjs/common';
|
|
|
|
import {
|
|
TEAM_REPOSITORY_TOKEN,
|
|
TEAM_MEMBERSHIP_REPOSITORY_TOKEN,
|
|
DRIVER_REPOSITORY_TOKEN,
|
|
IMAGE_SERVICE_TOKEN,
|
|
LOGGER_TOKEN,
|
|
} from './TeamTokens';
|
|
|
|
export {
|
|
TEAM_REPOSITORY_TOKEN,
|
|
TEAM_MEMBERSHIP_REPOSITORY_TOKEN,
|
|
DRIVER_REPOSITORY_TOKEN,
|
|
IMAGE_SERVICE_TOKEN,
|
|
LOGGER_TOKEN,
|
|
} from './TeamTokens';
|
|
|
|
// Import core interfaces
|
|
import type { Logger } from '@core/shared/application/Logger';
|
|
|
|
// Import concrete in-memory implementations
|
|
import { InMemoryTeamRepository } from '@adapters/racing/persistence/inmemory/InMemoryTeamRepository';
|
|
import { InMemoryTeamMembershipRepository } from '@adapters/racing/persistence/inmemory/InMemoryTeamMembershipRepository';
|
|
import { InMemoryDriverRepository } from '@adapters/racing/persistence/inmemory/InMemoryDriverRepository';
|
|
import { InMemoryImageServiceAdapter } from '@adapters/media/ports/InMemoryImageServiceAdapter';
|
|
import { ConsoleLogger } from '@adapters/logging/ConsoleLogger';
|
|
|
|
// Use cases are imported and used directly in the service
|
|
|
|
export const TeamProviders: Provider[] = [
|
|
{
|
|
provide: TEAM_REPOSITORY_TOKEN,
|
|
useFactory: (logger: Logger) => new InMemoryTeamRepository(logger),
|
|
inject: [LOGGER_TOKEN],
|
|
},
|
|
{
|
|
provide: TEAM_MEMBERSHIP_REPOSITORY_TOKEN,
|
|
useFactory: (logger: Logger) => new InMemoryTeamMembershipRepository(logger),
|
|
inject: [LOGGER_TOKEN],
|
|
},
|
|
{
|
|
provide: DRIVER_REPOSITORY_TOKEN,
|
|
useFactory: (logger: Logger) => new InMemoryDriverRepository(logger),
|
|
inject: [LOGGER_TOKEN],
|
|
},
|
|
{
|
|
provide: IMAGE_SERVICE_TOKEN,
|
|
useFactory: (logger: Logger) => new InMemoryImageServiceAdapter(logger),
|
|
inject: [LOGGER_TOKEN],
|
|
},
|
|
{
|
|
provide: LOGGER_TOKEN,
|
|
useClass: ConsoleLogger,
|
|
},
|
|
// Use cases are created directly in the service
|
|
]; |