Commit 06f291c
* feat: replace in-memory PrismaService fake with real PrismaClient (#475)
- Rewrite PrismaService to extend PrismaClient with @prisma/adapter-pg
- Remove all 13 Map-based in-memory stores (1532 -> 420 lines)
- reset() now executes TRUNCATE TABLE ... CASCADE
- Add Postgres 16 service to CI workflow
- Fix BuyerDisputeService to explicitly transition escrow to DISPUTED
- Fix vendor-analytics integration test (remove direct store access)
- Update 4 test files for real PrismaClient API
* fix(prisma): complete real-PrismaClient migration in production code
Reconcile the fake->real PrismaClient swap with ~40 commits of base code
that was written against the in-memory fake's loose types.
- Declare the previously-undeclared driver-adapter deps so `npm ci` installs
them: @prisma/adapter-pg, pg (deps) and @types/pg (devDep).
- prisma.service.ts: enable query-event logging via constructor `log` option
and narrow $on('query') to Prisma.QueryEvent; drop dead input types; add
boundary mappers (toEscrowRecord/toFailedTransactionRecord/
toVendorAccountDetailsRecord/toVendorTrackingSettingsRecord) that convert
generated rows (Decimal, JsonValue) to the hand-written *Record contract
(number, plain objects) the rest of the app and its tests depend on.
- escrow / dlq / vendor repositories: convert rows through the mappers;
write JSON columns via Prisma.DbNull / InputJsonValue.
- admin-stats: Number() the Decimal _sum.amount aggregate.
- analytics: type $queryRaw result as an array.
- schema: add Notification.providerMessageId / attemptCount / lastResponseCode
(persisted by NotificationsService; previously only in the fake) + migration.
Production `tsc --noEmit` is clean. Remaining type errors are confined to
test/spec files and the benchmark script (follow-up commit).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HzXa5DbrJ4CsnYs4Sx4qiK
* test: fix type errors from real-PrismaClient swap; repair bad-merge specs
Make `npm run typecheck` (tsc --noEmit) fully green after the fake->real
PrismaClient migration. Type-only test changes plus repair of pre-existing
bad-merge corruption inherited from base dev.
- Add required `itemRef` to escrow creates; annotate `state: '...' as const`
where widening broke EscrowRecord/EscrowSummaryDto assignability
(escrow/dispute/admin-stats/analytics/cross-vendor/tracking-poll specs).
- Add missing fields to VendorTrackingSettingsRecord mocks; cast the DLQ
ABANDONED record; pass the new DlqService arg to SorobanPollerService;
use Prisma.DbNull for null JSON columns.
- prisma.service.spec.ts: drop the invalid `@jest/globals` Test import, remove
unused e1..e4 bindings, Prisma.DbNull for ledgerFeedback.
- Remove duplicated halves left by earlier bad merges in
tracing.interceptor.spec, tracing.middleware.spec, and
notification-retry-queue.service.spec.
- config.module.spec.ts: repair the corrupted abortEarly block, the three
missing sync-test `});`, the duplicate Keypair import, and restore the
dropped ALL_KNOWN_KEYS definition.
- benchmark script: array-typed $queryRaw, itemRef on seed escrows.
No assertions or test intent changed. Note: the repo-wide `lint:check` job was
already red on base dev (pre-existing prettier/require/console violations in
untouched files); the files changed here are formatted clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HzXa5DbrJ4CsnYs4Sx4qiK
* fix: adapt tests and services to real PrismaClient
- bind this for Prisma query-event logger (v7 Proxy unbound methods)
- single-statement TRUNCATE with advisory lock to avoid reset deadlocks
- seed vendor profiles in tests/seed for escrow FK constraints
- use DisputeStatus enum in admin stats query
- validate ADMIN_ADDRESS with stellarPublicKey schema
- pass encryption key config to LogisticsService constructor
---------
Co-authored-by: Sakariyah Abdulhazeem <sakariyahabdulhazeem@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Sakariyah Abdulhazeem <150973162+zeemscript@users.noreply.github.com>
1 parent 99d439c commit 06f291c
49 files changed
Lines changed: 1868 additions & 3172 deletions
File tree
- prisma
- migrations/20260801000000_add_notification_delivery_tracking
- scripts
- src
- admin/stats
- config
- dispute
- dlq
- escrow
- prisma
- stellar
- tracing
- vendor
- analytics
- test
- integration
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments