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