refactor driver module (wip)
This commit is contained in:
@@ -8,6 +8,8 @@ import type { ISeasonRepository } from '@core/racing/domain/repositories/ISeason
|
||||
import type { ILeagueRepository } from '@core/racing/domain/repositories/ILeagueRepository';
|
||||
import type { ILeagueMembershipRepository } from '@core/racing/domain/repositories/ILeagueMembershipRepository';
|
||||
import type { IRaceRepository } from '@core/racing/domain/repositories/IRaceRepository';
|
||||
import type { IProtestRepository } from '@core/racing/domain/repositories/IProtestRepository';
|
||||
import type { IDriverRepository } from '@core/racing/domain/repositories/IDriverRepository';
|
||||
|
||||
// Import concrete in-memory implementations
|
||||
import { InMemoryLeagueRepository } from '@adapters/racing/persistence/inmemory/InMemoryLeagueRepository';
|
||||
@@ -52,6 +54,7 @@ import { WithdrawFromLeagueWalletUseCase } from '@core/racing/application/use-ca
|
||||
|
||||
// Import presenters
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
import { GetLeagueProtestsPresenter } from './presenters/GetLeagueProtestsPresenter';
|
||||
|
||||
// Define injection tokens
|
||||
export const LEAGUE_REPOSITORY_TOKEN = 'ILeagueRepository';
|
||||
@@ -145,6 +148,10 @@ export const LeagueProviders: Provider[] = [
|
||||
provide: 'AllLeaguesWithCapacityPresenter',
|
||||
useClass: AllLeaguesWithCapacityPresenter,
|
||||
},
|
||||
{
|
||||
provide: 'GetLeagueProtestsPresenter',
|
||||
useClass: GetLeagueProtestsPresenter,
|
||||
},
|
||||
// Use cases
|
||||
{
|
||||
provide: GetAllLeaguesWithCapacityUseCase,
|
||||
@@ -167,7 +174,17 @@ export const LeagueProviders: Provider[] = [
|
||||
RemoveLeagueMemberUseCase,
|
||||
UpdateLeagueMemberRoleUseCase,
|
||||
GetLeagueOwnerSummaryUseCase,
|
||||
GetLeagueProtestsUseCase,
|
||||
{
|
||||
provide: GetLeagueProtestsUseCase,
|
||||
useFactory: (
|
||||
raceRepo: IRaceRepository,
|
||||
protestRepo: IProtestRepository,
|
||||
driverRepo: IDriverRepository,
|
||||
leagueRepo: ILeagueRepository,
|
||||
presenter: GetLeagueProtestsPresenter,
|
||||
) => new GetLeagueProtestsUseCase(raceRepo, protestRepo, driverRepo, leagueRepo, presenter),
|
||||
inject: [RACE_REPOSITORY_TOKEN, PROTEST_REPOSITORY_TOKEN, DRIVER_REPOSITORY_TOKEN, LEAGUE_REPOSITORY_TOKEN, 'GetLeagueProtestsPresenter'],
|
||||
},
|
||||
GetLeagueSeasonsUseCase,
|
||||
GetLeagueMembershipsUseCase,
|
||||
GetLeagueScheduleUseCase,
|
||||
|
||||
Reference in New Issue
Block a user