diff --git a/openapi.yaml b/openapi.yaml index dab0ab7..72f3d73 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -14717,7 +14717,8 @@ paths: summary: List an Organisation's Checklists description: | The Checklists of an Organisation (Charity). Visible to the Organisation's editors and - reporters, and to managers (editors) of its Projects. + reporters, and to managers (editors) of its Projects. With `project_id`, only the Checklists + added to that Project, as the Checklist panel on its profile page shows them. operationId: listChecklists security: [{tokenAuth: []}] parameters: @@ -14727,6 +14728,12 @@ paths: schema: type: integer description: The Organisation (Charity) ID + - name: project_id + in: query + required: false + schema: + type: integer + description: Only the Checklists added to this Project of the Organisation. Not found if the Project isn't the Organisation's. - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' @@ -15388,7 +15395,8 @@ paths: `action_id`, `number` (its place in the Checklist), `title`, `action_type`, `action_name` ("Not set yet" while no type is chosen), `done_count` (Contacts who have done it) and `waiting_count` (Contacts for whom it is the first step not done), out of `contacts_count`. Only Contacts the user - can see are counted. + can see are counted. With `project_id`, only the Contacts in that Project, as the Checklist panel + on the Project's profile page counts them. operationId: getChecklistJourney security: [{tokenAuth: []}] parameters: @@ -15397,6 +15405,12 @@ paths: required: true schema: type: integer + - name: project_id + in: query + required: false + schema: + type: integer + description: Count only the Contacts in this Project. Not found unless the Checklist is added to it. responses: "200": description: The columns of the Journey view diff --git a/server.js b/server.js index 9305e4c..086394c 100644 --- a/server.js +++ b/server.js @@ -3379,12 +3379,14 @@ function buildDocsPage() {
actions_count" },
- { code: "403", cls: "response-4xx", desc: "No role in the Organisation that can see Checklists" }
+ { code: "403", cls: "response-4xx", desc: "No role in the Organisation that can see Checklists" },
+ { code: "404", cls: "response-4xx", desc: "Unknown Organisation, or a project_id that isn't the Organisation's" }
])}
${endpointCard("GET", "/checklists/action_types", "List the actions a Checklist can contain", true, [], [
{ code: "200", cls: "response-2xx", desc: "{data: [{action_type, name, criteria_keys, any_name, project_scopable}]}; any_name names the \"Any\" choice, e.g. \"Any relationship\" (criteria: {any: true}); project_scopable types can take only_this_project" }
@@ -3444,11 +3446,12 @@ function buildDocsPage() {
{ code: "404", cls: "response-4xx", desc: "Not found, or another Organisation's Project" }
], "\"Sketched from your setup\" on the Checklists page. Nothing is saved. Without project_id, drafts from the running Project with the most Contacts that has at least two of: an active Signup Page, a Contact Form (other than the default), a Waiting List or Alumni status, and a Survey. The draft uses the five Participant Journey stages, leaving out any with nothing found: Sign up (one \"Complete a form\" step per Signup Page), Arrange support (the Contact Forms, then Waiting List → Enrolled), Provide support (each Survey's first Wave, and \"Invite to an event\" for the Project's Event Formats), Monitor progress (later Waves) and Achieve the goal (Move to Alumni). Every step already says what counts as done, and checklist can be sent to POST /checklists as it is.")}
${endpointCard("GET", "/checklists/{id}/journey", "Get a Checklist's Participant Journey", true, [
- { name: "id", in: "path", type: "integer", required: true, desc: "Checklist ID" }
+ { name: "id", in: "path", type: "integer", required: true, desc: "Checklist ID" },
+ { name: "project_id", type: "integer", required: false, desc: "Count only the Contacts in this Project, one the Checklist is added to" }
], [
{ code: "200", cls: "response-2xx", desc: "contacts_count and columns in order, each {stage_id, name, icon, colour, steps: [{action_id, number, title, action_type, action_name, done_count, waiting_count}]}" },
- { code: "404", cls: "response-4xx", desc: "Not found, or another Organisation's" }
- ], "The Journey view on the Checklist's profile page: its stages left to right, each with its steps. Without stages, each step is its own column, \"Step 1\", \"Step 2\" and so on. done_count: Contacts who have done the step. waiting_count: Contacts for whom it is the first step not done. Only Contacts the user can see are counted.")}
+ { code: "404", cls: "response-4xx", desc: "Not found, another Organisation's, or a project_id the Checklist isn't added to" }
+ ], "The Journey view on the Checklist's profile page: its stages left to right, each with its steps. Without stages, each step is its own column, \"Step 1\", \"Step 2\" and so on. done_count: Contacts who have done the step. waiting_count: Contacts for whom it is the first step not done. Only Contacts the user can see are counted. With project_id, only that Project's Contacts, as the Checklist panel on its profile page counts them.")}
${endpointCard("PATCH", "/checklists/{id}/projects/{project_id}", "Set how a Project offers a Checklist", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Checklist ID" },
{ name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" },