diff --git a/openapi.yaml b/openapi.yaml index fede18d..68e3e56 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -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 @@ -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' @@ -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 @@ -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 diff --git a/server.js b/server.js index 0b548a5..6c43a67 100644 --- a/server.js +++ b/server.js @@ -3286,11 +3286,12 @@ function buildDocsPage() {
${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 id, charity_id, name, description, recipient_type, theme, updated_at and questions (id, question_title, guidance_notes, nuance, position, expected_output_types, output_settings)" }, + { code: "200", cls: "response-2xx", desc: "The organisation's own and library Report Templates, each with id, charity_id, name, description, recipient_type, theme, created_for_report_id (the Report it was made for, when made for a single report), updated_at and questions (id, question_title, guidance_notes, nuance, position, expected_output_types, output_settings)" }, { code: "404", cls: "response-4xx", desc: "An organisation you can't see Report Templates in" }, { code: "422", cls: "response-4xx", desc: "No charity_id" } ])}