Skip to content

Document quality report POI options - #178

Merged
jeffmaki merged 3 commits into
devfrom
feature-quality-report-poi-options
Nov 20, 2026
Merged

jeffmaki merged 3 commits into
devfrom
feature-quality-report-poi-options

Conversation

@jeffmaki

@jeffmaki jeffmaki commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Documents the new optional JSON request body for POST /api/v1/osw/quality-report/{tdei_dataset_id}. It is added to tdei-api-gateway.json, -stage.json and -prod.json, with identical changes in each:

  • poi_types: an array of POI type names. The enum lists the 11 types, each with a description. Leaving it out includes every type.

There's no state option. The request description says the report fetches Overture places only in the US states the dataset's area overlaps, and with no state filter when the area overlaps none. An earlier version of this PR documented poi_state; it was removed when the pipeline started working the state out itself (TDEI-quality-reports#182).

It also documents a multipart/form-data body with one field, pois_file. This is the job's own pois.csv, used as-is instead of fetching POIs, for that job only. Its description gives the required columns (lat, lon, category, source, snapped, with snapped true on every row) and says it can't be sent with poi_types.

The 400 response now also covers invalid options, a pois_file without the required columns, and a pois_file sent with options.

Related

This is part of a four-repo change:

The UI keeps its own copy of this spec, tdei-ui/src/assets/api_spec.json. That PR makes the same change there, and the quality-report operation is identical in both.

Testing

All three files still parse as JSON, and none of their other content changed. @redocly/cli lint reports the same findings before and after the pois_file change (1 error, 13 warnings, all already there).

🤖 Generated with Claude Code

The quality report POST takes an optional JSON body choosing which kinds
of points of interest to include (poi_types) and the state Overture
places must be in (poi_state, default WA).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeffmaki and others added 2 commits November 19, 2026 15:10
The quality report request body can now be multipart/form-data with a
`pois_file` CSV, used as-is in place of fetching points of interest
from OpenStreetMap and Overture Maps. The spec gives the required
columns, says it cannot be combined with `poi_types` / `poi_state`,
and adds both cases to the 400 response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report pipeline now works out the state itself, by intersecting the
dataset's area with US state boundaries, so callers no longer choose
one: Overture places are fetched only in the US state(s) the dataset's
area overlaps; for an area outside every state, they are fetched
without a state filter.

Removes the poi_state property and its enum from the JSON request body,
and updates the request body, pois_file and 400 descriptions to match.
poi_types and pois_file are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffmaki
jeffmaki merged commit 537514a into dev Nov 20, 2026
2 checks passed
jeffmaki added a commit to TaskarCenterAtUW/TDEI-osw-datasvc-ts that referenced this pull request Nov 20, 2026
## Summary

`POST /api/v1/osw/quality-report/{tdei_dataset_id}` now takes an
optional JSON body:

```json
{ "poi_types": ["civic", "leisure"] }
```

**`poi_types`** chooses which kinds of points of interest the report
looks for. Leaving it out means every type.

There's no state option. The report fetches Overture places only in the
US states the dataset's area overlaps, and with no state filter when the
area overlaps none (TDEI-quality-reports#182). An earlier version of
this PR had `poi_state`. A body that still sends it is accepted, and the
field is ignored.

Where each part lives:
- `QualityReportRequest` (`src/model/request-interfaces.ts`) checks the
body. A non-array, an empty array, or a name that isn't lowercase
returns a 400. Type names are checked only for their form; the report
pipeline owns the list and rejects names it doesn't know, so adding a
type doesn't need a release here.
- The job saves the option in `request_input`, so it appears on the job.
- The `osw_quality_report` workflow (`tdei-orchestrator-config_v2.json`)
passes `poi_types` to the report as text. **It is always sent, empty
when not chosen.** The lodash template throws on a missing key, and
`validateInput` requires every declared key; the report reads an empty
value as its default. Lists are sent comma-joined because `map_props`
JSON-parses every value it renders.

A request with no body behaves exactly as it does today.

## Uploading a pois.csv

The endpoint also takes `multipart/form-data` with a `pois_file`. This
is the job's own `pois.csv`, which the report uses as-is instead of
fetching POIs, for that job only.
- **Checks:**
  - `qualityReportUpload` accepts `.csv` only.
- `QualityReportRequest.validatePoisFile` checks the header for `lat`,
`lon`, `category`, `source` and `snapped`, the columns the report
requires of a cached `pois.csv`. The report checks every row.
- Sending `poi_types` with a file is a 400, because it chooses what to
fetch.
- **Storage:** the service stores the file under
`jobs/quality-report/…/pois.csv` before creating the job, so a failed
upload leaves no stuck job.
- **Link to the report:** the report runs under a different storage
account, so the workflow carries a 72-hour read-only SAS link as
`pois_file_url`. Like the options, it is always sent, and empty without
a file.
- **What the job shows:** the job's `request_input` records only
`pois_file: <name>`, because the link grants read access and jobs are
visible to users.

**Deploy this after the pipeline and its function app**
(TDEI-quality-reports#181). Until they know `pois_file_url`, an uploaded
file is dropped and the report fetches POIs instead, with no error.

## Related

This is part of a four-repo change, documented end to end in the
pipeline's `CLAUDE.md`:
- Pipeline:
- TaskarCenterAtUW/TDEI-quality-reports#176 (POI
options, merged)
- TaskarCenterAtUW/TDEI-quality-reports#181
(`pois_file`)
- TaskarCenterAtUW/TDEI-quality-reports#182 (the
states come from the dataset's area)
- API spec:
TaskarCenterAtUW/TDEI-ExternalAPIs#178
- Create Job form:
TaskarCenterAtUW/TDEI-user-management-front-end#357

## Testing

- `npm test`: 516 unit tests pass.
- New tests:
- controller: the options are passed through, 3 bad bodies each return a
400, and a leftover `poi_state` is dropped;
- service: an empty-options test, and a test that options reach both
`request_input` and `workflow_input`;
- workflow config: the real `osw_quality_report` template renders
`poi_types`, set and unset, and has no `poi_state`;
- controller, `pois_file`: three good files reach the service (a plain
header; a byte order mark with quoted names and CRLF; a header only).
Three bad uploads each return a 400 and create no job: one with
`poi_types`, one with no `snapped` column, and an empty file;
- service, `pois_file`: the file is stored, the job records only its
name, and the workflow gets the SAS link. No job is created when storing
the file fails;
- workflow config, `pois_file`: a SAS link, with its `&`, `=` and `%`,
renders unchanged, and an empty one renders empty.
- `tsc` passes. Lint shows nothing new on the changed lines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants