Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13732,6 +13732,11 @@ paths:
The Report Templates an organisation can use in ReportMaker: its own and those in its
library, with each question's Expected Outputs and their `output_settings`. Requires
someone who can see Report Templates in the organisation; another organisation is a 404.

A template ReportMaker saved for one Report (so the next report to the same recipient can
reuse its questions) has that Report's id in `created_for_report_id`. Manage Report Templates
lists those only under its **Made for a single report** filter; pass
`made_for_single_report=false` to leave them out the same way, or `true` to list only them.
security: [{tokenAuth: []}]
parameters:
- name: charity_id
Expand All @@ -13741,6 +13746,13 @@ paths:
type: integer
example: 42
description: The organisation
- name: made_for_single_report
in: query
required: false
schema:
type: boolean
example: false
description: true for only the templates made for a single report, false to leave them out. Leave it out for every template
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
Expand Down Expand Up @@ -27921,6 +27933,10 @@ components:
theme:
type: string
nullable: true
created_for_report_id:
type: integer
nullable: true
description: The Report ReportMaker made this template for, when it was made for a single report
updated_at:
type: string
format: date-time
Expand Down Expand Up @@ -28266,7 +28282,12 @@ components:
description: The Makerble data preset, for makerble_data
recommended_source:
type: object
description: e.g. {"kind":"preset","preset":"target_vs_actual"} or {"kind":"tool","tool":"GetSessionsAndAttendance"}
description: |
Where the answer comes from. `kind` is `preset` (a Makerble data block), `tracker` (an
existing tracker shown in a data block), `new_tracker` (a tracker FrameworkMaker would
make), `tool` (a read tool used when the report is written) or `stories` (worked out from
Stories, the last resort). ReportMaker also stores a `key` and a `label`, e.g.
{"kind":"tracker","key":"CohortTracker","label":"From the Cohort Tracker 'Attending 80% or more'"}
word_limit:
type: integer
nullable: true
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3286,11 +3286,12 @@ function buildDocsPage() {
<div class="endpoint-list">
${endpointCard("GET", "/report_templates", "List an organisation's Report Templates", true, [
{ name: "charity_id", type: "integer", required: true, desc: "The organisation" },
{ name: "made_for_single_report", type: "boolean", required: false, desc: "true for only the templates ReportMaker made for a single report, false to leave them out (as Manage Report Templates does by default)" },
{ name: "page", type: "integer", required: false, desc: "Page number" },
{ name: "per_page", type: "integer", required: false, desc: "Report Templates per page (default 10, max 200)" },
{ name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only Report Templates updated after this" }
], [
{ code: "200", cls: "response-2xx", desc: "The organisation's own and library Report Templates, each with <code>id</code>, <code>charity_id</code>, <code>name</code>, <code>description</code>, <code>recipient_type</code>, <code>theme</code>, <code>updated_at</code> and <code>questions</code> (<code>id</code>, <code>question_title</code>, <code>guidance_notes</code>, <code>nuance</code>, <code>position</code>, <code>expected_output_types</code>, <code>output_settings</code>)" },
{ code: "200", cls: "response-2xx", desc: "The organisation's own and library Report Templates, each with <code>id</code>, <code>charity_id</code>, <code>name</code>, <code>description</code>, <code>recipient_type</code>, <code>theme</code>, <code>created_for_report_id</code> (the Report it was made for, when made for a single report), <code>updated_at</code> and <code>questions</code> (<code>id</code>, <code>question_title</code>, <code>guidance_notes</code>, <code>nuance</code>, <code>position</code>, <code>expected_output_types</code>, <code>output_settings</code>)" },
{ code: "404", cls: "response-4xx", desc: "An organisation you can't see Report Templates in" },
{ code: "422", cls: "response-4xx", desc: "No <code>charity_id</code>" }
])}
Expand Down
Loading