payload details fix backend

This commit is contained in:
yetmgetaewunetu
2025-10-05 16:33:19 +03:00
parent b57ebc7500
commit 82aa3cb425
2 changed files with 10 additions and 4 deletions

View File

@@ -754,7 +754,11 @@ recipient,
}
// Update the SMS
const updatedSms = await this.smsModel.findByIdAndUpdate(dto.smsId, { $set: updateData });
const updatedSms = await this.smsModel.findByIdAndUpdate(
dto.smsId,
{ $set: updateData },
{ new: true }
);
// Check if all SMS in batch have the same status, then update batch status
if (dto.smsBatchId) {

View File

@@ -27,17 +27,18 @@ const message_send_template = {
recipient: "+123456789",
deviceId: 'deviceId',
webhookSubscriptionId: 'webhookSubscriptionId',
webhookEvent: 'sms.received',
}
const sms_delivered_payload = {
...message_send_template,
sentAt: "datetime",
deliveredAt: 'datetime',
webhookEvent: 'sms.delivered',
}
const sms_sent_payload = {
...message_send_template,
status: "sent"
status: "sent",
webhookEvent: 'sms.sent',
}
const sms_sent_failed = {
@@ -45,7 +46,8 @@ const sms_sent_failed = {
status: "failed",
errorCode: "ErorCode",
errorMessage: "Error",
failedAt: "datetime"
failedAt: "datetime",
webhookEvent: 'sms.send_failed',
}
const VERIFICATION_CODE = `