2022-06-29 19:46:41 -04:00
|
|
|
|
using Bit.Core.Entities.Provider;
|
2021-06-03 18:58:29 +02:00
|
|
|
|
using Bit.Core.Enums.Provider;
|
2021-06-30 09:35:26 +02:00
|
|
|
|
using Bit.Core.Models.Data;
|
2021-06-03 18:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Admin.Models;
|
|
|
|
|
|
|
2021-08-10 12:28:00 -04:00
|
|
|
|
public class ProviderViewModel
|
2022-08-29 16:06:55 -04:00
|
|
|
|
{
|
2021-08-10 12:28:00 -04:00
|
|
|
|
public ProviderViewModel() { }
|
2022-08-29 14:53:16 -04:00
|
|
|
|
|
2021-08-10 12:28:00 -04:00
|
|
|
|
public ProviderViewModel(Provider provider, IEnumerable<ProviderUserUserDetails> providerUsers, IEnumerable<ProviderOrganizationOrganizationDetails> organizations)
|
2022-08-29 16:06:55 -04:00
|
|
|
|
{
|
2021-08-10 12:28:00 -04:00
|
|
|
|
Provider = provider;
|
2021-06-03 18:58:29 +02:00
|
|
|
|
UserCount = providerUsers.Count();
|
2021-08-10 12:28:00 -04:00
|
|
|
|
ProviderAdmins = providerUsers.Where(u => u.Type == ProviderUserType.ProviderAdmin);
|
2022-08-29 15:53:48 -04:00
|
|
|
|
|
2021-08-10 12:28:00 -04:00
|
|
|
|
ProviderOrganizations = organizations.Where(o => o.ProviderId == provider.Id);
|
2022-08-29 15:53:48 -04:00
|
|
|
|
}
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-06-03 18:58:29 +02:00
|
|
|
|
public int UserCount { get; set; }
|
|
|
|
|
|
public Provider Provider { get; set; }
|
2021-08-05 10:39:05 -04:00
|
|
|
|
public IEnumerable<ProviderUserUserDetails> ProviderAdmins { get; set; }
|
2021-08-10 12:28:00 -04:00
|
|
|
|
public IEnumerable<ProviderOrganizationOrganizationDetails> ProviderOrganizations { get; set; }
|
2021-06-03 18:58:29 +02:00
|
|
|
|
}
|