diff --git a/openapi.yaml b/openapi.yaml index e29ed4b..72632bf 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2445,12 +2445,16 @@ paths: A colleague's capacity caps in one Organisation, and how much they have taken on, as in the **Edit capacity** popup on the Staff availability page. - - `max_per_day` and `max_per_week` cap their appointments; `max_one_to_one_contacts` caps the - Contacts who have an upcoming one-to-one appointment with them. `null` means no limit. - - An **appointment** is an event whose Event Format has an `appointment_type`, where the - colleague is an Event Worker. `usage` counts them for today and this week (Monday to - Sunday) in the Organisation's timezone, and counts their ongoing one-to-one Contacts: the - distinct guests of their upcoming one-to-one appointments. + - **Sessions** are every event in the Organisation where the colleague is an Event Worker, group + or appointment. `max_sessions_per_day` and `max_sessions_per_week` cap them. + - An **appointment** is a session whose Event Format has the Appointment type + (`appointment_type: one_to_one`). An appointment can have more than one staff member: it counts + once for each of its Event Workers. `max_per_day` and `max_per_week` cap appointments, and + `max_one_to_one_contacts` caps the Contacts who have an upcoming appointment with them. + - `null` means no limit. A colleague is fully booked on a day when they reach either cap. + - `usage` counts sessions and appointments for today and this week (Monday to Sunday) in the + Organisation's timezone, and counts their ongoing appointment Contacts: the distinct guests + of their upcoming appointments. - Anyone who sees the colleague on Staff availability can read this: the colleague themselves, their Team Leaders, Project Editors of their Projects and Organisation Admins. Anyone else in the Organisation gets `403`; an Organisation you aren't in returns `404`. @@ -2466,11 +2470,15 @@ paths: example: user_id: 812 charity_id: 123 + max_sessions_per_day: 6 + max_sessions_per_week: 20 max_per_day: 4 max_per_week: 15 max_one_to_one_contacts: 12 can_edit: true usage: + sessions_today: 3 + sessions_this_week: 14 appointments_today: 2 appointments_this_week: 11 ongoing_one_to_one_contacts: 9 @@ -2505,6 +2513,14 @@ paths: schema: type: object properties: + max_sessions_per_day: + type: integer + nullable: true + description: Maximum sessions (group or appointment) a day + max_sessions_per_week: + type: integer + nullable: true + description: Maximum sessions (group or appointment) a week max_per_day: type: integer nullable: true @@ -2516,8 +2532,9 @@ paths: max_one_to_one_contacts: type: integer nullable: true - description: Maximum ongoing one-to-one Contacts + description: Maximum ongoing Contacts with appointments example: + max_sessions_per_day: 6 max_per_day: 4 max_per_week: null max_one_to_one_contacts: 12 @@ -10445,8 +10462,8 @@ paths: when `allow_guests_to_cancel` is true, and must be one of `guest_status_ids`. **Appointment settings** (all optional): - - `appointment_type`: `one_to_one`, `group`, or `null` for "Not an appointment" (the default). - One-to-one appointments have one guest. + - `appointment_type`: `one_to_one` (shown as "Appointment": one Contact, with one or more staff members), `group`, or `null` for "Not an appointment" (the default). + An appointment is with one Contact, and can have more than one staff member. - `default_length_minutes`: how long an event of this format usually lasts, in 5-minute steps up to 1440, or `null`. - `preparation_minutes` and `debrief_minutes`: time a colleague needs before and after @@ -10510,8 +10527,8 @@ paths: read it; an Event Format of an organisation you are not in returns `404`. **Appointment settings** (all optional): - - `appointment_type`: `one_to_one`, `group`, or `null` for "Not an appointment" (the default). - One-to-one appointments have one guest. + - `appointment_type`: `one_to_one` (shown as "Appointment": one Contact, with one or more staff members), `group`, or `null` for "Not an appointment" (the default). + An appointment is with one Contact, and can have more than one staff member. - `default_length_minutes`: how long an event of this format usually lasts, in 5-minute steps up to 1440, or `null`. - `preparation_minutes` and `debrief_minutes`: time a colleague needs before and after @@ -10585,8 +10602,8 @@ paths: turning `allow_guests_to_cancel` off. **Appointment settings** (all optional): - - `appointment_type`: `one_to_one`, `group`, or `null` for "Not an appointment" (the default). - One-to-one appointments have one guest. + - `appointment_type`: `one_to_one` (shown as "Appointment": one Contact, with one or more staff members), `group`, or `null` for "Not an appointment" (the default). + An appointment is with one Contact, and can have more than one staff member. - `default_length_minutes`: how long an event of this format usually lasts, in 5-minute steps up to 1440, or `null`. - `preparation_minutes` and `debrief_minutes`: time a colleague needs before and after @@ -33035,6 +33052,14 @@ components: type: integer charity_id: type: integer + max_sessions_per_day: + type: integer + nullable: true + description: Maximum sessions (every event they are an Event Worker on) a day, or null for no limit + max_sessions_per_week: + type: integer + nullable: true + description: Maximum sessions a week, or null for no limit max_per_day: type: integer nullable: true @@ -33046,13 +33071,19 @@ components: max_one_to_one_contacts: type: integer nullable: true - description: Maximum Contacts with an upcoming one-to-one appointment with them, or null for no limit + description: Maximum Contacts with an upcoming appointment with them, or null for no limit can_edit: type: boolean description: Whether you may change the caps usage: type: object properties: + sessions_today: + type: integer + description: Events today where they are an Event Worker + sessions_this_week: + type: integer + description: Monday to Sunday, in the Organisation's timezone appointments_today: type: integer appointments_this_week: @@ -33060,7 +33091,7 @@ components: description: Monday to Sunday, in the Organisation's timezone ongoing_one_to_one_contacts: type: integer - description: Distinct guests of their upcoming one-to-one appointments + description: Distinct guests of their upcoming appointments FreeSlot: type: object @@ -33304,7 +33335,7 @@ components: type: string nullable: true enum: [one_to_one, group, null] - description: One-to-one or Group appointment, or null for "Not an appointment". One-to-one appointments have one guest. + description: Appointment (`one_to_one`) or Group, or null for "Not an appointment". An appointment is with one Contact, and can have more than one staff member. default_length_minutes: type: integer nullable: true @@ -33423,7 +33454,7 @@ components: type: string nullable: true enum: [one_to_one, group, null] - description: One-to-one or Group appointment, or null for "Not an appointment". One-to-one appointments have one guest. + description: Appointment (`one_to_one`) or Group, or null for "Not an appointment". An appointment is with one Contact, and can have more than one staff member. default_length_minutes: type: integer nullable: true diff --git a/server.js b/server.js index fdc2f22..e3f3288 100644 --- a/server.js +++ b/server.js @@ -4849,8 +4849,10 @@ function buildDocsPage() {
How much a colleague can take on in an Organisation: maximum appointments a day and a week, and maximum ongoing one-to-one Contacts (Contacts with an upcoming one-to-one appointment with them). A blank (null) cap means no limit. It appears in the Capacity column of the Staff availability page.
An appointment is an event whose Event Format has an appointment_type, where the colleague is an Event Worker. usage counts today's and this week's appointments, Monday to Sunday in the Organisation's timezone, and the colleague's ongoing one-to-one Contacts.
How much a colleague can take on in an Organisation. There are two kinds of cap, and a blank (null) cap means no limit. They appear in the Capacity column of the Staff availability page, e.g. "6 sessions a day · 4 appointments a day · 12 Contacts".
Sessions are every event in the Organisation where the colleague is an Event Worker, group sessions and appointments alike: maximum sessions a day and a week.
+Appointments are events whose Event Format has the Appointment type (appointment_type: one_to_one). An appointment is with one Contact and can have more than one staff member; it counts once for each of its Event Workers. Group sessions are not appointments. Caps: maximum appointments a day and a week, and maximum ongoing Contacts with appointments (Contacts with an upcoming appointment with them).
A colleague is fully booked on a day when they reach either cap. usage counts today's and this week's sessions and appointments, Monday to Sunday in the Organisation's timezone, and the colleague's ongoing appointment Contacts.
Anyone who sees the colleague on Staff availability can read their capacity: the colleague themselves, their Team Leaders, Project Editors of their Projects and Organisation Admins. Only Organisation Admins, and Team Leaders of a Team the colleague is in, can change it, and nobody can change their own.
Event Formats (Event Categories in the API) are the templates an organisation's events are created from, such as Workshops, Classes or Meetings. Only an Organisation Admin can list, read, create, edit or delete an organisation's Event Formats. An Event Format can be deleted only once it has no events and is not added to any project; the list says which ones can be deleted and why not. Default formats can be deleted under the same rules.
-Appointments: an Event Format can be a One-to-one or Group appointment (appointment_type one_to_one or group; null means "Not an appointment"). default_length_minutes (5-minute steps) sets the end time on the Create Event page, and preparation_minutes and debrief_minutes are the time a colleague needs either side of each appointment.
Appointments: an Event Format's Appointment type can be Appointment (appointment_type one_to_one: with one Contact, and it can have more than one staff member) or Group (group); null means "Not an appointment". default_length_minutes (5-minute steps) sets the end time on the Create Event page, and preparation_minutes and debrief_minutes are the time a colleague needs either side of each appointment.
Organisation default: an organisation can make one Event Format its default (is_organisation_default), as Make default on the Manage Event Formats page does. It is added to a project whenever events are turned on there, unless the project's Event Formats are chosen at the same time.
one_to_one, group, or null for Not an appointment" },
+ { name: "appointment_type", in: "body", type: "string", required: false, desc: "one_to_one (shown as Appointment), group, or null for Not an appointment" },
{ name: "default_length_minutes", in: "body", type: "integer", required: false, desc: "Usual length, in 5-minute steps up to 1440, or null" },
{ name: "preparation_minutes", in: "body", type: "integer", required: false, desc: "Preparation time before each appointment, 0–1440 (default 0)" },
{ name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" },
@@ -5030,7 +5034,7 @@ function buildDocsPage() {
{ name: "enable_event_roles", in: "body", type: "boolean", required: false, desc: "Turn on Event Roles" },
{ name: "event_role_ids_for_event_managers_and_workers", in: "body", type: "integer[]", required: false, desc: "The organisation's Event Roles that Event Managers and Workers can have" },
{ name: "event_role_ids_for_guests", in: "body", type: "integer[]", required: false, desc: "The organisation's Event Roles that guests can have" },
- { name: "appointment_type", in: "body", type: "string", required: false, desc: "one_to_one, group, or null for Not an appointment" },
+ { name: "appointment_type", in: "body", type: "string", required: false, desc: "one_to_one (shown as Appointment), group, or null for Not an appointment" },
{ name: "default_length_minutes", in: "body", type: "integer", required: false, desc: "Usual length, in 5-minute steps up to 1440, or null" },
{ name: "preparation_minutes", in: "body", type: "integer", required: false, desc: "Preparation time before each appointment, 0–1440 (default 0)" },
{ name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" },