-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Description
This issue implements the general search and list endpoint for problem reports (/api/where/problem-reports).
follow-up for #449
Context
Currently, there is no centralized way for transit operators to query reports across the entire system without knowing specific IDs.
Proposed Changes
1. Database Layer (SQLC)
Re-introduce and expand the filtered queries in gtfsdb/query.sql. After updating the SQL, run make models to generate the Go code.
- Recent Reports: Implement
GetRecentProblemReportsTripandGetRecentProblemReportsStopwith support forLIMITandOFFSET. - Filtering: *
GetProblemReportsTripByDateRange/GetProblemReportsStopByDateRangeGetProblemReportsTripByCode/GetProblemReportsStopByCode
2. API Handler
Create a new handler file at internal/restapi/problem_reports_handler.go.
- Logic: Implement
problemReportsHandlerto parse the following query parameters:startDate,endDate(ISO 8601)code(Error/Category code)offset,limit(Pagination)
- Aggregation: The handler should query both Trip and Stop reports, combine the results into a unified list, and sort them (typically by timestamp descending).
3. Routing
Register the new route in routes.go:
- Endpoint:
GET /api/where/problem-reports - Middleware: Ensure standard API key validation is applied. Note that this endpoint does not require a specific ID in the path.
- I'm waiting for feat: Add API endpoints and database queries for retrieving problem reports by trip and stop. #449 merge to start working on it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels