/**
 * Cache Module
 *
 * Provides Redis cache adapter as CachePort implementation
 */

import { Module, Global } from '@nestjs/common';
import { RedisCacheAdapter } from './redis-cache.adapter';
import { CACHE_PORT } from '@domain/ports/out/cache.port';

@Global()
@Module({
  providers: [
    {
      provide: CACHE_PORT,
      useClass: RedisCacheAdapter,
    },
    RedisCacheAdapter,
  ],
  exports: [CACHE_PORT, RedisCacheAdapter],
})
export class CacheModule {}
