fix: add StorageModule import to CsvRateModule for S3 support
- Export S3StorageAdapter directly from StorageModule - Import StorageModule and ConfigModule in CsvRateModule - Fix dependency injection for S3StorageAdapter in CSV controllers
This commit is contained in:
parent
753cfae41d
commit
4f0d6f8f08
@ -1,5 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
// Domain Services
|
||||
import { CsvRateSearchService } from '@domain/services/csv-rate-search.service';
|
||||
@ -8,6 +9,7 @@ import { CsvRateSearchService } from '@domain/services/csv-rate-search.service';
|
||||
import { CsvRateLoaderAdapter } from './csv-rate-loader.adapter';
|
||||
import { CsvConverterService } from './csv-converter.service';
|
||||
import { TypeOrmCsvRateConfigRepository } from '@infrastructure/persistence/typeorm/repositories/typeorm-csv-rate-config.repository';
|
||||
import { StorageModule } from '@infrastructure/storage/storage.module';
|
||||
|
||||
// Application Layer
|
||||
import { CsvRateMapper } from '@application/mappers/csv-rate.mapper';
|
||||
@ -32,6 +34,10 @@ import { CsvRateConfigOrmEntity } from '@infrastructure/persistence/typeorm/enti
|
||||
imports: [
|
||||
// TypeORM entities
|
||||
TypeOrmModule.forFeature([CsvRateConfigOrmEntity]),
|
||||
// Storage for MinIO/S3 support
|
||||
StorageModule,
|
||||
// Config for S3 configuration
|
||||
ConfigModule,
|
||||
],
|
||||
providers: [
|
||||
// Infrastructure Adapters (must be before services that depend on them)
|
||||
|
||||
@ -12,11 +12,12 @@ import { STORAGE_PORT } from '@domain/ports/out/storage.port';
|
||||
@Module({
|
||||
imports: [ConfigModule],
|
||||
providers: [
|
||||
S3StorageAdapter, // Add direct provider for dependency injection
|
||||
{
|
||||
provide: STORAGE_PORT,
|
||||
useClass: S3StorageAdapter,
|
||||
},
|
||||
],
|
||||
exports: [STORAGE_PORT],
|
||||
exports: [STORAGE_PORT, S3StorageAdapter], // Export both token and class
|
||||
})
|
||||
export class StorageModule {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user