docs: sync — PG seeds, mock shops, template-creation fix (backend v2.8.65-66)

This commit is contained in:
moojttaba
2026-06-03 13:38:34 +03:30
parent 32a033869b
commit c39e89b266

View File

@@ -810,4 +810,26 @@ prompt; template detail view + search/filter/sort in shop and requests; dark mod
--- ---
### 2026-06-03 — backend v2.8.6566 — 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 <backend-container> npm run seed:categories && npm run
seed:mock-shops
**Verification:** tsc clean, 14 tests green (3 suites).
---
<!-- Add new entries above this line. Newest at top. --> <!-- Add new entries above this line. Newest at top. -->