feat: launch Stripe billing flows with lifecycle hardening and analytics
add Stripe checkout, portal, webhook ingestion, and idempotent event persistence add billing lifecycle state (grace/sync/timeline/admin visibility) and stronger entitlement handling add analytics event tracking and admin summary APIs plus account/pricing UI integration
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
export type AnalyticsEventName =
|
||||
| 'pricing_plan_selected'
|
||||
| 'checkout_started'
|
||||
| 'checkout_completed'
|
||||
| 'checkout_canceled'
|
||||
| 'portal_opened'
|
||||
| 'quota_warning_shown'
|
||||
| 'quota_exhausted_blocked'
|
||||
| 'feature_gate_encountered'
|
||||
| 'addon_checkout_started'
|
||||
| 'addon_purchase_completed'
|
||||
| 'plan_changed'
|
||||
| 'payment_failed'
|
||||
| 'subscription_canceled';
|
||||
|
||||
export type AnalyticsEventSource = 'web_app' | 'api' | 'stripe_webhook' | 'system';
|
||||
|
||||
export interface AnalyticsEventInput {
|
||||
eventName: AnalyticsEventName;
|
||||
eventSource: AnalyticsEventSource;
|
||||
userId?: string | null;
|
||||
workspaceId?: string | null;
|
||||
planCode?: string | null;
|
||||
addonCode?: string | null;
|
||||
resource?: string | null;
|
||||
amount?: number | null;
|
||||
currency?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
occurredAt?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user