feat(integrations): keep stripe fees and revenue past 1,000 balance transactions in the window

Aperta
#774 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
next.js, playwright, react, typescript
Ambito
api, backend, data

Direzione di ricerca

Start with src/lib/adapters/stripe/index.ts, especially the page limits and month-window handling around lines 570–598; then read the Stripe provider documentation and inspect its schemas and fixtures. Run npx vitest run src/lib/adapters/stripe to understand the existing coverage. Done means totals survive 1,001 and 5,000 transactions, truncated reads preserve prior month figures, the provider card reports incomplete figures with an axe-scanned Playwright test, and the docs explain the read.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: integrations enhancement impact: medium priority: P2 size: M

Context

Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: product triage report, new issue 4.

Each Stripe sync re-reads every balance transaction in its window, at most 10 pages of 100 (PAGE_LIMIT, MAX_PAGES, src/lib/adapters/stripe/index.ts:73-74). When the read stops at that cap, totals are reported only for the days after the oldest transaction read, and the month windows that began earlier are dropped (index.ts:570-598, comment at :589-590; docs/providers/stripe.md:260, :269).

Impact: an account with roughly 1,000 or more balance transactions since the earlier of the month's start and 30 days ago (about 33 a day) gets no month fee or revenue figures. Headline revenue and spend alerts go silent, and a figure reported earlier in the month disappears once the month passes the cap.

Plan

  1. Keep a cursor: after the first full read, read only balance transactions newer than the last one stored and add them to stored per-day totals, instead of re-reading the whole window.
  2. Where a full re-read is still needed (first sync, a gap), page past 1,000 within the sync's time budget and continue on the next sync rather than dropping the month.
  3. Never remove a month figure reported earlier because a later read was truncated; say on the provider card when figures are incomplete.
  4. Update docs/providers/stripe.md.

Acceptance criteria

  • A month total survives 1,001 and 5,000 transactions in fixture tests.
  • A truncated read never removes a month figure reported earlier.
  • The provider card says when figures are incomplete (Playwright e2e with an axe scan).
  • docs/providers/stripe.md describes the read.

Files and areas

src/lib/adapters/stripe/index.ts, its schemas and fixtures, docs/providers/stripe.md, the provider card component if copy changes.

Non-goals: the Stripe install link (#754), Stripe events.

Verification

npm run typecheck, npm run lint, npx vitest run src/lib/adapters/stripe.


Branch: <issue-number>-stripe-balance-cursor

Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown

Lingua principale
TypeScript
Stelle
13
Fork
2
Merge medio
5h 20m
PR unite (30g)
287

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.