import { Module } from '@nestjs/common';

import { getApiPersistence } from '../../env';
import { InMemoryRacingPersistenceModule } from '../inmemory/InMemoryRacingPersistenceModule';
import { PostgresRacingPersistenceModule } from '../postgres/PostgresRacingPersistenceModule';

const selectedPersistenceModule =
  getApiPersistence() === 'postgres' ? PostgresRacingPersistenceModule : InMemoryRacingPersistenceModule;

@Module({
  imports: [selectedPersistenceModule],
  exports: [selectedPersistenceModule],
})
export class RacingPersistenceModule {}