Repository navigation
Wire in disputes, fiat payments, GraphQL, and cache admin routers (#816, #817, #818, #819) - #903
Merged
github-actions[bot] merged 7 commits intoSep 25, 2026
Conversation
Adds Dispute model plus DisputeStatus/DisputeReason/DisputeResolutionOutcome enums, matching the tenantId/deletedAt/snake_case conventions used throughout schema.prisma. Part of Smartdevs17#816.
Replaces the in-memory Map with real persistence. Every operation is now scoped to the caller's tenantId, amount/currency are derived from the referenced Payment instead of trusted from the client, and getAnalytics() implements the DisputeAnalytics shape already declared in disputeModel.ts but never implemented. Part of Smartdevs17#816.
Matches the auth/error-handling convention used by refunds.ts, adds a requireUser() guard, and adds the GET /analytics handler. Part of Smartdevs17#816.
disputeController was imported without the required .js extension, which fails under this project's ESM resolution. Also wires up the new /analytics route. Part of Smartdevs17#816.
Wires disputeService.processEscalations() into the scheduled-tasks registry so disputes past their 72h response deadline actually get escalated, following the same ScheduledTaskMeta pattern as every other job in this file. Closes Smartdevs17#816.
…ters Four fully-implemented modules were never wired into the running app: - disputes/disputeRoutes.ts (Smartdevs17#816) — /api/v1/disputes - routes/fiat-payments.ts (Smartdevs17#817) — /api/v1/fiat-payments. ACH/wire bank verification, payment initiation, wire instructions, webhooks and reconciliation were all already implemented in fiat-payments.ts and providers/fiat.ts (including SWIFT validation and compliance holds for international wires); only the router mount was missing. - graphql/gateway.ts (Smartdevs17#819) — /graphql and /graphql/ws - routes/cache.ts (Smartdevs17#818) — /api/v1/cache admin stats/clear/evict All four are mounted behind authMiddleware since none of them guard themselves internally. Resolves Smartdevs17#817, Smartdevs17#818, Smartdevs17#819 and completes Smartdevs17#816.
|
@Toluwalase-Daniel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Toluwalase-Daniel is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
5 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 26, 2026
–#811) (#910) ## Summary These four Stellar Wave billing features were largely implemented but three of the routers were never mounted on the API (same class of gap as #816–#819 in PR #903). This PR wires them in. | Issue | Change | |-------|--------| | **#808** Stripe subscription billing | Mount `subscriptionsRouter` at `/api/v1/subscriptions` | | **#809** Invoice generation + PDF export | Already mounted at `/api/v1/invoice` (`GET /:id/pdf`); called out next to the related mounts so the batch closes together | | **#810** Payment retry + exponential backoff | Mount `retryRouter` at `/api/v1/payment-retry` | | **#811** Multiple payment methods per account | Mount `paymentMethodsRouter` at `/api/v1/payment-methods` | ## Test plan - [ ] Confirm routes appear under `/api/v1` after boot - [ ] `GET/POST /api/v1/subscriptions` (with `x-tenant-id`) - [ ] `GET /api/v1/invoice/:id/pdf` returns `application/pdf` - [ ] `GET /api/v1/payment-retry/analytics` - [ ] `POST/GET /api/v1/payment-methods` Resolves #808 Resolves #809 Resolves #810 Resolves #811
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All four issues turned out to share the same root cause: substantial, often well-tested backend modules already existed but were never mounted into the running Express app (
backend/src/index.ts), so their endpoints were unreachable.#816 — Payment dispute management
The dispute module (
backend/disputes/) had a complete type model (disputeModel.ts) but the service stored everything in an in-memoryMap(lost on restart, no tenant isolation) and the controller was untyped with inconsistent error handling. Fixed by:DisputePrisma model + migration (tenantId-scoped, matching this schema's existing conventions)disputeService.tsto persist via Prisma, scope every query to the caller'stenantId, and deriveamount/currencyfrom the referencedPaymentrecord instead of trusting client inputdisputeController.tswithasyncHandler/requireUser, matchingrefunds.ts's conventions.jsextension on an ESM import indisputeRoutes.tsthat would have broken at runtimegetAnalytics()against theDisputeAnalyticsinterface that already existed but had no implementationscheduled-tasks.ts/api/v1/disputes#817 — Wire transfer payments
Wire transfer support was already fully implemented in
fiat-payments.ts/providers/fiat.ts— SWIFT validation for international wires, differentiated fee calculation, compliance holds on high-value international wires, wire instructions generation, and per-method analytics. The router (routes/fiat-payments.ts) exposing all of this (bank verification, payment initiation,/wire-instructions, webhooks, reconciliation) was never mounted. Fixed by mounting it at/api/v1/fiat-payments.#818 — Cache admin endpoints
routes/cache.ts(stats/clear/evict) existed but was never mounted. Fixed by mounting it at/api/v1/cache.#819 — GraphQL gateway
graphql/gateway.ts(graphQLRouter/graphQLWsRouter) existed but was never mounted. Fixed by mounting it at/graphqland/graphql/ws.All four new mounts are behind
authMiddlewaresince none of these routers guard themselves internally.Notes
docs/RESPONSE_CACHING.mdreferencesinvalidateCache()/clearMemoryCache()/CacheTTL.LONGexports that don't currently exist inmiddleware/cache.ts— flagging this doc/code drift here since it was noticed during investigation, but left out of scope for this PR.Resolves #816
Resolves #817
Resolves #818
Resolves #819