fix: track live downstream cmpp connections
This commit is contained in:
@@ -11,11 +11,15 @@ import {
|
||||
GatewayUplinkEventDto,
|
||||
SendChainService,
|
||||
} from './send-chain.service';
|
||||
import { GatewayDownstreamConnectionEventDto, SmsConfigService } from '../sms-config/sms-config.service';
|
||||
|
||||
@ApiTags('gateway-events')
|
||||
@Controller('gateway/events')
|
||||
export class GatewayEventsController {
|
||||
constructor(private readonly sendChain: SendChainService) {}
|
||||
constructor(
|
||||
private readonly sendChain: SendChainService,
|
||||
private readonly smsConfig: SmsConfigService,
|
||||
) {}
|
||||
|
||||
@Post('submit-result')
|
||||
submitResult(@Body() body: GatewaySubmitResultDto) {
|
||||
@@ -47,6 +51,11 @@ export class GatewayEventsController {
|
||||
return this.sendChain.submitInboundMessage(body);
|
||||
}
|
||||
|
||||
@Post('inbound/connection')
|
||||
inboundConnection(@Body() body: GatewayDownstreamConnectionEventDto) {
|
||||
return this.smsConfig.recordDownstreamConnectionEvent(body);
|
||||
}
|
||||
|
||||
@Post('downstream/pending')
|
||||
pendingDownstream(@Body() body: GatewayPendingDeliveryQueryDto) {
|
||||
return this.sendChain.listPendingDownstreamDeliveries(body);
|
||||
|
||||
@@ -2,16 +2,16 @@ import { Module } from '@nestjs/common';
|
||||
import { BillingModule } from '../billing/billing.module';
|
||||
import { PrismaModule } from '../prisma/prisma.module';
|
||||
import { RiskReviewModule } from '../risk-review/risk-review.module';
|
||||
import { SmsConfigModule } from '../sms-config/sms-config.module';
|
||||
import { AdminSendChainController } from './admin-send-chain.controller';
|
||||
import { ClientSendChainController } from './client-send-chain.controller';
|
||||
import { GatewayEventsController } from './gateway-events.controller';
|
||||
import { SendChainService } from './send-chain.service';
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, BillingModule, RiskReviewModule],
|
||||
imports: [PrismaModule, BillingModule, RiskReviewModule, SmsConfigModule],
|
||||
controllers: [AdminSendChainController, ClientSendChainController, GatewayEventsController],
|
||||
providers: [SendChainService],
|
||||
exports: [SendChainService],
|
||||
})
|
||||
export class SendChainModule {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user