From 1e7aba00f11a59f7ebd0f3e2d4cbb3ea16c4a484 Mon Sep 17 00:00:00 2001 From: isra el Date: Sun, 28 Apr 2024 19:37:29 +0300 Subject: [PATCH] chore(api): update sms batch schema --- api/src/gateway/gateway.service.ts | 6 ++---- api/src/gateway/schemas/sms-batch.schema.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/api/src/gateway/gateway.service.ts b/api/src/gateway/gateway.service.ts index 0034b43..8df0d50 100644 --- a/api/src/gateway/gateway.service.ts +++ b/api/src/gateway/gateway.service.ts @@ -111,10 +111,8 @@ export class GatewayService { smsBatch = await this.smsBatchModel.create({ device: device._id, message, - metadata: { - recipientCount: recipients.length, - recipientPreview: this.getRecipientsPreview(recipients), - }, + recipientCount: recipients.length, + recipientPreview: this.getRecipientsPreview(recipients), }) } catch (e) { throw new HttpException( diff --git a/api/src/gateway/schemas/sms-batch.schema.ts b/api/src/gateway/schemas/sms-batch.schema.ts index 405d064..bc48e89 100644 --- a/api/src/gateway/schemas/sms-batch.schema.ts +++ b/api/src/gateway/schemas/sms-batch.schema.ts @@ -14,6 +14,18 @@ export class SMSBatch { @Prop({ type: String }) message: string + @Prop({ type: Boolean, default: false }) + encrypted: boolean + + @Prop({ type: String }) + encryptedMessage: string + + @Prop({ type: Number }) + recipientCount: number + + @Prop({ type: String }) + recipientPreview: string + // misc metadata for debugging @Prop({ type: Object }) metadata: Record