From c39e89b266394e35c1a36628643fa0243bfc860a Mon Sep 17 00:00:00 2001 From: moojttaba Date: Wed, 3 Jun 2026 13:38:34 +0330 Subject: [PATCH] =?UTF-8?q?docs:=20sync=20=E2=80=94=20PG=20seeds,=20mock?= =?UTF-8?q?=20shops,=20template-creation=20fix=20(backend=20v2.8.65-66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 09 - Audits/Activity Log.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/09 - Audits/Activity Log.md b/09 - Audits/Activity Log.md index 5b8c76b..1f27691 100644 --- a/09 - Audits/Activity Log.md +++ b/09 - Audits/Activity Log.md @@ -810,4 +810,26 @@ prompt; template detail view + search/filter/sort in shop and requests; dark mod --- +### 2026-06-03 — backend v2.8.65–66 — PG seeds, mock shops, template-creation fix + +**Template-creation 500 root cause (agent):** categories table column conflict (Drizzle "order" +vs categoryStore order_num) + random legacy ids per seed → category ids served by the API were +unresolvable by createRequestTemplate. Fixed: categoryStore aligned to canonical "order" column +(with one-time order_num migration), deterministic category legacy ids, hardened categories +fallback (id::text match). Also fixed: the v2.8.64 rating aggregation queried Drizzle reviews +columns but the physical table (written by reviewStore) has different columns — rewritten +against the real columns (seller_user_id). +**New seed:** src/seeds/seedMockShops.ts — Persian categories, 5 sellers + shop settings, +templates with picsum product images, published reviews. npm scripts fixed (paths) + added +seed:levels / seed:templates / seed:mock-shops. +**⚠️ DEV ENV REQUIREMENT:** CATEGORY_STORE=postgres (and ideally REVIEW_STORE / +SHOP_SETTINGS_STORE = postgres) must be set in dev .env.local when REPO_MARKETPLACE=postgres — +docker-compose.dev.yml still defaults these to mongo. Without this, template creation keeps +failing. +**Run on dev after deploy:** docker exec npm run seed:categories && npm run +seed:mock-shops +**Verification:** tsc clean, 14 tests green (3 suites). + +--- +