remove feature flag on billing metered product + fixes (#11570)

- remove feature flag
- design fixes
This commit is contained in:
Etienne
2025-04-14 18:39:19 +02:00
committed by GitHub
parent 9a69cd0b61
commit 0249cf3b34
8 changed files with 18 additions and 37 deletions

View File

@ -139,7 +139,9 @@ export class BillingPlanService {
);
}
const filterPricesByInterval = (product: BillingProduct) =>
product.billingPrices.filter((price) => price.interval === interval);
product.billingPrices.filter(
(price) => price.interval === interval && price.active,
);
const meteredProductsPrices = meteredProducts.flatMap(
filterPricesByInterval,

View File

@ -13,8 +13,6 @@ import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billin
import { BillingProductService } from 'src/engine/core-modules/billing/services/billing-product.service';
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
import { getPlanKeyFromSubscription } from 'src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
@Injectable()
@ -24,7 +22,6 @@ export class BillingService {
private readonly twentyConfigService: TwentyConfigService,
private readonly billingSubscriptionService: BillingSubscriptionService,
private readonly billingProductService: BillingProductService,
private readonly featureFlagService: FeatureFlagService,
@InjectRepository(BillingSubscription, 'core')
private readonly billingSubscriptionRepository: Repository<BillingSubscription>,
) {}
@ -74,16 +71,6 @@ export class BillingService {
workspaceId: string,
productKey: BillingProductKey,
) {
const isMeteredProductBillingEnabled =
await this.featureFlagService.isFeatureEnabled(
FeatureFlagKey.IsMeteredProductBillingEnabled,
workspaceId,
);
if (!isMeteredProductBillingEnabled) {
return true;
}
const subscription =
await this.billingSubscriptionService.getCurrentBillingSubscriptionOrThrow(
{ workspaceId },

View File

@ -12,5 +12,4 @@ export enum FeatureFlagKey {
IsApprovedAccessDomainsEnabled = 'IS_APPROVED_ACCESS_DOMAINS_ENABLED',
IsNewRelationEnabled = 'IS_NEW_RELATION_ENABLED',
IsPermissionsV2Enabled = 'IS_PERMISSIONS_V2_ENABLED',
IsMeteredProductBillingEnabled = 'IS_METERED_PRODUCT_BILLING_ENABLED',
}