CTO H3R7Tech
1ccf9f5cb8
feat: LeadHunter CRUD API + auth fixes + blueprint registrations (HRT-136)
...
- leadhunter_crm.py: add update_lead(), delete_lead(); expand VALID_STATUSES to 7-step Kanban with legacy migration map
- leadhunter_api.py: add GET/PUT/DELETE /api/leads/<id> endpoints; import update_lead, delete_lead
- portal_server.py: add routes for /leadhunter/clients/le-big-ben/ and /formation/ai102
- saas_api_v1.py: register user blueprint (HRT-79/80) and history blueprint (HRT-81)
- api_v1/routes/user.py: switch auth import to saas_auth.require_auth
- api_v1/routes/history.py: fix auth import + request.current_user fallback
- api_v1/routes/ml_feedback.py: fix auth import + request.current_user fallback
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-05-10 08:29:44 +02:00
DevOps Engineer
4b4323f707
fix(leadhunter): change port 8770→8775 — port 8770 occupé par turf_scraper/crm_api.py
...
Port audit sur VPS (27/04/2026) :
- 8769 : depenses_trello/app.py (PID 2287989)
- 8770 : turf_scraper/crm_api.py (PID 2287988) ← port précédemment choisi, aussi occupé
- 8775 : libre (vérifié via ss -tlnp | grep 8775 → vide)
Fichiers modifiés :
- leadhunter_api.py : lignes 5, 295, 303 (port 8770→8775)
- infra/turf-saas-leadhunter.service : Description Port 8770→8775
Issue: HRT-66
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-27 16:48:12 +02:00
DevOps Engineer
f9a45e6deb
feat(HRT-66): LeadHunter S1 — core scraping, scoring, CRM SQLite et API Flask
...
- leadhunter_scraper.py : Google Places Nearby Search + Place Details
avec compteur quota daily_quota.json (limite 900/jour),
sleep(0.5) entre requêtes, fallback Overpass OSM boundary MEL,
filtre website absent, déduplcation, rgpd_ok=True
- leadhunter_scorer.py : moteur de scoring 0-8 pts
critère n°1 = site web absent (+3), avis ≥50 (+2),
note ≥4.0 (+2), téléphone (+1), note <3.0 (-1)
- leadhunter_crm.py : CRM SQLite schéma validé CTO
(id, source, name, address, phone, rating, reviews_count,
website, score, rgpd_ok, scraped_at, status)
CRUD : insert_lead, get_leads, update_lead_status, get_stats, export_csv
- leadhunter_api.py : Flask service port 8769
GET /api/leads, POST /api/leads/scrape, GET /api/leads/stats,
GET /api/leads/export, PATCH /api/leads/<id>/status, GET /health
assert GOOGLE_PLACES_API_KEY au démarrage
scraping asynchrone (thread) avec status endpoint
- infra/turf-saas-leadhunter.service : service systemd
EnvironmentFile=/home/h3r7/.env pour GOOGLE_PLACES_API_KEY
Tests : py_compile OK, scorer testé, CRM SQLite testé
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-27 16:33:30 +02:00