1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 20:53:16 +00:00

[NO LOGIC] [PM-21100] Organize billing organization code (#6099)

* [NO LOGIC] Organize Billing organization code

* Run dotnet format
This commit is contained in:
Alex Morask
2025-07-17 12:02:25 -05:00
committed by GitHub
parent 9a501f95c8
commit ec70a18bda
52 changed files with 129 additions and 142 deletions

View File

@@ -3,7 +3,8 @@
using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationConnections.Interfaces;
using Bit.Core.Billing.Models.Business;
using Bit.Core.Billing.OrganizationFeatures.OrganizationLicenses.Interfaces;
using Bit.Core.Billing.Organizations.Models;
using Bit.Core.Billing.Organizations.Queries;
using Bit.Core.Context;
using Bit.Core.Exceptions;
using Bit.Core.Models.Api.OrganizationLicenses;
@@ -23,7 +24,7 @@ public class LicensesController : Controller
private readonly IUserRepository _userRepository;
private readonly IUserService _userService;
private readonly IOrganizationRepository _organizationRepository;
private readonly ICloudGetOrganizationLicenseQuery _cloudGetOrganizationLicenseQuery;
private readonly IGetCloudOrganizationLicenseQuery _getCloudOrganizationLicenseQuery;
private readonly IValidateBillingSyncKeyCommand _validateBillingSyncKeyCommand;
private readonly ICurrentContext _currentContext;
@@ -31,14 +32,14 @@ public class LicensesController : Controller
IUserRepository userRepository,
IUserService userService,
IOrganizationRepository organizationRepository,
ICloudGetOrganizationLicenseQuery cloudGetOrganizationLicenseQuery,
IGetCloudOrganizationLicenseQuery getCloudOrganizationLicenseQuery,
IValidateBillingSyncKeyCommand validateBillingSyncKeyCommand,
ICurrentContext currentContext)
{
_userRepository = userRepository;
_userService = userService;
_organizationRepository = organizationRepository;
_cloudGetOrganizationLicenseQuery = cloudGetOrganizationLicenseQuery;
_getCloudOrganizationLicenseQuery = getCloudOrganizationLicenseQuery;
_validateBillingSyncKeyCommand = validateBillingSyncKeyCommand;
_currentContext = currentContext;
}
@@ -84,7 +85,7 @@ public class LicensesController : Controller
throw new BadRequestException("Invalid Billing Sync Key");
}
var license = await _cloudGetOrganizationLicenseQuery.GetLicenseAsync(organization, _currentContext.InstallationId.Value);
var license = await _getCloudOrganizationLicenseQuery.GetLicenseAsync(organization, _currentContext.InstallationId.Value);
return license;
}
}

View File

@@ -6,7 +6,8 @@ using Bit.Api.Billing.Models.Responses;
using Bit.Api.Billing.Queries.Organizations;
using Bit.Core.Billing.Enums;
using Bit.Core.Billing.Models;
using Bit.Core.Billing.Models.Sales;
using Bit.Core.Billing.Organizations.Models;
using Bit.Core.Billing.Organizations.Services;
using Bit.Core.Billing.Pricing;
using Bit.Core.Billing.Providers.Services;
using Bit.Core.Billing.Services;

View File

@@ -9,12 +9,12 @@ using Bit.Api.Models.Request.Organizations;
using Bit.Api.Models.Response;
using Bit.Core.AdminConsole.Entities;
using Bit.Core.Billing.Constants;
using Bit.Core.Billing.Entities;
using Bit.Core.Billing.Models;
using Bit.Core.Billing.Models.Business;
using Bit.Core.Billing.OrganizationFeatures.OrganizationLicenses.Interfaces;
using Bit.Core.Billing.Organizations.Entities;
using Bit.Core.Billing.Organizations.Models;
using Bit.Core.Billing.Organizations.Queries;
using Bit.Core.Billing.Organizations.Repositories;
using Bit.Core.Billing.Pricing;
using Bit.Core.Billing.Repositories;
using Bit.Core.Billing.Services;
using Bit.Core.Context;
using Bit.Core.Enums;
@@ -39,7 +39,7 @@ public class OrganizationsController(
IUserService userService,
IPaymentService paymentService,
ICurrentContext currentContext,
ICloudGetOrganizationLicenseQuery cloudGetOrganizationLicenseQuery,
IGetCloudOrganizationLicenseQuery getCloudOrganizationLicenseQuery,
GlobalSettings globalSettings,
ILicensingService licensingService,
IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand,
@@ -98,7 +98,7 @@ public class OrganizationsController(
}
var org = await organizationRepository.GetByIdAsync(id);
var license = await cloudGetOrganizationLicenseQuery.GetLicenseAsync(org, installationId);
var license = await getCloudOrganizationLicenseQuery.GetLicenseAsync(org, installationId);
if (license == null)
{
throw new NotFoundException();