feat: rank professionals by completed services + score, search by name/profession/city

- GET /professionals now accepts ?search= instead of ?city=/page/limit
- Filters each word across profession, user name, and user city (AND of OR)
- Counts completed services per professional via Prisma _count filter
- Sorts: most completed services first, then highest average_score
- Always returns top 7 results

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-12 20:18:14 -05:00
co-authored by Claude Sonnet 4.6
parent 74be21eb4e
commit 00a6f637f6
2 changed files with 38 additions and 22 deletions
@@ -15,10 +15,8 @@ export class ProfessionalsController {
@Get()
findAllActive(@Req() req) {
const page = +(req.query.page || 1);
const limit = +(req.query.limit || 20);
const city = req.query.city as string | undefined;
return this.pros.findAllActive(page, limit, city);
const search = req.query.search as string | undefined;
return this.pros.findAllActive(search);
}
@Get('pending')