import { TypeOrmDeviceRepository } from '../../infrastructure/persistence/repositories/typeorm-device.repository';
import { TypeOrmWalletRepository } from '../../infrastructure/persistence/repositories/typeorm-wallet.repository';
import { TypeOrmAddressRepository } from '../../infrastructure/persistence/repositories/typeorm-address.repository';
import { TypeOrmNetworkRepository } from '../../infrastructure/persistence/repositories/typeorm-network.repository';
import { TypeOrmTokenRepository } from '../../infrastructure/persistence/repositories/typeorm-token.repository';
import { TypeOrmTransactionRepository } from '../../infrastructure/persistence/repositories/typeorm-transaction.repository';
import { IDeviceRepository } from '../../domain/repositories/device-repository';
import { IWalletRepository } from '../../domain/repositories/wallet-repository';
import { IAddressRepository } from '../../domain/repositories/address-repository';
import { INetworkRepository } from '../../domain/repositories/network-repository';
import { ITokenRepository } from '../../domain/repositories/token-repository';
import { ITransactionRepository } from '../../domain/repositories/transaction-repository';

export interface Repositories {
  deviceRepository: IDeviceRepository;
  walletRepository: IWalletRepository;
  addressRepository: IAddressRepository;
  networkRepository: INetworkRepository;
  tokenRepository: ITokenRepository;
  transactionRepository: ITransactionRepository;
}

export const createRepositories = (): Repositories => {
  return {
    deviceRepository: new TypeOrmDeviceRepository(),
    walletRepository: new TypeOrmWalletRepository(),
    addressRepository: new TypeOrmAddressRepository(),
    networkRepository: new TypeOrmNetworkRepository(),
    tokenRepository: new TypeOrmTokenRepository(),
    transactionRepository: new TypeOrmTransactionRepository(),
  };
};
