diff --git a/openapi.yaml b/openapi.yaml index ce1753d..275c2f4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5657,7 +5657,7 @@ paths: description: | Updates a Framework Set the user can edit. Send `frameworks` to replace the list of Impact Frameworks (in order), and `financial_values` to replace the Financial Value defined for each - Outcome. `charity_id` is the organisation the user is acting for. + Outcome, and optionally for each of an Outcome's own Indicators (`indicator_id`, e.g. a TOMs Measure). `charity_id` is the organisation the user is acting for. operationId: updateFrameworkSet security: [{tokenAuth: []}] parameters: @@ -5678,6 +5678,9 @@ paths: financial_values: - outcome_id: 5521 financial_value_id: 88 + - outcome_id: 5521 + indicator_id: 2240 + financial_value_id: 91 responses: "200": description: The updated Framework Set @@ -5863,6 +5866,12 @@ paths: type: integer outcome_id: type: integer + framework_indicator_id: + type: integer + description: | + Optional. Which of the Outcome's own Indicators this indicator counts as (e.g. a TOMs + Measure). In a Framework Set with its own Financial Values, Stories are then valued at + that Indicator's value. It can't be changed on an existing link; remove the link first. project_ids: type: array items: @@ -20011,6 +20020,13 @@ components: level2_plural: type: string example: targets + level3_singular: + type: string + example: Indicator + description: The name of each Outcome's own indicators in this set, e.g. Measure for the TOM System + level3_plural: + type: string + example: indicators value_source: type: string enum: [organisation_values, set_values] @@ -20052,6 +20068,10 @@ components: properties: outcome_id: type: integer + indicator_id: + type: integer + nullable: true + description: One of the Outcome's own Indicators whose value this is; empty for the Outcome's own value financial_value_id: type: integer @@ -20087,6 +20107,10 @@ components: type: string level2_plural: type: string + level3_singular: + type: string + level3_plural: + type: string value_source: type: string enum: [organisation_values, set_values] @@ -20121,12 +20145,18 @@ components: type: string financial_values: type: array - description: The Financial Value for each Outcome, used when value_source is set_values. Replaces the current list. + description: | + The Financial Value for each Outcome, and optionally for each of an Outcome's own Indicators + (give indicator_id), used when value_source is set_values. An Indicator's value is used instead + of its Outcome's. Replaces the current list. items: type: object properties: outcome_id: type: integer + indicator_id: + type: integer + description: One of the Outcome's own Indicators, e.g. a TOMs Measure financial_value_id: type: integer @@ -20212,6 +20242,13 @@ components: type: integer financial_value: type: number + framework_indicator_id: + type: integer + nullable: true + description: For a linked Indicator, which of the Outcome's own Indicators it counts as + counted_through_links: + type: boolean + description: For a core Indicator no Story records directly, whether linked Indicators count as it FrameworkLinkMigration: type: object @@ -20254,6 +20291,13 @@ components: outcome_title: type: string example: "4.4 Increase the number of youth and adults who have relevant skills" + framework_indicator_id: + type: integer + nullable: true + description: Which of the Outcome's own Indicators this indicator counts as, if any (e.g. a TOMs Measure) + framework_indicator_name: + type: string + nullable: true project_ids: type: array items: diff --git a/server.js b/server.js index 79b215a..061e6fe 100644 --- a/server.js +++ b/server.js @@ -2574,7 +2574,7 @@ function buildDocsPage() { { code: "403", cls: "response-4xx", desc: "The user may not create a set with this availability" }, { code: "404", cls: "response-4xx", desc: "Unknown Organisation" }, { code: "422", cls: "response-4xx", desc: "Validation failed, e.g. no name or no Impact Frameworks" } - ], "Body: charity_id, name, availability, network_id, level1_singular, level1_plural, level2_singular, level2_plural, value_source, version_label, supersedes_id, status, frameworks: [{template_id, short_code, colour, text_colour}] in order, and new_frameworks: [name] to create new Impact Frameworks.")} + ], "Body: charity_id, name, availability, network_id, level1_singular, level1_plural, level2_singular, level2_plural, level3_singular, level3_plural (the name of each Outcome's own Indicators, e.g. Measure), value_source, version_label, supersedes_id, status, frameworks: [{template_id, short_code, colour, text_colour}] in order, and new_frameworks: [name] to create new Impact Frameworks.")} ${endpointCard("PATCH", "/framework_sets/{id}", "Update a Framework Set", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Framework Set ID" } ], [ @@ -2582,7 +2582,7 @@ function buildDocsPage() { { code: "403", cls: "response-4xx", desc: "The user can't edit this set" }, { code: "404", cls: "response-4xx", desc: "Not found, or not available to the user" }, { code: "422", cls: "response-4xx", desc: "Validation failed" } - ], "Same body as create; only the fields sent change. frameworks (when sent) replaces the ordered list; financial_values: [{outcome_id, financial_value_id}] replaces the Financial Value chosen for each Outcome.")} + ], "Same body as create; only the fields sent change. frameworks (when sent) replaces the ordered list; financial_values: [{outcome_id, indicator_id, financial_value_id}] replaces the Financial Values chosen for the set: leave out indicator_id for an Outcome's own value, or give one of the Outcome's own Indicators (e.g. a TOMs Measure) to value it separately. An Indicator's value is used instead of its Outcome's.")} ${endpointCard("GET", "/framework_sets/{id}/contribution", "Get an organisation's contribution to a Framework Set", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Framework Set ID" }, { name: "charity_id", type: "integer", required: true, desc: "The Organisation ID; the user must belong to it" }, @@ -2609,14 +2609,14 @@ function buildDocsPage() { { name: "per_page", type: "integer", required: false, desc: "Records per page" }, { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" } ], [ - { code: "200", cls: "response-2xx", desc: "Paginated links with indicator_name, outcome_title, project_ids and all_projects" }, + { code: "200", cls: "response-2xx", desc: "Paginated links with indicator_name, outcome_title, framework_indicator_id and framework_indicator_name (which of the Outcome's own Indicators it counts as, if any), project_ids and all_projects" }, { code: "403", cls: "response-4xx", desc: "The user doesn't belong to the Organisation" } ])} ${endpointCard("POST", "/framework_links", "Link an Indicator to an Outcome in a Framework Set", true, [], [ { code: "201", cls: "response-2xx", desc: "The Linked indicator" }, { code: "403", cls: "response-4xx", desc: "Not an organisation admin" }, { code: "422", cls: "response-4xx", desc: "Not one of the organisation's Indicators or projects, an Outcome outside the sets it can use, or already linked" } - ], "Body: charity_id, indicator_id, outcome_id, project_ids (empty: every project). Linking again with more projects adds them to the existing link.")} + ], "Body: charity_id, indicator_id, outcome_id, framework_indicator_id (optional: which of the Outcome's own Indicators it counts as, e.g. a TOMs Measure; can't be changed on an existing link), project_ids (empty: every project). Linking again with more projects adds them to the existing link.")} ${endpointCard("DELETE", "/framework_links/{id}", "Remove a Linked indicator", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Linked indicator ID" }, { name: "charity_id", type: "integer", required: true, desc: "The Organisation ID" }