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

import { getApiPersistence } from '../../env';
import { InMemorySocialPersistenceModule } from '../inmemory/InMemorySocialPersistenceModule';
import { PostgresSocialPersistenceModule } from '../postgres/PostgresSocialPersistenceModule';

const selectedPersistenceModule =
  getApiPersistence() === 'postgres' ? PostgresSocialPersistenceModule : InMemorySocialPersistenceModule;

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