Register Visited POI
Record that a user has visited a specific Point of Interest (POI).Authentication
Requires JWT authentication. Users can track their own visits, or admins can track any user’s visits.Path Parameters
The user’s unique identifier (MongoDB ObjectId)
Query Parameters
The POI identifier to mark as visited
Response
Success confirmation message
Code Examples
Error Responses
Forbidden - User attempting to track another user’s visits
Bad Request - Failed to register visit
Register Completed Route
Record that a user has completed a tourism route.Authentication
Requires JWT authentication. Users can track their own routes, or admins can track any user’s routes.Path Parameters
The user’s unique identifier (MongoDB ObjectId)
Body Parameters
The request body should contain route completion data as a JSON object.The unique identifier of the completed route
Completion date in ISO 8601 format (e.g., “2024-03-15T10:30:00Z”)
Time taken to complete the route in minutes
User rating of the route (e.g., 1-5 stars)
Request Example
Response
Success confirmation message
Code Examples
Error Responses
Forbidden - User attempting to track another user’s routes
Bad Request - Failed to register route
Authorization Rules
- Self-track: Users can track their own activity (visited POIs and completed routes)
- Admin-track: Admins can track activity for any user
- Restricted: Users cannot track activity for other users unless they are admins
Use Cases
Activity tracking enables:- Personalized recommendations based on user history
- Gamification with achievements and progress tracking
- Analytics to understand popular POIs and routes
- User engagement metrics and retention analysis
Implementation Details
Visited POI Source:src/infrastructure/api/routers/usuario_router.py:159-178
Completed Route Source: src/infrastructure/api/routers/usuario_router.py:181-200
These endpoints use MongoDB operations:
- Visited POIs: Uses
$addToSetto prevent duplicate entries in thepois_visitadosarray - Completed Routes: Uses
$pushto append route completion data to therutas_recorridasarray, allowing multiple completions of the same route