refactor
This commit is contained in:
@@ -50,6 +50,9 @@ import { GetLeagueAdminPermissionsUseCase } from '@core/racing/application/use-c
|
||||
import { GetLeagueWalletUseCase } from '@core/racing/application/use-cases/GetLeagueWalletUseCase';
|
||||
import { WithdrawFromLeagueWalletUseCase } from '@core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase';
|
||||
|
||||
// Import presenters
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
|
||||
// Define injection tokens
|
||||
export const LEAGUE_REPOSITORY_TOKEN = 'ILeagueRepository';
|
||||
export const LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN = 'ILeagueMembershipRepository';
|
||||
@@ -137,8 +140,18 @@ export const LeagueProviders: Provider[] = [
|
||||
provide: LOGGER_TOKEN,
|
||||
useClass: ConsoleLogger,
|
||||
},
|
||||
// Presenters
|
||||
{
|
||||
provide: 'AllLeaguesWithCapacityPresenter',
|
||||
useClass: AllLeaguesWithCapacityPresenter,
|
||||
},
|
||||
// Use cases
|
||||
GetAllLeaguesWithCapacityUseCase,
|
||||
{
|
||||
provide: GetAllLeaguesWithCapacityUseCase,
|
||||
useFactory: (leagueRepo: ILeagueRepository, membershipRepo: ILeagueMembershipRepository, presenter: AllLeaguesWithCapacityPresenter) =>
|
||||
new GetAllLeaguesWithCapacityUseCase(leagueRepo, membershipRepo, presenter),
|
||||
inject: [LEAGUE_REPOSITORY_TOKEN, LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN, 'AllLeaguesWithCapacityPresenter'],
|
||||
},
|
||||
{
|
||||
provide: GET_LEAGUE_STANDINGS_USE_CASE,
|
||||
useClass: GetLeagueStandingsUseCaseImpl,
|
||||
|
||||
Reference in New Issue
Block a user