mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
[AC-1904] Implement endpoint to retrieve Provider subscription (#3921)
* Refactor Core.Billing prior to adding new logic * Add ProviderBillingQueries.GetSubscriptionData * Add ProviderBillingController.GetSubscriptionAsync
This commit is contained in:
@ -16,14 +16,17 @@ public class ProviderPlanRepository(
|
||||
mapper,
|
||||
context => context.ProviderPlans), IProviderPlanRepository
|
||||
{
|
||||
public async Task<ProviderPlan> GetByProviderId(Guid providerId)
|
||||
public async Task<ICollection<ProviderPlan>> GetByProviderId(Guid providerId)
|
||||
{
|
||||
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
var databaseContext = GetDatabaseContext(serviceScope);
|
||||
|
||||
var query =
|
||||
from providerPlan in databaseContext.ProviderPlans
|
||||
where providerPlan.ProviderId == providerId
|
||||
select providerPlan;
|
||||
return await query.FirstOrDefaultAsync();
|
||||
|
||||
return await query.ToArrayAsync();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user