mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
fix: ( sms ) change the key sms to text
This commit is contained in:
@@ -35,14 +35,13 @@ export class SmsClientService implements OnApplicationBootstrap {
|
||||
this.logger.warn(`RABBITMQ disabled — skipped SMS to ${dto.to}`);
|
||||
return {};
|
||||
}
|
||||
// The external send-sms consumer reads the content from `sms`, not `message`.
|
||||
this.smsClient.emit("send-sms", {
|
||||
to: dto.to,
|
||||
sms: dto.message,
|
||||
text: dto.message,
|
||||
appKey: "IFHCRS-LICENSE-MANAGEMENT",
|
||||
});
|
||||
this.logger.log(
|
||||
`SMS emitted to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='send-sms' to=${dto.to} sms="${dto.message}"`,
|
||||
`SMS emitted to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='send-sms' to=${dto.to} text="${dto.message}"`,
|
||||
);
|
||||
return {};
|
||||
}
|
||||
@@ -52,14 +51,13 @@ export class SmsClientService implements OnApplicationBootstrap {
|
||||
this.logger.warn(`RABBITMQ disabled — skipped BULK SMS (${dto.messages?.length ?? 0} messages)`);
|
||||
return {};
|
||||
}
|
||||
const messages = (dto.messages ?? []).map((m) => ({ to: m.to, text: m.message, from: m.from }));
|
||||
this.smsClient.emit("ozeking-bulk-sms", {
|
||||
...dto,
|
||||
messages,
|
||||
appKey: "IFHCRS-LICENSE-MANAGEMENT",
|
||||
});
|
||||
this.logger.log(
|
||||
`BULK SMS emitted to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='ozeking-bulk-sms' count=${dto.messages?.length ?? 0} messages=${JSON.stringify(
|
||||
(dto.messages ?? []).map((m) => ({ to: m.to, message: m.message })),
|
||||
)}`,
|
||||
`BULK SMS emitted to RabbitMQ [${process.env.SMS_QUEUE ?? "sms_queue"}] pattern='ozeking-bulk-sms' count=${messages.length} messages=${JSON.stringify(messages)}`,
|
||||
);
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user