import { describe, expect, it } from 'bun:test'; /** * Helper that replicates the mapWebhookTypeToStatus logic * used in webhook business files for testability. */ export function mapWebhookTypeToStatus( eventType: 'activated' | 'updated' | 'payment_failed' | 'cancelled' ): 'ACTIVE' | 'PAST_DUE' | 'CANCELED' | null { switch (eventType) { case 'activated': return 'ACTIVE'; case 'updated': return 'ACTIVE'; case 'payment_failed': return 'PAST_DUE'; case 'cancelled': return 'CANCELED'; default: return null; } }