mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 17:12:49 -05:00
[EC-247] Add columns to provider portal clients table (#2136)
* Added migration script to alter ProviderOrganizationOrganizationDetailsView to add new columns UserCount, Seats and Plan * Modified EF query ProviderOrganizationOrganizationDetailsReadByProviderIdQuery * Modified model to output new view columns * Updated view to count only active users * Filtering the organization user count by only confirmed users
This commit is contained in:
@ -15,6 +15,8 @@ namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
||||
var query = from po in dbContext.ProviderOrganizations
|
||||
join o in dbContext.Organizations
|
||||
on po.OrganizationId equals o.Id
|
||||
join ou in dbContext.OrganizationUsers
|
||||
on po.OrganizationId equals ou.OrganizationId
|
||||
where po.ProviderId == _providerId
|
||||
select new { po, o };
|
||||
return query.Select(x => new ProviderOrganizationOrganizationDetails()
|
||||
@ -27,6 +29,9 @@ namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
||||
Settings = x.po.Settings,
|
||||
CreationDate = x.po.CreationDate,
|
||||
RevisionDate = x.po.RevisionDate,
|
||||
UserCount = x.o.OrganizationUsers.Count(ou => ou.Status == Core.Enums.OrganizationUserStatusType.Confirmed),
|
||||
Seats = x.o.Seats,
|
||||
Plan = x.o.Plan
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user