import { Module } from '@nestjs/common';
import { getApiPersistence } from '../../env';
import { InMemoryAchievementPersistenceModule } from '../inmemory/InMemoryAchievementPersistenceModule';
import { PostgresAchievementPersistenceModule } from '../postgres/PostgresAchievementPersistenceModule';

const selectedPersistenceModule =
  getApiPersistence() === 'postgres' ? PostgresAchievementPersistenceModule : InMemoryAchievementPersistenceModule;

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