Public Access
1
0
Files
leads4less/shared/analytics/events.ts
T
pguerrerox 5508e15da1 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
2026-05-22 22:55:04 +00:00

31 lines
823 B
TypeScript

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;
}