Auto-sync POs via DynamoDB Streams + pagination #2

Merged
amoussa1229 merged 2 commits from feature/auto-sync-pos into main 2026-04-03 18:30:48 +00:00
amoussa1229 commented 2026-04-03 18:30:04 +00:00 (Migrated from github.com)

Summary

  • DynamoDB Streams sync: New po-sync Lambda triggered by the external purchase-orders table stream — upserts POs into ledgerflow-pos in near-real-time, replacing the blocking on-demand sync on every GET /pos
  • On-demand fallback: When streams aren't configured (no PURCHASE_ORDERS_STREAM_ARN), GET /pos still syncs on read as before
  • Hardcoded Google Client ID: CDK stack now falls back to the real client ID so /auth/config and JWT verification work without passing env vars
  • README updated with DynamoDB Streams setup instructions and new file structure

Test plan

  • Verify GET /pos returns instantly (no blocking sync) with streams enabled
  • Insert a row into purchase-orders table and confirm it appears in ledgerflow-pos within seconds
  • Verify /auth/config returns the correct googleClientId
  • Verify login flow works end-to-end (no 500 on /auth/me)

🤖 Generated with Claude Code

## Summary - **DynamoDB Streams sync**: New `po-sync` Lambda triggered by the external `purchase-orders` table stream — upserts POs into `ledgerflow-pos` in near-real-time, replacing the blocking on-demand sync on every GET /pos - **On-demand fallback**: When streams aren't configured (no `PURCHASE_ORDERS_STREAM_ARN`), GET /pos still syncs on read as before - **Hardcoded Google Client ID**: CDK stack now falls back to the real client ID so `/auth/config` and JWT verification work without passing env vars - **README updated** with DynamoDB Streams setup instructions and new file structure ## Test plan - [ ] Verify GET /pos returns instantly (no blocking sync) with streams enabled - [ ] Insert a row into `purchase-orders` table and confirm it appears in `ledgerflow-pos` within seconds - [ ] Verify `/auth/config` returns the correct `googleClientId` - [ ] Verify login flow works end-to-end (no 500 on `/auth/me`) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.