@@ -32,6 +32,7 @@ export function computeSubscriptionState(subscription: Optional<Subscription, 's
3232 account,
3333 plan : { actual, effective } ,
3434 } = subscription ;
35+ return SubscriptionState . Paid ;
3536
3637 if ( account ?. verified === false ) return SubscriptionState . VerificationRequired ;
3738
@@ -81,6 +82,7 @@ export function computeSubscriptionState(subscription: Optional<Subscription, 's
8182}
8283
8384export function getSubscriptionNextPaidPlanId ( subscription : Optional < Subscription , 'state' > ) : PaidSubscriptionPlanIds {
85+ return 'pro' ;
8486 const next = orderedPaidPlans . indexOf ( subscription . plan . actual . id as PaidSubscriptionPlanIds ) + 1 ;
8587 if ( next >= orderedPaidPlans . length ) return 'enterprise' ; // Not sure what to do here
8688
@@ -98,15 +100,15 @@ export function getSubscriptionPlan(
98100 nextTrialOptInDate ?: string ,
99101) : SubscriptionPlan {
100102 return {
101- id : id ,
102- name : getSubscriptionProductPlanName ( id ) ,
103+ id : 'pro' ,
104+ name : getSubscriptionProductPlanName ( 'pro' ) ,
103105 bundle : bundle ,
104- cancelled : cancelled ,
106+ cancelled : false ,
105107 organizationId : organizationId ,
106108 trialReactivationCount : trialReactivationCount ,
107109 nextTrialOptInDate : nextTrialOptInDate ,
108110 startedOn : ( startedOn ?? new Date ( ) ) . toISOString ( ) ,
109- expiresOn : expiresOn != null ? expiresOn . toISOString ( ) : undefined ,
111+ expiresOn : new Date ( '2099-12-31' ) . toISOString ( ) ,
110112 } ;
111113}
112114
@@ -157,6 +159,7 @@ export function getSubscriptionProductPlanNameFromState(
157159 planId ?: SubscriptionPlanIds ,
158160 _effectivePlanId ?: SubscriptionPlanIds ,
159161) : string {
162+ return getSubscriptionProductPlanName ( 'pro' ) ;
160163 switch ( state ) {
161164 case SubscriptionState . Community :
162165 case SubscriptionState . Trial :
@@ -209,10 +212,12 @@ export function isSubscriptionPaid(subscription: Optional<Subscription, 'state'>
209212}
210213
211214export function isSubscriptionPaidPlan ( id : SubscriptionPlanIds ) : id is PaidSubscriptionPlanIds {
215+ return true ;
212216 return orderedPaidPlans . includes ( id as PaidSubscriptionPlanIds ) ;
213217}
214218
215219export function isSubscriptionExpired ( subscription : Optional < Subscription , 'state' > ) : boolean {
220+ return false ;
216221 const remaining = getSubscriptionTimeRemaining ( subscription ) ;
217222 return remaining != null && remaining <= 0 ;
218223}
@@ -238,26 +243,28 @@ export function getCommunitySubscription(subscription?: Subscription): Subscript
238243 ...subscription ,
239244 plan : {
240245 actual : getSubscriptionPlan (
241- 'community ' ,
246+ 'pro ' ,
242247 false ,
243248 0 ,
244249 undefined ,
245250 subscription ?. plan ?. actual ?. startedOn != null
246251 ? new Date ( subscription . plan . actual . startedOn )
247252 : undefined ,
253+ new Date ( '2099-12-31' )
248254 ) ,
249255 effective : getSubscriptionPlan (
250- 'community ' ,
256+ 'pro ' ,
251257 false ,
252258 0 ,
253259 undefined ,
254260 subscription ?. plan ?. actual ?. startedOn != null
255261 ? new Date ( subscription . plan . actual . startedOn )
256262 : undefined ,
263+ new Date ( '2099-12-31' )
257264 ) ,
258265 } ,
259266 account : undefined ,
260267 activeOrganization : undefined ,
261- state : SubscriptionState . Community ,
268+ state : SubscriptionState . Paid ,
262269 } ;
263270}
0 commit comments