import { ContainerModule } from 'inversify';
import { LeagueService } from '../../services/leagues/LeagueService';
import { LeagueSettingsService } from '../../services/leagues/LeagueSettingsService';
import { LeagueStewardingService } from '../../services/leagues/LeagueStewardingService';
import { LeagueWalletService } from '../../services/leagues/LeagueWalletService';
import { LeagueMembershipService } from '../../services/leagues/LeagueMembershipService';

import {
  LEAGUE_SERVICE_TOKEN,
  LEAGUE_SETTINGS_SERVICE_TOKEN,
  LEAGUE_STEWARDING_SERVICE_TOKEN,
  LEAGUE_WALLET_SERVICE_TOKEN,
  LEAGUE_MEMBERSHIP_SERVICE_TOKEN
} from '../tokens';

export const LeagueModule = new ContainerModule((options) => {
  const bind = options.bind;

  // League Service
  bind<LeagueService>(LEAGUE_SERVICE_TOKEN)
    .to(LeagueService)
    .inSingletonScope();

  // League Settings Service
  bind<LeagueSettingsService>(LEAGUE_SETTINGS_SERVICE_TOKEN)
    .to(LeagueSettingsService)
    .inSingletonScope();

  // League Stewarding Service
  bind<LeagueStewardingService>(LEAGUE_STEWARDING_SERVICE_TOKEN)
    .to(LeagueStewardingService)
    .inSingletonScope();

  // League Wallet Service
  bind<LeagueWalletService>(LEAGUE_WALLET_SERVICE_TOKEN)
    .to(LeagueWalletService)
    .inSingletonScope();

  // League Membership Service
  bind<LeagueMembershipService>(LEAGUE_MEMBERSHIP_SERVICE_TOKEN)
    .to(LeagueMembershipService)
    .inSingletonScope();
});
