docs: sync from backend 4949988 — route admin user counts through postgres-capable stores

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-06-02 13:20:23 +04:00
parent 345c58542e
commit 4196c119ea

View File

@@ -439,4 +439,27 @@ metadata type didn't allow test-payment fields.
--- ---
### 2026-06-02 — backend@4949988, frontend@integrate-main-into-development — route admin user counts through postgres-capable stores
**Commits:** `4949988` (backend), version bump (frontend)
**Touched:** `src/services/user/userController.ts`, `src/services/auth/authStore.ts`,
`src/db/repositories/interfaces/IMarketplaceRepo.ts`, `src/db/repositories/interfaces/IPaymentRepo.ts`,
`src/db/repositories/mongo/MongoMarketplaceRepo.ts`, `src/db/repositories/drizzle/DrizzleMarketplaceRepo.ts`,
`src/db/repositories/dual/DualWriteMarketplaceRepo.ts`,
`src/db/repositories/mongo/MongoPaymentRepo.ts`, `src/db/repositories/drizzle/DrizzlePaymentRepo.ts`,
`src/db/repositories/dual/DualWritePaymentRepo.ts`,
`__tests__/auth-store-pg-query.test.ts`, `__tests__/user-dependencies-repo.test.ts`,
`scripts/smoke/user-admin-postgres.sh`, `scripts/smoke/user-dependencies.sh`
**Why:** `GET /api/user/admin/:userId/dependencies` was directly importing Mongoose models
(`RequestTemplate`, `PurchaseRequest`, `Payment`, `Chat`) bypassing the repository layer and
blocking `MONGO_CONNECT_MODE=never`. Routed through `getUserDependencyCounts` / `countByParticipant`
on all three repo tiers (Mongo, Drizzle, DualWrite). Also hardened `AuthUser` PgQuery facade with
generic multi-field sorting, nested path support, and `isActive`/`isVerified` filter aliases so
admin list/stats routes work correctly in `AUTH_STORE=postgres` mode.
**Verification:** 5 test suites, 11 tests pass. `typecheck` clean. Smoke scripts added but not
run end-to-end (require live `ADMIN_TOKEN`).
**Linked docs updated:** none — Mongo removal remaining work tracked in `MONGODB_REMOVAL_HANDOFF_2026-06-02.md`.
---
<!-- Add new entries above this line. Newest at top. --> <!-- Add new entries above this line. Newest at top. -->