feat: filter professionals by city and proximity

- findAllActive now accepts city, lat, lng params
- City filter: case-insensitive contains on users.city
- Proximity sort: Haversine within city before services/score ranking
- Controller exposes ?city=&lat=&lng= query params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 20:35:03 -05:00
co-authored by Claude Sonnet 4.6
parent 00a6f637f6
commit d7a0769b46
2 changed files with 31 additions and 7 deletions
@@ -16,7 +16,10 @@ export class ProfessionalsController {
@Get()
findAllActive(@Req() req) {
const search = req.query.search as string | undefined;
return this.pros.findAllActive(search);
const city = req.query.city as string | undefined;
const lat = req.query.lat ? parseFloat(req.query.lat as string) : undefined;
const lng = req.query.lng ? parseFloat(req.query.lng as string) : undefined;
return this.pros.findAllActive(search, city, lat, lng);
}
@Get('pending')