mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Fix build error
This commit is contained in:
@@ -75,7 +75,7 @@ import { CurrenciesModule } from './modules/currencies/currencies.module';
|
||||
PaymentsModule,
|
||||
TicketsModule,
|
||||
PassengersModule,
|
||||
NotificationsModule.register(),
|
||||
NotificationsModule,
|
||||
LoyaltyModule,
|
||||
WalletModule,
|
||||
PromosModule,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DynamicModule, Module } from '@nestjs/common';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
import { ClientsModule, Transport } from '@nestjs/microservices';
|
||||
import { NotificationsController } from './notifications.controller';
|
||||
@@ -11,47 +11,25 @@ import { SmsClientService } from './sms-client.service';
|
||||
imports: [
|
||||
HttpModule.register({ timeout: 10_000 }),
|
||||
ClientsModule.register([
|
||||
{
|
||||
name: 'SMS_SERVICE',
|
||||
transport: Transport.RMQ,
|
||||
options: {
|
||||
urls: [process.env.RABBITMQ_URL as string],
|
||||
queue: 'sms_queue',
|
||||
queueOptions: { durable: true },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'EMAIL_SERVICE',
|
||||
transport: Transport.RMQ,
|
||||
options: {
|
||||
urls: [process.env.RABBITMQ_URL as string],
|
||||
queue: 'email_queue',
|
||||
queue: process.env.EMAIL_QUEUE ?? 'email_queue',
|
||||
queueOptions: { durable: true },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NOTIFICATION_SERVICE',
|
||||
name: 'SMS_SERVICE',
|
||||
transport: Transport.RMQ,
|
||||
options: {
|
||||
urls: [process.env.RABBITMQ_URL as string],
|
||||
queue: 'notification_queue',
|
||||
queue: process.env.SMS_QUEUE ?? 'sms_queue',
|
||||
queueOptions: { durable: true },
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
@Module({})
|
||||
export class NotificationsModule {
|
||||
static register(): DynamicModule {
|
||||
const rmqEnabled = process.env.RABBITMQ_ENABLED !== 'false';
|
||||
|
||||
return {
|
||||
module: NotificationsModule,
|
||||
imports: [
|
||||
HttpModule.register({ timeout: 10_000 }),
|
||||
...(rmqEnabled ? [rmqClientsModule] : []),
|
||||
]),
|
||||
],
|
||||
controllers: [NotificationsController],
|
||||
providers: [
|
||||
@@ -59,16 +37,9 @@ export class NotificationsModule {
|
||||
EmailAdapter,
|
||||
SmsAdapter,
|
||||
PushAdapter,
|
||||
...(rmqEnabled
|
||||
? [EmailClientService, SmsClientService]
|
||||
: [
|
||||
{ provide: 'EMAIL_SERVICE', useValue: null },
|
||||
{ provide: 'SMS_SERVICE', useValue: null },
|
||||
EmailClientService,
|
||||
SmsClientService,
|
||||
]),
|
||||
],
|
||||
exports: [NotificationsService, EmailClientService, SmsClientService],
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
export class NotificationsModule {}
|
||||
|
||||
Reference in New Issue
Block a user