You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(shared-data): one source for the bait-price rule and listing price floor #1089
Price rules are implemented more than once, and the copies drift (architecture review, P2):
Bait price (below 40% of the lower median of the other listings, at least 3 priced listings): apps/web/src/lib/offer-plausibility.ts, plus SQL in DOS-Me 20261024060000_rate_master_min_price_plausible.sql. Rate-Services job-seeder.ts uses its own rule: 50% of the true median, 2 others.
Device / earbuds price floor: web apps/web/src/server/rate/extension.ts uses 1.2M / 400k VND. Rate-Services search-discovery.ts uses 800k / 400k with a narrower earbuds regex.
1B VND ceiling:MAX_VALID_VND_PRICE in shared-data, MAX_PLAUSIBLE_VND_PRICE in web, and another copy in Rate-Services.
None of the rules lives in @repo/shared-data, the package Rate-Services already consumes through vendor/rate.
Task (this issue: no behaviour change)
Move the bait-price rule and the listing price floor into a browser-safe subpath, @repo/shared-data/rules, with one 1B VND ceiling.
Make web use it.
Aligning Rate-Services' own thresholds (800k vs 1.2M, 0.5 vs 0.4) changes crawler behaviour and is left for a follow-up.
Activity
test(shared-data): tighten the price rules checks (#1089)
refactor(shared-data): one source for the bait-price rule and price f…