Skip to content

Commit

Permalink
Use verified flag to compute statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Nov 8, 2024
1 parent e1f4463 commit fed388f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/meteor/server/models/raw/LivechatContacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export class LivechatContactsRaw extends BaseRaw<ILivechatContact> 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,
Expand Down Expand Up @@ -249,7 +254,7 @@ export class LivechatContactsRaw extends BaseRaw<ILivechatContact> implements IL
}

countVerified(): Promise<number> {
return this.countDocuments({ unknown: false });
return this.countDocuments({ 'channels.verified': true });
}

countContactsWithoutChannels(): Promise<number> {
Expand Down

0 comments on commit fed388f

Please sign in to comment.