mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:17:01 +01:00
Closes the Loop A persistence story. After syncSubscriptionToOrangeCat() succeeds, the subscription row now stores the OrangeCat service id back, so the /money page can render a per-row "OC ✓" badge and future backfill jobs can target only the still-null rows. Schema (drizzle migration 0021): - subscriptions.orangecat_service_id (uuid, nullable). Null = not mirrored (integration off, sync failed, or row predates the integration). Apply via `npm run migrate`. - Partial index on (user_id) WHERE orangecat_service_id IS NULL — the shape the "what still needs syncing" backfill query will use; the column is mostly null for now. orangecat.ts: - syncSubscriptionToOrangeCat() now writes the back-link after a successful POST. The DB update is also non-fatal — OrangeCat already has the truth, and the next /money render still reflects the synced state once the column is populated. UI (/money page SubRow): - New "OC ✓" badge appears next to the subscription name when orangecatServiceId is present. Hover shows the OrangeCat service id for cross-system debugging. SDK bump: - @orangecat/sdk moved from 0.1.0 → 0.2.0 (file:vendor/). 0.2.0 adds .list() on every resource, which a future backfill script uses to enumerate what's already on the OrangeCat side before re-syncing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>