From fed388ff87ca5018ba0df518e35c6c798cea4b56 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Fri, 8 Nov 2024 19:35:19 -0300 Subject: [PATCH] Use verified flag to compute statistic --- apps/meteor/server/models/raw/LivechatContacts.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/meteor/server/models/raw/LivechatContacts.ts b/apps/meteor/server/models/raw/LivechatContacts.ts index 55093cce6a6e..fcfc92ea1279 100644 --- a/apps/meteor/server/models/raw/LivechatContacts.ts +++ b/apps/meteor/server/models/raw/LivechatContacts.ts @@ -59,6 +59,11 @@ export class LivechatContactsRaw extends BaseRaw implements IL partialFilterExpression: { 'channels.blocked': { $exists: true } }, unique: false, }, + { + key: { 'channels.verified': 1 }, + partialFilterExpression: { 'channels.verified': { $exists: true } }, + unique: false, + }, { key: { unknown: 1 }, unique: false, @@ -249,7 +254,7 @@ export class LivechatContactsRaw extends BaseRaw implements IL } countVerified(): Promise { - return this.countDocuments({ unknown: false }); + return this.countDocuments({ 'channels.verified': true }); } countContactsWithoutChannels(): Promise {