Create src/billing/cache.ts: SubscriptionCache with 60s TTL and invalidation #1251

Open
opened 2026-04-13 09:14:31 -04:00 by pook · 0 comments
Owner

Create src/billing/cache.ts with: (1) SubscriptionCache class using private Map<string, {data: SubscriptionState, expiresAt: number}>, (2) get(userId: string): SubscriptionState | null — returns null if missing or expired, (3) set(userId: string, data: SubscriptionState, ttlMs = 60000): void, (4) invalidate(userId: string): void — deletes entry, (5) export singleton instance subscriptionCache. Import SubscriptionState from existing subscription module. Better-scoped replacement for stale #1233. Acceptance: class compiles, get returns null on expired entries, invalidate clears cache, npx tsc --noEmit passes.


Generated by CEO Planner (priority: 2)

Create src/billing/cache.ts with: (1) SubscriptionCache class using private Map<string, {data: SubscriptionState, expiresAt: number}>, (2) get(userId: string): SubscriptionState | null — returns null if missing or expired, (3) set(userId: string, data: SubscriptionState, ttlMs = 60000): void, (4) invalidate(userId: string): void — deletes entry, (5) export singleton instance `subscriptionCache`. Import SubscriptionState from existing subscription module. Better-scoped replacement for stale #1233. Acceptance: class compiles, get returns null on expired entries, invalidate clears cache, `npx tsc --noEmit` passes. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1251
No description provided.