feat(core): adjust subscription related mixpanel (#7536)

This commit is contained in:
CatsJuice
2024-07-26 02:49:15 +00:00
parent 549e7befed
commit a714961b20
13 changed files with 169 additions and 92 deletions
@@ -0,0 +1,7 @@
import type { PlanChangeStartedEvent } from './plan-change-started';
import type { PlanChangeSucceededEvent } from './plan-change-succeed';
export interface MixpanelEvents {
PlanChangeStarted: PlanChangeStartedEvent;
PlanChangeSucceeded: PlanChangeSucceededEvent;
}
@@ -0,0 +1,15 @@
import type { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql';
/**
* Before subscription plan changed
*/
export interface PlanChangeStartedEvent {
segment: 'settings panel';
module: 'pricing plan list' | 'billing subscription list';
control:
| 'new subscription' // no subscription before
| 'cancel'
| 'paying'; // resume: subscribed before
type: SubscriptionPlan;
category: SubscriptionRecurring;
}
@@ -0,0 +1,9 @@
import type { PlanChangeStartedEvent } from './plan-change-started';
/**
* Subscription plan changed successfully
*/
export type PlanChangeSucceededEvent = Pick<
PlanChangeStartedEvent,
'control' | 'type' | 'category'
>;