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