Browse Source

chore(api): update sms batch schema

pull/19/head
isra el 2 years ago
parent
commit
1e7aba00f1
  1. 6
      api/src/gateway/gateway.service.ts
  2. 12
      api/src/gateway/schemas/sms-batch.schema.ts

6
api/src/gateway/gateway.service.ts

@ -111,10 +111,8 @@ export class GatewayService {
smsBatch = await this.smsBatchModel.create({ smsBatch = await this.smsBatchModel.create({
device: device._id, device: device._id,
message, message,
metadata: {
recipientCount: recipients.length,
recipientPreview: this.getRecipientsPreview(recipients),
},
recipientCount: recipients.length,
recipientPreview: this.getRecipientsPreview(recipients),
}) })
} catch (e) { } catch (e) {
throw new HttpException( throw new HttpException(

12
api/src/gateway/schemas/sms-batch.schema.ts

@ -14,6 +14,18 @@ export class SMSBatch {
@Prop({ type: String }) @Prop({ type: String })
message: 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 // misc metadata for debugging
@Prop({ type: Object }) @Prop({ type: Object })
metadata: Record<string, any> metadata: Record<string, any>

Loading…
Cancel
Save