Merge pull request #4673 from Infisical/fix/billingPageIdentitiesCount

Add condition to exclude invited members from total identity count in billing query
This commit is contained in:
carlosmonastyrski
2025-10-14 11:12:57 -03:00
committed by GitHub

View File

@@ -5,6 +5,7 @@ import {
AccessScope,
OrganizationsSchema,
OrgMembershipRole,
OrgMembershipStatus,
TableName,
TMemberships,
TMembershipsInsert,
@@ -346,6 +347,7 @@ export const orgDALFactory = (db: TDbClient) => {
.replicaNode()(TableName.Membership)
.where(`${TableName.Membership}.scopeOrgId`, orgId)
.where(`${TableName.Membership}.scope`, AccessScope.Organization)
.where(`${TableName.Membership}.status`, OrgMembershipStatus.Accepted)
.whereNotNull(`${TableName.Membership}.actorUserId`)
.count("*")
.join(TableName.Users, `${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)