diff --git a/openapi.yaml b/openapi.yaml index ed96eb2..5b955fe 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -19272,7 +19272,7 @@ paths: - $ref: '#/components/parameters/OrganisationId' post: tags: [Onboarding] - summary: Set up an area of work from a Toolkit + summary: Set up an area of work from a Toolkit or your own stages description: | Sets up an area of work as the onboarding journey's "Start from a toolkit designed for an organisation like mine" path does, with the same checks: one workspace (Project) per name in @@ -19280,6 +19280,11 @@ paths: extra's Project Type (see GET /onboarding_extras), and a Checklist that every contact in the area's workspaces gets. + Or give `stages` instead of `toolkit_id`, as the "Personalise the platform to my organisation" + path does: the stages of the Organisation's own process, each with a `name` and the `action` that + happens at it. Each stage becomes one step of the same name in the Checklist. Content for the + stages (forms, surveys, flags and so on) isn't set up this way; add it in Makerble afterwards. + `spacing` says how the area is split into workspaces: `facilitator` (one per coach, mentor or practitioner), `site` (one per location), `cohort` (one per intake of a group or class) or `single` (one workspace, named after the area of work when `workspace_names` is empty). Up to @@ -19298,13 +19303,21 @@ paths: application/json: schema: type: object - required: [area_of_work, toolkit_id, spacing] + required: [area_of_work, spacing] properties: area_of_work: type: string maxLength: 100 toolkit_id: type: integer + description: A listed Toolkit. Leave out when giving `stages`. + stages: + type: array + description: Instead of `toolkit_id`, the stages of the Organisation's process, in order. + minItems: 1 + maxItems: 20 + items: + $ref: '#/components/schemas/OnboardingStage' spacing: type: string enum: [facilitator, site, cohort, single] @@ -19326,13 +19339,25 @@ paths: type: array items: type: integer - example: - area_of_work: Youth mentoring - toolkit_id: 62 - spacing: site - workspace_names: [Leeds, York] - workspace_colours: ['#22B573', '#7E6CB0'] - extra_ids: [1, 4] + examples: + toolkit: + summary: From a Toolkit + value: + area_of_work: Youth mentoring + toolkit_id: 62 + spacing: site + workspace_names: [Leeds, York] + workspace_colours: ['#22B573', '#7E6CB0'] + extra_ids: [1, 4] + stages: + summary: From your own stages + value: + area_of_work: Youth mentoring + stages: + - {name: Sign up, action: complete_form_external} + - {name: Assessment, action: complete_survey} + - {name: Achieve the goal, action: add_flag} + spacing: single responses: "202": description: The set-up, building in the background @@ -19345,6 +19370,8 @@ paths: organisation_id: 42 area_of_work: Youth mentoring toolkit_id: 62 + path: toolkit + stages: [] spacing: site workspace_names: [Leeds, York] workspace_colours: ['#22B573', '#7E6CB0'] @@ -22052,6 +22079,15 @@ components: organisation_id: {type: integer} area_of_work: {type: string} toolkit_id: {type: integer, nullable: true} + path: + type: string + enum: [toolkit, personalise] + description: How the area was set up, from a Toolkit or from the Organisation's own stages. + stages: + type: array + description: The stages given, on the personalise path; empty for a Toolkit. + items: + $ref: '#/components/schemas/OnboardingStage' spacing: {type: string, enum: [facilitator, site, cohort, single], nullable: true} workspace_names: {type: array, items: {type: string}} workspace_colours: @@ -22064,6 +22100,21 @@ components: checklist_id: {type: integer, nullable: true} created_at: {type: string, format: date-time} completed_at: {type: string, format: date-time, nullable: true} + OnboardingStage: + type: object + required: [name, action] + properties: + name: + type: string + maxLength: 100 + description: The stage's name, which is also its step's name, e.g. Assessment. + action: + type: string + description: >- + What happens at the stage. complete_form_external is a form the contact fills in and + complete_form_internal one a colleague fills in; add_role adds to an audience and add_skill a + specialist need. + enum: [complete_form_external, complete_form_internal, complete_survey, add_to_project, add_flag, invite_to_event, add_observer, add_relationship, add_role, add_skill, add_to_group, complete_form_for_relative, complete_survey_for_relative, create_case, create_task, invite_to_participate, send_sms, send_email, receive_sms, receive_email, send_survey, send_360_survey, create_labelled_story] SetupGuide: type: object properties: diff --git a/server.js b/server.js index 31a4c76..1a0ded4 100644 --- a/server.js +++ b/server.js @@ -5195,10 +5195,11 @@ function buildDocsPage() {

spacing says how the area is split into workspaces: facilitator, site, cohort or single. The workspaces are made in the background: POST answers 202 with status: building; ask GET until it is completed or failed. Charity Editors and Charity Reporters of the Organisation can use it.

- ${endpointCard("POST", "/organisations/{organisation_id}/onboarding_journeys", "Set up an area of work from a Toolkit", true, [ + ${endpointCard("POST", "/organisations/{organisation_id}/onboarding_journeys", "Set up an area of work from a Toolkit or your own stages", true, [ { name: "organisation_id", in: "path", type: "integer", required: true, desc: "The Organisation (Charity) ID" }, { name: "area_of_work", in: "body", type: "string", required: true, desc: "The area of work's name, up to 100 characters" }, - { name: "toolkit_id", in: "body", type: "integer", required: true, desc: "A listed Toolkit, installed into each of the area's workspaces" }, + { name: "toolkit_id", in: "body", type: "integer", required: false, desc: "A listed Toolkit, installed into each of the area's workspaces. Give this or stages" }, + { name: "stages", in: "body", type: "array", required: false, desc: "Instead of a Toolkit, the stages of your own process, as the Personalise path does: up to 20 of {name, action}, each becoming a step of the same name in the Checklist. action is what happens at the stage, such as complete_form_external, complete_form_internal, complete_survey, add_to_project, add_flag or invite_to_event" }, { name: "spacing", in: "body", type: "string", required: true, desc: "facilitator, site, cohort or single" }, { name: "workspace_names", in: "body", type: "array", required: false, desc: "One name per workspace, up to 50. For single, the area of work's name when empty" }, { name: "workspace_colours", in: "body", type: "array", required: false, desc: "Each workspace's colour as a six-digit hex colour, in the same order as workspace_names; a missing or invalid one gets the next Makerble brand colour" }, @@ -5207,7 +5208,7 @@ function buildDocsPage() { { code: "202", cls: "response-2xx", desc: "The set-up, with status building" }, { code: "403", cls: "response-4xx", desc: "Not a Charity Editor or Charity Reporter of this Organisation" }, { code: "404", cls: "response-4xx", desc: "No such Organisation" }, - { code: "422", cls: "response-4xx", desc: "A missing name, unknown spacing, unlisted Toolkit or too many workspaces; nothing is saved" } + { code: "422", cls: "response-4xx", desc: "A missing name, unknown spacing, unlisted Toolkit, unknown stage action or too many workspaces; nothing is saved" } ])} ${endpointCard("GET", "/onboarding_journeys/{id}", "Get an area of work set-up", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "The set-up's ID" }