import { NestFactory } from '@nestjs/core';
import { PlayersSeedService } from './player/player-seed.service';
import { RoleSeedService } from './role/role-seed.service';
import { SeedModule } from './seed.module';
import { StatusSeedService } from './status/status-seed.service';
import { TeamRoleSeedService } from './team-role/team-role-seed.service';
import { TeamsSettingsSeedService } from './team-settings/team-settings-seed.service';
import { TeamWalletTransactionTypeSeedService } from './team-wallet-transactions-type/team-wallet-transaction-type-seed.service';
import { TeamWalletTransactionSeedService } from './team-wallet-transactions/team-wallet-transaction-seed.service';
import { TeamsSeedService } from './teams/teams-seed.service';
import { TransactionsTypeSeedService } from './transaction-type/transactions-type-seed.service';
import { TransactionsSeedService } from './transactions/transactions-seed.service';
import { UserSeedService } from './user/user-seed.service';

const runSeed = async () => {
  const app = await NestFactory.create(SeedModule);

  // run
  await app.get(RoleSeedService).run();
  await app.get(StatusSeedService).run();
  await app.get(UserSeedService).run();
  await app.get(TeamRoleSeedService).run();
  await app.get(TeamsSeedService).run();
  await app.get(PlayersSeedService).run();
  await app.get(TransactionsTypeSeedService).run();
  await app.get(TransactionsSeedService).run();
  await app.get(TeamsSettingsSeedService).run();
  await app.get(TeamWalletTransactionTypeSeedService).run();
  await app.get(TeamWalletTransactionSeedService).run();
  await app.close();
};

void runSeed();
