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
34 changes: 32 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14161,7 +14161,11 @@ paths:
Change) in `Activity outputs` or `Participation outputs`;
- `outcome_id` or `new_outcome` in `Short-term outcomes`, `Medium-term outcomes` or
`Long-term outcomes`. An Outcome entry can also have `new_metrics`: new Metrics
(Indicators) that measure it.
(Indicators) that measure it, and `indicator_ids`: existing Metrics. For a reused Outcome,
the framework takes only those of its Metrics (plus its new Metrics) instead of all of
them, so projects using it don't get Metrics they don't need. For a new Outcome, they are
linked to it as they are, not copied. An id you can't see, or that isn't one of the reused
Outcome's Metrics, answers `404` and creates nothing.

At most 50 entries and new Metrics together. Near-identical names of new items get `409`
with the matches, each with its `entry`, unless you send `force: true`. Nothing is created
Expand Down Expand Up @@ -14211,6 +14215,7 @@ paths:
category: Education
- stage: Short-term outcomes
outcome_id: 3301
indicator_ids: [5521, 5524]
new_metrics:
- name: "Job search hours"
metric_type: value
Expand Down Expand Up @@ -22013,7 +22018,13 @@ paths:
Board (with `project_id` or `bundle_id`): as its last card, showing that Project's or Album's
results; you must have created the board or be a Board Admin. A Cohort or Workflow Tracker goes in
the `column` given (default `engagement`) of a Project in its own Organisation or of an Impact
Framework you created. There is no request body.
Framework you created.

An Outcome added to a Project or Impact Framework brings every one of its Indicators unless
the body gives `indicator_ids`: then only those Indicators of the Outcome are added, and an
Indicator added to the Outcome later doesn't join that Project. Each id must be an Indicator of
the Outcome that you can see, or nothing is added (422). `indicator_ids` is refused for any
other metric or destination. Otherwise there is no request body.
operationId: addMetricToDestination
security: [{tokenAuth: []}]
parameters:
Expand All @@ -22024,6 +22035,20 @@ paths:
- $ref: '#/components/parameters/MetricDestinationBundleId'
- $ref: '#/components/parameters/MetricDestination'
- $ref: '#/components/parameters/MetricDestinationTargetId'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
indicator_ids:
type: array
items: {type: integer}
minItems: 1
description: For an Outcome added to `projects` or `impact_frameworks`, only these of its Indicators. Leave out to add all of them.
example:
indicator_ids: [5521, 5524, 5530]
responses:
"201":
description: Added
Expand Down Expand Up @@ -25347,6 +25372,11 @@ components:
type: string
instruction:
type: string
indicator_ids:
type: array
minItems: 1
items: {type: integer}
description: Outcome entries only. Existing Metrics (Indicators). With outcome_id, only these of its Metrics (and any new_metrics) are taken instead of all of them; with new_outcome, they are linked to it without being copied.
new_metrics:
type: array
description: Outcome entries only
Expand Down
9 changes: 5 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2924,7 +2924,7 @@ function buildDocsPage() {
${endpointCard("POST", "/impact_frameworks", "Create an Impact Framework with its entries", true, [
{ name: "organisation_id", in: "body", type: "integer", required: true, desc: "The organisation (Charity) that will own it; you must be one of its editors" },
{ name: "name", in: "body", type: "string", required: true, desc: "e.g. <code>Youth employment</code>" },
{ name: "entries", in: "body", type: "array", required: true, desc: "In order. Each has a <code>stage</code> and exactly one of <code>activity_tracker_id</code> or <code>new_activity_tracker</code> {name, category} (Activity or Participation outputs), or <code>outcome_id</code> or <code>new_outcome</code> {title} (Short-, Medium- or Long-term outcomes). An Outcome entry can add <code>new_metrics</code>. At most 50 entries and new Metrics together" },
{ name: "entries", in: "body", type: "array", required: true, desc: "In order. Each has a <code>stage</code> and exactly one of <code>activity_tracker_id</code> or <code>new_activity_tracker</code> {name, category} (Activity or Participation outputs), or <code>outcome_id</code> or <code>new_outcome</code> {title} (Short-, Medium- or Long-term outcomes). An Outcome entry can add <code>new_metrics</code>, and <code>indicator_ids</code> of existing Metrics: only those of a reused Outcome's Metrics are taken, or they are linked to a new Outcome without being copied. At most 50 entries and new Metrics together" },
{ name: "description / color / causes / department", in: "body", type: "string", required: false, desc: "Shown with the framework and used by the Explore filters" },
{ name: "approved", in: "body", type: "boolean", required: false, desc: "Makerble staff only: share it in the public library and approve its new items" },
{ name: "force", in: "body", type: "boolean", required: false, desc: "<code>true</code> to create new items even though near-identical ones exist (see 409)" }
Expand Down Expand Up @@ -3832,11 +3832,12 @@ function buildDocsPage() {
], "Creates a Managed Progress Board named \"&lt;your name&gt;'s Progress Board\" for the Project's Organisation, with the Project on it and the metric as its card. No request body.")}
${endpointCard("POST", "/metrics/{metric_type}/{metric_id}/destinations/{destination}/{target_id}", "Add a metric to a Project, Impact Framework or Collection", true, [
{ name: "target_id", in: "path", type: "integer", required: true, desc: "The Project, Impact Framework or Collection ID" },
{ name: "column", type: "string", required: false, desc: "For a Cohort or Workflow Tracker: the Impact Scorecard column (default <code>engagement</code>)" }
{ name: "column", type: "string", required: false, desc: "For a Cohort or Workflow Tracker: the Impact Scorecard column (default <code>engagement</code>)" },
{ name: "indicator_ids", in: "body", type: "array", required: false, desc: "For an Outcome added to <code>projects</code> or <code>impact_frameworks</code>: only these of its Indicators. Leave out to add all of them" }
], [
{ code: "201", cls: "response-2xx", desc: "<code>{added: true}</code>" },
{ code: "422", cls: "response-4xx", desc: "<code>{error}</code>: a Project you can't edit the metrics of, or one that already has the metric" }
], "Adds a Change or Outcome as Edit Project Metrics does: in the Impact Scorecard column of its own stage, after the metrics already there, and to the Project's Default Survey. No request body.")}
{ code: "422", cls: "response-4xx", desc: "<code>{error}</code>: a Project you can't edit the metrics of, one that already has the metric, or an <code>indicator_ids</code> entry that isn't an Indicator of the Outcome you can see" }
], "Adds a Change or Outcome as Edit Project Metrics does: in the Impact Scorecard column of its own stage, after the metrics already there, and to the Project's Default Survey. An Outcome brings all its Indicators unless you give <code>indicator_ids</code>; Indicators added to the Outcome later then don't join that Project.")}
${endpointCard("DELETE", "/metrics/{metric_type}/{metric_id}/destinations/{destination}/{target_id}", "Remove a metric from a Project, Impact Framework or Collection", true, [
{ name: "target_id", in: "path", type: "integer", required: true, desc: "The Project, Impact Framework or Collection ID" }
], [
Expand Down
Loading