Commits
Commits on
dcf123a8823bd55f0a656ce94de6b865f41dc08aFiltered to src/api/insights/getInsightRunReport.tsClear filter2026-09-18
feat: 📄 generate the school report document from the run drawerAhmet Kaan Gümüş · ea53ad2
feat: 📄 generate the school report document from the run drawer
The run report drawer could copy, export Markdown and print what the page
had already read, but the school-level document the AI service writes had
no control. `Okul raporu (HTML)` now POSTs the run day's own
`/insights/runs/{run_day}/report` door, reads the stored document back and
then hands it over as a same-origin `<a download>` — so a generation that
answered `200` but stored nothing surfaces as "belge okunamadı" instead of
an empty download.
- `src/api/insights/`: `insightRunReportUrl`/`insightRunReportPath`,
`postInsightRunReport` and `getInsightRunReport`, following the podcast
audio-door shape; the path is spelled once for both doors.
- Failure copy: `503` says the report service is unavailable, a coded `409`
shows the server's own sentence, a read-back `409 report_missing` says the
document could not be read back — never an invented diagnosis.
- The control exists for manager+ only, the role the door accepts.
- Tests: the door URLs at the API layer, and in the drawer the exact POST
target, the in-flight disabled state, the anchor's href/download name, and
each of the three failure classes.