Feedback page: results, responses, who hasn't answered, reminders (2.1.0)

- Supervisor -> Feedback (supervisors and admins, campus-scoped): every
  event's form with answered of asked, response rate, average rating and
  last reminder; per event the results per question (with the AI summary),
  each response, and on named forms who was asked and who has answered.
- Remind those who haven't answered (or one person on a named form): a
  fresh link, plus the form to anyone eligible who hasn't had it; nobody gets
  the form or a reminder twice within 24 hours. The 3-day job is unchanged.
- Anonymous forms show no names and no list of who has answered.
- FeedbackInvite.reminderCount (migration 20261103120000_feedback_reminders);
  access log action feedback_responses; help page; dashboard and Ctrl+K links.
- Roadmap: the AI helpers on the privacy pages are dropped; 2.1.0 is the
  feedback page.
- Tests: tests/feedbackPage.test.ts, e2e/feedback.spec.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 13:03:05 +02:00
co-authored by Claude Opus 5.5
parent c018772ded
commit 9dda0d1851
31 changed files with 2184 additions and 52 deletions
@@ -69230,6 +69230,791 @@
}
}
}
},
"/feedback": {
"get": {
"tags": [
"Feedback"
],
"summary": "Every event with a feedback form",
"description": "Newest event first, with how many were asked and answered, and the average star rating.\n\n**Who:** Supervisors and admins.",
"operationId": "getFeedback",
"security": [
{
"bearerAuth": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"event": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"title": {
"type": "string"
},
"startDate": {},
"endDate": {}
},
"required": [
"id",
"title",
"startDate",
"endDate"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"sent",
"scheduled",
"not_scheduled"
],
"description": "sent, scheduled (a send time is set) or not_scheduled"
},
"sendAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"sentAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"anonymous": {
"type": "boolean"
},
"invited": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"answered": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"responseRate": {
"description": "%",
"type": [
"number",
"null"
]
},
"averageRating": {
"description": "Every star rating on the form, 1–5",
"type": [
"number",
"null"
]
},
"lastReminderAt": {
"anyOf": [
{},
{
"type": "null"
}
]
}
},
"required": [
"event",
"status",
"sendAt",
"sentAt",
"anonymous",
"invited",
"answered",
"responseRate",
"averageRating",
"lastReminderAt"
],
"additionalProperties": false
}
}
},
"required": [
"data"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Not signed in (UNAUTHENTICATED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not allowed for this role (FORBIDDEN)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/events/{id}/feedback/results": {
"get": {
"tags": [
"Feedback"
],
"summary": "An event's feedback: results, responses and who was asked",
"description": "On an anonymous form, responses have no name and `people` is null. Opening a named form's answers is recorded in the access log.\n\n**Who:** Supervisors and admins.",
"operationId": "getEventsIdFeedbackResults",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The id",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"event": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"title": {
"type": "string"
},
"startDate": {},
"endDate": {}
},
"required": [
"id",
"title",
"startDate",
"endDate"
],
"additionalProperties": false
},
"form": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"sent",
"scheduled",
"not_scheduled"
],
"description": "sent, scheduled (a send time is set) or not_scheduled"
},
"sendAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"sentAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"audience": {
"type": "string",
"enum": [
"checked_in",
"all"
]
},
"anonymous": {
"type": "boolean"
},
"intro": {
"type": [
"string",
"null"
]
},
"autoReminderAt": {
"anyOf": [
{},
{
"type": "null"
}
],
"description": "When the automatic reminder goes (3 days after sending)"
},
"autoReminderSent": {
"type": "boolean"
}
},
"required": [
"status",
"sendAt",
"sentAt",
"audience",
"anonymous",
"intro",
"autoReminderAt",
"autoReminderSent"
],
"additionalProperties": false
},
"counts": {
"type": "object",
"properties": {
"invited": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"answered": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"notAnswered": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"responseRate": {
"type": [
"number",
"null"
]
},
"canRemind": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Not answered, and not sent the form or a reminder in the last 24 hours"
},
"remindedRecently": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"waiting": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Would get the form but haven't been sent it yet (e.g. checked in after it went out)"
}
},
"required": [
"invited",
"answered",
"notAnswered",
"responseRate",
"canRemind",
"remindedRecently",
"waiting"
],
"additionalProperties": false
},
"averageRating": {
"type": [
"number",
"null"
]
},
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldId": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"answered": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"average": {
"type": [
"number",
"null"
]
},
"distribution": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"label",
"value"
],
"additionalProperties": false
}
},
"counts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"label",
"value"
],
"additionalProperties": false
}
},
"texts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"value"
],
"additionalProperties": false
}
}
},
"required": [
"fieldId",
"type",
"label",
"answered"
],
"additionalProperties": false
}
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"type": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"id",
"type",
"label"
],
"additionalProperties": false
}
},
"responses": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"createdAt": {},
"name": {
"type": [
"string",
"null"
]
},
"answers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
},
"description": "Question id → answer"
}
},
"required": [
"id",
"createdAt",
"name",
"answers"
],
"additionalProperties": false
}
},
"people": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"name": {
"type": "string"
},
"email": {
"type": [
"string",
"null"
]
},
"phoneNumber": {
"type": [
"string",
"null"
]
},
"sentAt": {},
"remindedAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"reminderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"respondedAt": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"canRemind": {
"type": "boolean"
}
},
"required": [
"userId",
"name",
"email",
"phoneNumber",
"sentAt",
"remindedAt",
"reminderCount",
"respondedAt",
"canRemind"
],
"additionalProperties": false
}
},
{
"type": "null"
}
]
}
},
"required": [
"event",
"form",
"counts",
"averageRating",
"questions",
"fields",
"responses",
"people"
],
"additionalProperties": false
}
},
"required": [
"data"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Validation failed (VALIDATION_FAILED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not signed in (UNAUTHENTICATED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not allowed for this role (FORBIDDEN)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found (NOT_FOUND)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/events/{id}/feedback/remind": {
"post": {
"tags": [
"Feedback"
],
"summary": "Remind people who haven't answered",
"description": "A fresh link to everyone who hasn't answered, or to `userIds` (named forms only). Nobody is sent the form or a reminder twice within 24 hours. Without `userIds` it also sends the form to anyone who has become eligible since it went out.\n\n**Who:** Supervisors and admins.",
"operationId": "postEventsIdFeedbackRemind",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "The id",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"userIds": {
"description": "Only these people (named forms)",
"anyOf": [
{
"maxItems": 1000,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
},
{
"type": "null"
}
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"reminded": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"newlyInvited": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"skipped": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"message": {
"type": "string"
}
},
"required": [
"reminded",
"newlyInvited",
"skipped",
"message"
],
"additionalProperties": false
}
},
"required": [
"data"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Validation failed (VALIDATION_FAILED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not signed in (UNAUTHENTICATED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not allowed for this role (FORBIDDEN)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found (NOT_FOUND)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
+341
View File
@@ -7236,6 +7236,72 @@ export interface paths {
patch?: never;
trace?: never;
};
"/feedback": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Every event with a feedback form
* @description Newest event first, with how many were asked and answered, and the average star rating.
*
* **Who:** Supervisors and admins.
*/
get: operations["getFeedback"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/events/{id}/feedback/results": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* An event's feedback: results, responses and who was asked
* @description On an anonymous form, responses have no name and `people` is null. Opening a named form's answers is recorded in the access log.
*
* **Who:** Supervisors and admins.
*/
get: operations["getEventsIdFeedbackResults"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/events/{id}/feedback/remind": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Remind people who haven't answered
* @description A fresh link to everyone who hasn't answered, or to `userIds` (named forms only). Nobody is sent the form or a reminder twice within 24 hours. Without `userIds` it also sends the form to anyone who has become eligible since it went out.
*
* **Who:** Supervisors and admins.
*/
post: operations["postEventsIdFeedbackRemind"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
@@ -38294,4 +38360,279 @@ export interface operations {
};
};
};
getFeedback: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
event: {
id: string;
title: string;
startDate: unknown;
endDate: unknown;
};
/**
* @description sent, scheduled (a send time is set) or not_scheduled
* @enum {string}
*/
status: "sent" | "scheduled" | "not_scheduled";
sendAt: unknown | null;
sentAt: unknown | null;
anonymous: boolean;
invited: number;
answered: number;
/** @description % */
responseRate: number | null;
/** @description Every star rating on the form, 1–5 */
averageRating: number | null;
lastReminderAt: unknown | null;
}[];
};
};
};
/** @description Not signed in (UNAUTHENTICATED) */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not allowed for this role (FORBIDDEN) */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
getEventsIdFeedbackResults: {
parameters: {
query?: never;
header?: never;
path: {
/** @description The id */
id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
event: {
id: string;
title: string;
startDate: unknown;
endDate: unknown;
};
form: {
/**
* @description sent, scheduled (a send time is set) or not_scheduled
* @enum {string}
*/
status: "sent" | "scheduled" | "not_scheduled";
sendAt: unknown | null;
sentAt: unknown | null;
/** @enum {string} */
audience: "checked_in" | "all";
anonymous: boolean;
intro: string | null;
/** @description When the automatic reminder goes (3 days after sending) */
autoReminderAt: unknown | null;
autoReminderSent: boolean;
};
counts: {
invited: number;
answered: number;
notAnswered: number;
responseRate: number | null;
/** @description Not answered, and not sent the form or a reminder in the last 24 hours */
canRemind: number;
remindedRecently: number;
/** @description Would get the form but haven't been sent it yet (e.g. checked in after it went out) */
waiting: number;
};
averageRating: number | null;
questions: {
fieldId: string;
type: string;
label: string;
answered: number;
average?: number | null;
distribution?: {
label: string;
value: number;
}[];
counts?: {
label: string;
value: number;
}[];
texts?: {
value: string;
name?: string;
}[];
}[];
fields: {
id: string;
type: string;
label: string;
}[];
responses: {
id: string;
createdAt: unknown;
name: string | null;
/** @description Question id → answer */
answers: {
[key: string]: string;
};
}[];
people: {
userId: string;
name: string;
email: string | null;
phoneNumber: string | null;
sentAt: unknown;
remindedAt: unknown | null;
reminderCount: number;
respondedAt: unknown | null;
canRemind: boolean;
}[] | null;
};
};
};
};
/** @description Validation failed (VALIDATION_FAILED) */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not signed in (UNAUTHENTICATED) */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not allowed for this role (FORBIDDEN) */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not found (NOT_FOUND) */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
postEventsIdFeedbackRemind: {
parameters: {
query?: never;
header?: never;
path: {
/** @description The id */
id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description Only these people (named forms) */
userIds?: string[] | null;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
reminded: number;
newlyInvited: number;
skipped: number;
message: string;
};
};
};
};
/** @description Validation failed (VALIDATION_FAILED) */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not signed in (UNAUTHENTICATED) */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not allowed for this role (FORBIDDEN) */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not found (NOT_FOUND) */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
}