Add fake payment lifecycle API#25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e83051cf05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { createDatabase } from "lib/db/db-client" | ||
| import type { Middleware } from "winterspec" | ||
|
|
||
| const defaultDb = createDatabase() |
There was a problem hiding this comment.
Scope default DB instance per app context
Move DB initialization out of module scope: creating defaultDb once at import time makes all routes that rely on withDb share state across the entire process, so separate Winterspec bundles or test runs in the same process can see each other’s payments/things and become order-dependent. This introduces cross-instance data bleed rather than just per-request persistence.
Useful? React with 👍 / 👎.
Summary
idempotency_keybody field orIdempotency-Keyheader/claim #1
Tests
npx bun test tests/routes/payments-default-middleware.test.ts tests/routes/payments.test.tsnpx bun testnpx bun run buildnpx tsc --noEmitnpx biome check README.md lib/db/schema.ts lib/db/db-client.ts lib/middleware/with-db.ts lib/payments/route-schemas.ts routes/payments tests/routes/payments.test.ts tests/routes/payments-default-middleware.test.tsgit diff --checkAI-assisted with Codex; I reviewed the diff and kept the PR scoped to the bounty API.