Ajuste conexao oracle & postgres

This commit is contained in:
unknown
2025-03-28 17:03:25 -03:00
parent d2ffb266db
commit b98b219e52
28 changed files with 916 additions and 1383 deletions

View File

@@ -1,13 +1,10 @@
import { BaseModule } from './core/services/base.module';
import { BaseService } from './core/services/base.service';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { createOracleConfig } from './core/configs/typeorm.oracle.config';
import { createPostgresConfig } from './core/configs/typeorm.postgres.config';
import { LogisticModule } from './logistic/logistic.module';
import { OrdersPaymentModule } from './orders-payment/orders-payment.module';
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable prettier/prettier */
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { typeOrmConfig, typeOrmPgConfig } from './core/configs/typeorm.config';
import { ProductsModule } from './products/products.module';
import { AuthModule } from './auth/auth/auth.module';
import { DataConsultModule } from './data-consult/data-consult.module';
@@ -18,13 +15,22 @@ import { ReasonTableModule } from './crm/reason-table/reason-table.module';
import { NegotiationsModule } from './crm/negotiations/negotiations.module';
import { HttpModule } from '@nestjs/axios';
import { LogisticController } from './logistic/logistic.controller';
import { CacheModule } from './core/configs/cache/redis.module';
import { LogisticService } from './logistic/logistic.service';
import { LoggerModule } from './Log/logger.module';
@Module({
imports: [
BaseModule,
ConfigModule.forRoot({ isGlobal: true }), // necessário para ConfigService
TypeOrmModule.forRootAsync({
name: 'oracle',
inject: [ConfigService],
useFactory: createOracleConfig,
}),
TypeOrmModule.forRootAsync({
name: 'postgres',
inject: [ConfigService],
useFactory: createPostgresConfig,
}),
LogisticModule,
OrdersPaymentModule,
HttpModule,
@@ -36,14 +42,8 @@ import { LoggerModule } from './Log/logger.module';
ProductsModule,
AuthModule,
OrdersModule,
TypeOrmModule.forRoot(typeOrmConfig),
TypeOrmModule.forRoot(typeOrmPgConfig),
CacheModule,
],
controllers: [
OcorrencesController, LogisticController,],
providers: [
BaseService, LogisticService,],
controllers: [OcorrencesController, LogisticController],
providers: [ LogisticService],
})
export class AppModule { }
export class AppModule {}