docs: sync from backend c5d6490 — points level fixes (v2.8.62)

This commit is contained in:
moojttaba
2026-06-03 10:54:04 +03:30
parent 3cac5bd45e
commit c663c657e2

View File

@@ -724,4 +724,19 @@ as "·", Bronze level claims "highest level"); Mini App dark mode (تنظیما
---
### 2026-06-03 — backend@c5d6490 — Points & Referral audit fixes (v2.8.62)
**Why (from points audit):** /dashboard/points showed "·" instead of numbers and told Bronze users
they are at "the highest level". Root causes: (1) level boundary off-by-one — seeds define
inclusive maxPoints (Bronze 0999) but PG used `>` and Mongo `<`, so exact-boundary users resolved
to no level; (2) `level_configs` table in Postgres was created but NEVER seeded → zero levels →
null next-level → "highest level" message. Fixes: inclusive comparisons in both repos +
self-seeding of the 5 default levels (برنز/نقره/طلا/پلاتین/الماس) in ensurePostgresLevelConfigSchema.
**Remaining from audit:** frontend points page swallows API errors (shows zeros instead of an
error state); integration ideas: award points on completed escrow, show points in Mini App.
**Verification:** tsc clean, 8 tests green. Admin verifies after deploy: /dashboard/points shows
real numbers and Bronze shows progress toward نقره.
---
<!-- Add new entries above this line. Newest at top. -->