add stripe alert listening and cap on subscriptionItems (#11330)
in this PR : - reverting https://github.com/twentyhq/twenty/pull/11319 > at trial period end, subscriptions switch to 'past_due' status if payment method not set up - adding cap on subscriptionItems and updating them when receiving alert event + refreshing them when beginning a new subscription cycle closes https://github.com/twentyhq/core-team-issues/issues/606
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddHasReachedCurrentPeriodCapColumnInBillingSubscriptionItemTable1743577268972
|
||||
implements MigrationInterface
|
||||
{
|
||||
name =
|
||||
'AddHasReachedCurrentPeriodCapColumnInBillingSubscriptionItemTable1743577268972';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingSubscriptionItem" ADD "hasReachedCurrentPeriodCap" boolean NOT NULL DEFAULT false`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."billingSubscriptionItem" DROP COLUMN "hasReachedCurrentPeriodCap"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user