Skip to content

Commit 0496a54

Browse files
authored
feat(schemas,console): reserve new pro-202508 planId (#7679)
reserve new pro-202508 planId
1 parent 272f717 commit 0496a54

File tree

9 files changed

+32
-12
lines changed

9 files changed

+32
-12
lines changed

packages/console/src/components/FeatureTag/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const planTagMap = {
1818
[ReservedPlanId.Free]: 'free',
1919
[ReservedPlanId.Pro]: 'pro',
2020
[ReservedPlanId.Pro202411]: 'pro',
21+
[ReservedPlanId.Pro202509]: 'pro',
2122
[ReservedPlanId.Development]: 'dev',
2223
[ReservedPlanId.Admin]: 'admin',
2324
enterprise: 'enterprise',
@@ -27,7 +28,10 @@ const planTagMap = {
2728
* The minimum plan required to use the feature.
2829
* Currently we only have pro plan paywall.
2930
*/
30-
export type PaywallPlanId = Extract<ReservedPlanId, ReservedPlanId.Pro | ReservedPlanId.Pro202411>;
31+
export type PaywallPlanId = Extract<
32+
ReservedPlanId,
33+
ReservedPlanId.Pro | ReservedPlanId.Pro202411 | ReservedPlanId.Pro202509
34+
>;
3135

3236
export type Props = {
3337
/**

packages/console/src/components/PlanDescription/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const registeredPlanDescriptionPhrasesMap: Record<
1010
[ReservedPlanId.Free]: 'free_plan_description',
1111
[ReservedPlanId.Pro]: 'pro_plan_description',
1212
[ReservedPlanId.Pro202411]: 'pro_plan_description',
13+
[ReservedPlanId.Pro202509]: 'pro_plan_description',
1314
};
1415

1516
const getRegisteredPlanDescriptionPhrase = (

packages/console/src/components/SkuName/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const registeredPlanNamePhraseMap: Record<
99
[ReservedPlanId.Free]: 'free_plan',
1010
[ReservedPlanId.Pro]: 'pro_plan',
1111
[ReservedPlanId.Pro202411]: 'pro_plan',
12+
[ReservedPlanId.Pro202509]: 'pro_plan',
1213
[ReservedPlanId.Development]: 'dev_plan',
1314
[ReservedPlanId.Admin]: 'admin_plan',
1415
} satisfies Record<ReservedPlanId, TFuncKey<'translation', 'admin_console.subscription'>>;

packages/console/src/consts/plan-quotas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const ticketSupportResponseTimeMap: Record<string, number> = {
99
[ReservedPlanId.Free]: 0,
1010
[ReservedPlanId.Pro]: 48,
1111
[ReservedPlanId.Pro202411]: 48,
12+
[ReservedPlanId.Pro202509]: 48,
1213
};
1314

1415
/**

packages/console/src/consts/subscriptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const planIdOrder: Record<string, number> = Object.freeze({
4242
[ReservedPlanId.Free]: 0,
4343
[ReservedPlanId.Pro]: 1,
4444
[ReservedPlanId.Pro202411]: 1,
45+
[ReservedPlanId.Pro202509]: 1,
4546
});
4647

4748
export const checkoutStateQueryKey = 'checkout-state';

packages/console/src/utils/subscription.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ export const isFeatureEnabled = (quota: Nullable<number>): boolean => {
123123

124124
/**
125125
* We may have more than one pro planId in the future.
126-
* E.g grandfathered {@link ReservedPlanId.Pro} and new {@link ReservedPlanId.Pro202411}.
126+
* E.g grandfathered {@link ReservedPlanId.Pro}, {@link ReservedPlanId.Pro202411} and new {@link ReservedPlanId.Pro202509}.
127127
* User this function to check if the planId can be considered as a pro plan.
128128
*/
129129
export const isProPlan = (planId: string) =>
130-
// eslint-disable-next-line no-restricted-syntax
131-
[ReservedPlanId.Pro, ReservedPlanId.Pro202411].includes(planId as ReservedPlanId);
130+
[ReservedPlanId.Pro, ReservedPlanId.Pro202411, ReservedPlanId.Pro202509].includes(
131+
// eslint-disable-next-line no-restricted-syntax
132+
planId as ReservedPlanId
133+
);

packages/core/src/libraries/quota.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ import type Queries from '../tenants/Queries.js';
2020
import { type CloudConnectionLibrary } from './cloud-connection.js';
2121
import { type ConnectorLibrary } from './connector.js';
2222

23-
const paidReservedPlans = new Set<string>([ReservedPlanId.Pro, ReservedPlanId.Pro202411]);
23+
const paidReservedPlans = new Set<string>([
24+
ReservedPlanId.Pro,
25+
ReservedPlanId.Pro202411,
26+
ReservedPlanId.Pro202509,
27+
]);
2428

2529
export class QuotaLibrary {
2630
constructor(

packages/core/src/libraries/subscription.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ describe('get subscription data with cache expiration', () => {
7979
jest.advanceTimersByTime(60 * 60 * 24);
8080
mockGetTenantSubscription.mockResolvedValueOnce({
8181
...mockSubscription,
82-
planId: ReservedPlanId.Pro202411,
82+
planId: ReservedPlanId.Pro202509,
8383
});
8484

8585
// Should get new subscription data
8686
const refreshedSubscriptionData = await subscription.getSubscriptionData();
8787
expect(refreshedSubscriptionData).toEqual({
8888
...mockSubscription,
89-
planId: ReservedPlanId.Pro202411,
89+
planId: ReservedPlanId.Pro202509,
9090
});
9191
expect(mockGetTenantSubscription).toHaveBeenCalled();
9292
});
@@ -118,14 +118,14 @@ describe('get subscription data with cache expiration', () => {
118118
jest.advanceTimersByTime(2 * 60 * 60);
119119
mockGetTenantSubscription.mockResolvedValueOnce({
120120
...mockFarFutureSubscription,
121-
planId: ReservedPlanId.Pro202411,
121+
planId: ReservedPlanId.Pro202509,
122122
});
123123

124124
// Should get new subscription data due to max TTL
125125
const refreshedSubscriptionData = await subscription.getSubscriptionData();
126126
expect(refreshedSubscriptionData).toEqual({
127127
...mockFarFutureSubscription,
128-
planId: ReservedPlanId.Pro202411,
128+
planId: ReservedPlanId.Pro202509,
129129
});
130130
expect(mockGetTenantSubscription).toHaveBeenCalled();
131131
});
@@ -149,14 +149,14 @@ describe('get subscription data with cache expiration', () => {
149149
jest.advanceTimersByTime(60 * 60);
150150
mockGetTenantSubscription.mockResolvedValueOnce({
151151
...mockExpiredSubscription,
152-
planId: ReservedPlanId.Pro202411,
152+
planId: ReservedPlanId.Pro202509,
153153
});
154154

155155
// Should get new subscription data since the cache should be invalidated
156156
const refreshedSubscriptionData = await subscription.getSubscriptionData();
157157
expect(refreshedSubscriptionData).toEqual({
158158
...mockExpiredSubscription,
159-
planId: ReservedPlanId.Pro202411,
159+
planId: ReservedPlanId.Pro202509,
160160
});
161161
expect(mockGetTenantSubscription).toHaveBeenCalled();
162162
});

packages/schemas/src/consts/subscriptions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ export enum ReservedPlanId {
1919
*/
2020
Admin = 'admin',
2121
/**
22-
* The latest Pro plan ID applied from 2024-11.
22+
* @deprecated
23+
* Grandfathered Pro plan ID deprecated from 2025-09.
24+
* Use {@link Pro202509} instead.
2325
*/
2426
Pro202411 = 'pro-202411',
27+
/**
28+
* Latest Pro plan ID applied from 2025-09.
29+
*/
30+
Pro202509 = 'pro-202509',
2531
}
2632

2733
/**

0 commit comments

Comments
 (0)