feat: assessed filter, 5000 per-page limit, auto-advance on empty Not-checked page

Assessed/Not assessed filter:
- 'yes' → beauty_lead_quality IS NOT NULL (has been B2B assessed)
- 'no'  → beauty_lead_quality IS NULL (never assessed)
- wired through /api/enriched → get_enriched(beauty_assessed=)

Per-page limit:
- options: 100 / 500 / 1000 / 2000 / 5000
- backend cap raised from le=1000 to le=5000

Auto-advance on empty Not-checked page:
- after bulk validate/prescreen, loadDomains reloads the same DuckDB page
- if every domain on that page is now processed (client-side filter → 0 rows)
  but the page still returned results, automatically increment page and retry
- prevents "No domains found" after successfully processing a batch
- capped at page 500 to avoid infinite loop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 09:19:51 +02:00
parent 19eeaf1588
commit 788252e14f
3 changed files with 36 additions and 10 deletions

View File

@@ -337,6 +337,7 @@ async def get_enriched(min_score=0, cms=None, country=None, kit_digital=None,
prescreen_status=None, niche=None, site_type=None,
keyword=None, tld=None,
alpha_only=False, no_sld=False,
beauty_assessed=None,
page=1, limit=100):
offset = (page - 1) * limit
conditions = ["score >= ?"]
@@ -379,6 +380,10 @@ async def get_enriched(min_score=0, cms=None, country=None, kit_digital=None,
tld_clean = tld.lower().lstrip(".")
conditions.append("LOWER(domain) LIKE ?")
params.append(f"%.{tld_clean}")
if beauty_assessed == "yes":
conditions.append("beauty_lead_quality IS NOT NULL")
elif beauty_assessed == "no":
conditions.append("beauty_lead_quality IS NULL")
if alpha_only:
# No hyphens, no digits anywhere in the domain name
conditions.append(