mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 10:48:20 +01:00
Final pair of text columns missing `.$type<>()`: - subscriptions.currency: now $type<SubscriptionCurrency>(). The literal "CHF" default stays as-is — it's already the canonical default and the type is ["CHF","USD","EUR","GBP"], so the literal cannot drift. - subscriptions.frequency: now $type<SubscriptionFrequency>() with the default routed through FREQUENCY.MONTHLY (SSOT). Side-effects: - Both subscriptions API routes' `CURRENCIES_ENUM` and `FREQUENCIES_ENUM` were typed `readonly [string, ...string[]]`, so z.enum widened to string and the tightened `.set()` rejected it. Tightened to the typed tuples — matches what every other enum cast in /api now does. - scripts/seed.ts gains two boundary casts for sqlite legacy data. - SubscriptionActions had `frequency === "one-time"` — the only literal outlier in that file (every other branch already used FREQUENCY.X). Now also goes through FREQUENCY.ONE_TIME. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>