diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts index 5e320a269..c5ba4378e 100644 --- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts +++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts @@ -45,6 +45,8 @@ export class BillingSubscriptionService { private readonly stripeCustomerService: StripeCustomerService, private readonly twentyConfigService: TwentyConfigService, private readonly stripeSubscriptionItemService: StripeSubscriptionItemService, + @InjectRepository(BillingSubscriptionItem, 'core') + private readonly billingSubscriptionItemRepository: Repository, ) {} async getCurrentBillingSubscriptionOrThrow(criteria: { @@ -240,6 +242,11 @@ export class BillingSubscriptionService { }, ); + await this.billingSubscriptionItemRepository.update( + { stripeSubscriptionId: updatedSubscription.id }, + { hasReachedCurrentPeriodCap: false }, + ); + return { status: getSubscriptionStatus(updatedSubscription.status), hasPaymentMethod: true,