hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { client } from "../client"; |
| 2 | import { insightRunReportPath } from "./insightRunReportUrl"; |
| 3 | |
| 4 | /** |
| 5 | * The receipt for the school report the service just wrote: the day it covers, |
| 6 | * its size in bytes, whether the service had to truncate it, the service's own |
| 7 | * notes, and when it was stored (ms epoch, the same clock as the run ledger). |
| 8 | */ |
| 9 | export type GeneratedInsightRunReport = { |
| 10 | run_day: string; |
| 11 | byte_size: number; |
| 12 | truncated: boolean; |
| 13 | notes: string[]; |
| 14 | generated_at: number; |
| 15 | }; |
| 16 | |
| 17 | /** |
| 18 | * Generate the school-level report document for one run day. Manager+ only, |
| 19 | * and synchronous: the service writes it before this answers. `503` when no AI |
| 20 | * service offers the report right now; `409` (`report_refused`) when the |
| 21 | * service refused — nothing is stored then, so `getInsightRunReport` would |
| 22 | * find nothing. |
| 23 | */ |
| 24 | export function postInsightRunReport(runDay: string): Promise<GeneratedInsightRunReport> { |
| 25 | return client<GeneratedInsightRunReport>(insightRunReportPath(runDay), { method: "POST" }); |
| 26 | } |