From 4196c119eaa649307288c08971e3827a563cd675 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Tue, 2 Jun 2026 13:20:23 +0400 Subject: [PATCH] =?UTF-8?q?docs:=20sync=20from=20backend=204949988=20?= =?UTF-8?q?=E2=80=94=20route=20admin=20user=20counts=20through=20postgres-?= =?UTF-8?q?capable=20stores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- 09 - Audits/Activity Log.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/09 - Audits/Activity Log.md b/09 - Audits/Activity Log.md index 7a04f8f..07e3a72 100644 --- a/09 - Audits/Activity Log.md +++ b/09 - Audits/Activity Log.md @@ -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`. + +--- +