From d74af96f1da382a834bdfd36b312b36e5f5c7fc7 Mon Sep 17 00:00:00 2001 From: Joshua Oosthuizen Date: Mon, 2 Nov 2026 13:26:15 +0200 Subject: [PATCH] Docs: every v2 route documents its body, answer and parameters (1.52.1) Most routes answered by a v1 handler showed an empty body and `data: unknown` in /docs/v2. Each now documents what its handler reads and answers, and every path and query parameter is described. - `documented: { body?, response? }` on v1Route/defineRoute, with shared shapes in src/v2/docs.ts. Documentation only: not enforced, so nothing that works can start failing; outside production a body or answer that doesn't fit is logged ("doesn't match its documented schema"). - QUERY_HELP / PATH_HELP describe common parameters; empty bodies say "No body needed". - Declared the funnel's eventIds and webhook deliveries' status/before. - tests/v2Docs.test.ts keeps the document complete; frontend types regenerated, three call sites' types tightened (no payload change). Co-Authored-By: Claude Opus 5.5 --- apps/events/CHANGELOG.md | 19 + apps/events/WHATS-NEW.md | 6 + apps/events/backend/package-lock.json | 4 +- apps/events/backend/package.json | 2 +- apps/events/backend/src/v2/docs.ts | 210 + apps/events/backend/src/v2/openapi.ts | 16 +- .../backend/src/v2/resources/adminPrivacy.ts | 172 +- .../backend/src/v2/resources/attendance.ts | 125 +- .../backend/src/v2/resources/eventsManage.ts | 2 + .../src/v2/resources/kidsVolunteers.ts | 155 +- apps/events/backend/src/v2/resources/money.ts | 168 +- .../src/v2/resources/peopleMessaging.ts | 161 +- .../src/v2/resources/registrationsManage.ts | 11 + .../backend/src/v2/resources/seriesDeals.ts | 4 + apps/events/backend/src/v2/route.ts | 18 + apps/events/backend/src/v2/viaV1.ts | 2 + apps/events/backend/tests/v2Docs.test.ts | 109 + apps/events/docs/HANDOVER.md | 13 +- apps/events/frontend/package-lock.json | 4 +- apps/events/frontend/package.json | 2 +- .../src/app/dashboard/staff/kids/page.tsx | 2 +- .../admin/privacy/BreachesPanel.tsx | 3 +- .../components/shared/TransferTicketModal.tsx | 2 +- .../frontend/src/lib/api-v2/openapi.json | 26999 +++++++++++++++- .../frontend/src/lib/api-v2/schema.d.ts | 7548 ++++- apps/events/package-lock.json | 4 +- apps/events/package.json | 2 +- 27 files changed, 34727 insertions(+), 1036 deletions(-) create mode 100644 apps/events/backend/src/v2/docs.ts create mode 100644 apps/events/backend/tests/v2Docs.test.ts diff --git a/apps/events/CHANGELOG.md b/apps/events/CHANGELOG.md index efeb57b..6aee493 100644 --- a/apps/events/CHANGELOG.md +++ b/apps/events/CHANGELOG.md @@ -7,6 +7,25 @@ and this project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [1.52.1] - 2026-11-02 + +### Changed + +- **The API documentation (`/docs/v2`, `GET /api/v2/openapi.json`) now describes every route in + full.** Before, most routes answered by a v1 handler showed an empty body and `data: unknown`. + Each one now documents the body it reads and what it answers, from the handler's actual code, and + every path and query parameter has a description. Actions that take no input say "No body + needed". +- How: `documented: { body?, response? }` on `v1Route` (and `defineRoute`), with shared shapes in + `src/v2/docs.ts`. These are documentation only — requests and answers aren't checked against + them, so nothing an app already does can start failing — but outside production a body or + answer that doesn't fit is logged (`[api/v2] … doesn't match its documented schema`). + `tests/v2Docs.test.ts` keeps the document complete. +- The funnel report's `eventIds` and the webhook deliveries' `status`/`before` filters are now + declared (they worked, but weren't in the document or the typed frontend calls). +- The frontend's generated API types are richer; a few calls had their types tightened to match + (ticket transfer, breach register, kids check-out). Nothing changes in what they send. + ## [1.52.0] - 2026-11-02 — urgent ### Fixed diff --git a/apps/events/WHATS-NEW.md b/apps/events/WHATS-NEW.md index 4547c00..a3fa280 100644 --- a/apps/events/WHATS-NEW.md +++ b/apps/events/WHATS-NEW.md @@ -12,6 +12,12 @@ Write for church admins, not developers: no environment variables, endpoints or developer log is CHANGELOG.md. A tagged version without a section here shows "No details given". --> +## 1.52.1 + +- **Better documentation for developers.** If someone builds on your Cross Events site (for example + an integration or a website plug-in), the API reference now explains every part of it in full. + Nothing changes in how the site works. + ## 1.52.0 — urgent - **Paying at the door always gives people their tickets now.** On events with a required diff --git a/apps/events/backend/package-lock.json b/apps/events/backend/package-lock.json index 815dc61..e58dae9 100644 --- a/apps/events/backend/package-lock.json +++ b/apps/events/backend/package-lock.json @@ -1,12 +1,12 @@ { "name": "event-management-backend", - "version": "1.52.0", + "version": "1.52.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "event-management-backend", - "version": "1.52.0", + "version": "1.52.1", "hasInstallScript": true, "dependencies": { "@cj-tech-master/excelts": "^10.2.0", diff --git a/apps/events/backend/package.json b/apps/events/backend/package.json index f00fd3b..83799d7 100644 --- a/apps/events/backend/package.json +++ b/apps/events/backend/package.json @@ -1,6 +1,6 @@ { "name": "event-management-backend", - "version": "1.52.0", + "version": "1.52.1", "description": "Event Management System Backend", "main": "src/index.js", "scripts": { diff --git a/apps/events/backend/src/v2/docs.ts b/apps/events/backend/src/v2/docs.ts new file mode 100644 index 0000000..9b1b3ed --- /dev/null +++ b/apps/events/backend/src/v2/docs.ts @@ -0,0 +1,210 @@ +/** + * Shapes for the API documentation (1.52.1): the records v1 handlers answer with, and the bodies + * they take, described once so every route shows the same thing the same way. Used as + * `documented: { body, response }` on v1Route (see RouteDef.documented) — shown in the OpenAPI + * document, not enforced; outside production anything that doesn't fit is logged. + * + * Everything is a loose object (extra fields pass, as v1 answers carry their Prisma includes), + * dates are ISO strings (as they arrive in JSON), and fields a handler may leave out are optional. + */ +import { z } from 'zod'; + +export const obj = (shape: T) => z.looseObject(shape); +export const str = z.string(); +export const optStr = z.string().nullish(); +export const num = z.number(); +export const optNum = z.number().nullish(); +export const bool = z.boolean(); +export const optBool = z.boolean().nullish(); +export const date = z.string().describe('Date and time (ISO 8601)'); +export const optDate = date.nullish(); +export const rand = z.number().describe('Rand'); +export const optRand = rand.nullish(); +export const anyObj = z.looseObject({}); +/** A number sent as a number or as text (forms send text). */ +export const numeric = z.union([z.number(), z.string()]); +export const ids = z.array(z.string()).describe('Ids'); +export const channel = z.enum(['email', 'whatsapp', 'both']).describe('How to send it'); + +/** `{ message }`: what was done, in words for the person. */ +export const message = obj({ message: str }); +/** `{ ok: true }` */ +export const ok = obj({ ok: z.literal(true) }); +/** v1's paged lists: `{ data, total, page, limit, pages }`. */ +export const v1Page = (item: T) => obj({ data: z.array(item), total: num, page: num, limit: num, pages: num }); +/** A `{ redirectUrl }` answer from a checkout: where to send the person to pay. */ +export const checkout = obj({ + checkoutId: optStr, + redirectUrl: optStr.describe('Where to send the person to pay (null when the provider takes a form)'), + provider: optStr, + form: obj({ action: str, fields: z.record(z.string(), z.string()) }).nullish().describe('A form to post (PayFast)'), +}); + +export const userSummary = obj({ id: str.optional(), name: str, email: optStr, phoneNumber: optStr }); +export const userRef = obj({ id: str.optional(), name: str, email: optStr }); + +export const user = obj({ + id: str, + name: str, + email: str, + phoneNumber: optStr, + role: z.enum(['admin', 'supervisor', 'staff', 'user']), + isActive: optBool, + notificationPreference: z.enum(['email', 'whatsapp', 'both']).nullish(), + homeCampusId: optStr, + createdAt: optDate, +}); + +export const eventRef = obj({ id: str, title: str, startDate: optDate, endDate: optDate }); + +export const event = obj({ + id: str, + title: str, + description: optStr, + startDate: date, + endDate: date, + location: optStr, + price: optRand, + isActive: optBool, + isHidden: optBool, + imageUrl: optStr, + campusId: optStr, + scheduleType: z.enum(['single', 'sessions']).nullish(), + cashupStatus: z.enum(['open', 'closed']).nullish(), +}); + +export const session = obj({ id: str, label: optStr, startsAt: date, endsAt: date, cancelledAt: optDate, capacity: optNum }); + +export const eventOption = obj({ + id: str, + eventId: str.optional(), + name: str, + description: optStr, + price: rand, + isMainTicket: bool, + stockLimit: optNum, +}); + +export const payment = obj({ + id: str, + amount: rand.describe('Rand; a refund is negative'), + method: str.describe('cash, card, eft, other — or the wallet type for an online payment'), + provider: optStr.describe('yoco or payfast for an online payment'), + userId: str, + recordedById: optStr, + registrationId: optStr, + eventId: optStr, + isDonation: bool, + isSponsorship: optBool, + originalPaymentId: optStr.describe('A refund: the payment it refunds; a donation leg: the donation'), + externalId: optStr, + createdAt: date, + user: userSummary.nullish(), + recordedBy: userRef.nullish(), + event: eventRef.nullish(), +}); + +export const registrationStatus = z.enum(['pending', 'confirmed', 'partial_paid', 'paid', 'cancelled']); + +export const registration = obj({ + id: str, + userId: str, + eventId: str, + status: registrationStatus, + discountTotal: optRand, + totalDueComputed: optRand.describe('What it costs now, after discounts'), + createdAt: date, + user: userSummary.nullish(), + event: eventRef.nullish(), +}); + +export const ticket = obj({ + id: str, + qrCode: str.describe('What the QR code holds'), + quantity: num.describe('People on the ticket'), + isUsed: bool, + eventId: str, + userId: str.describe('The payer'), + registrationOptionId: str, + attendeeId: optStr.describe('A named ticket: the person it\'s for'), + holderUserId: optStr, + createdAt: date, +}); + +export const auditEntry = obj({ + id: str, + action: str, + actorRole: optStr, + targetType: optStr, + targetId: optStr, + metadata: anyObj.nullish(), + ip: optStr, + createdAt: date, + actor: userRef.nullish(), +}); + +/** + * What the common query parameters mean, for routes that declare them by name only (`filters(…)` + * in the resource files). The OpenAPI document uses these when a parameter has no description. + */ +export const QUERY_HELP: Record = { + page: 'Page number, from 1', + limit: 'How many per page', + eventId: 'Only this event', + eventIds: 'These events (comma-separated ids)', + registrationId: 'Only this registration', + userId: 'Only this person', + actorId: 'Only things this person did', + sessionId: 'Multi-day events: the session (default: today\'s)', + deviceId: 'This device\'s id (offline scanning)', + from: 'On or after (ISO date or date-time)', + to: 'On or before (ISO date or date-time)', + startDate: 'On or after (ISO date)', + endDate: 'On or before (ISO date)', + before: 'Older than (ISO date-time), for the next page', + cursor: 'Where the last page ended (its `nextCursor`)', + search: 'Text to search for', + q: 'Text to search for', + status: 'Only this status', + role: 'admin, supervisor, staff or user', + isActive: '`true` or `false`', + campus: 'Campus id or slug (`all` for every campus)', + series: 'Event series slug', + format: 'File type, e.g. `pdf` or `xlsx`', + log: '`1` also writes it to the access log (a list with personal details)', + all: '`true`/`1`: include everything, not just the current ones', + medical: '`true`: include medical notes (supervisors; logged)', + type: 'Which kind', + action: 'Only this action', + sensitive: '`true`: only access to sensitive information', + version: 'A version number (default: the current one)', + provider: 'yoco or payfast', + method: 'Payment method: cash, card, eft, other', + kind: 'payment or refund', + donations: '`1`: only donations and the parts put towards registrations', + channel: 'email or whatsapp', + email: 'An email address', + phone: 'A phone number', + phoneNumber: 'A phone number', + past: '`true`: include ones that are over too', + unpaid: '`true`: only ones with money still owed', + unreviewed: '`true`: only the ones not reviewed yet', + seriesId: 'Only this event series', + registrants: '`true`: also people registered for its events in the last 12 months', +}; + +/** What path parameters are, when the route doesn't say. */ +export const PATH_HELP: Record = { + id: 'The id', + userId: 'The person\'s id', + attendeeId: 'The named attendee\'s id', + attachmentId: 'The attachment\'s id', + familyId: 'The family\'s id', + childId: 'The child\'s id', + slug: 'The short name in the address', + token: 'The token from the link (it is the credential)', + qrCode: 'What the ticket\'s QR code holds', + code: 'The code', + name: 'The name', + filename: 'The file name', +}; diff --git a/apps/events/backend/src/v2/openapi.ts b/apps/events/backend/src/v2/openapi.ts index abd686b..0686e34 100644 --- a/apps/events/backend/src/v2/openapi.ts +++ b/apps/events/backend/src/v2/openapi.ts @@ -1,6 +1,7 @@ import { z } from 'zod'; import { routes as allRoutes, type AnyRoute, type Access } from './route'; import { ERROR_STATUS } from './errors'; +import { PATH_HELP, QUERY_HELP } from './docs'; /** * The OpenAPI 3.1 document for /api/v2, built from the route declarations (route.ts), so it is @@ -48,7 +49,8 @@ function parameters(def: AnyRoute) { if (!schema) return; const json = toSchema(schema, 'input') as { properties?: Record; required?: string[] }; for (const [name, prop] of Object.entries(json.properties || {})) { - const { description, ...propSchema } = prop as JsonSchema & { description?: string }; + const { description: own, ...propSchema } = prop as JsonSchema & { description?: string }; + const description = own || (where === 'query' ? QUERY_HELP[name] : PATH_HELP[name]); out.push({ name, in: where, required: where === 'path' || (json.required || []).includes(name), ...(description ? { description } : {}), schema: propSchema }); } }; @@ -57,6 +59,14 @@ function parameters(def: AnyRoute) { return out; } +/** A JSON body; one with nothing in it (an action that takes no input) says so. */ +function requestBody(schema: JsonSchema) { + const empty = !(schema as { properties?: object }).properties || !Object.keys((schema as { properties: object }).properties).length; + return empty + ? { required: true, description: 'No body needed: send an empty object.', content: { 'application/json': { schema } } } + : { required: true, content: { 'application/json': { schema } } }; +} + export function buildOpenApi(opts: { version: string; serverUrl?: string; list?: AnyRoute[] }) { const list = opts.list ?? allRoutes; const paths: Record> = {}; @@ -73,11 +83,11 @@ export function buildOpenApi(opts: { version: string; serverUrl?: string; list?: parameters: parameters(def), ...(def.upload ? { requestBody: { required: true, content: { 'multipart/form-data': { schema: { type: 'object', required: [def.upload.field], properties: { [def.upload.field]: { type: 'string', format: 'binary', description: def.upload.description } } } } } } } - : def.body ? { requestBody: { required: true, content: { 'application/json': { schema: toSchema(def.body, 'input') } } } } : {}), + : (def.documented?.body || def.body) ? { requestBody: requestBody(toSchema((def.documented?.body || def.body)!, 'input')) } : {}), responses: { [String(def.status ?? 200)]: def.file ? { description: 'The file', content: { [def.file.contentType]: { schema: { type: 'string' } } } } - : { description: 'OK', content: { 'application/json': { schema: toSchema(def.response, 'output') } } }, + : { description: 'OK', content: { 'application/json': { schema: toSchema(def.documented?.response ? z.object({ data: def.documented.response }) : def.response, 'output') } } }, ...(def.params || def.query || def.body ? { 400: errorResponse('Validation failed (VALIDATION_FAILED)') } : {}), ...(secured ? { 401: errorResponse('Not signed in (UNAUTHENTICATED)') } : {}), ...(secured && def.access !== 'user' ? { 403: errorResponse('Not allowed for this role (FORBIDDEN)') } : {}), diff --git a/apps/events/backend/src/v2/resources/adminPrivacy.ts b/apps/events/backend/src/v2/resources/adminPrivacy.ts index 59aed3e..98abdf6 100644 --- a/apps/events/backend/src/v2/resources/adminPrivacy.ts +++ b/apps/events/backend/src/v2/resources/adminPrivacy.ts @@ -8,6 +8,7 @@ import { z } from 'zod'; import { idParams } from '../schemas'; import { v1Route } from '../viaV1'; +import * as D from '../docs'; /* eslint-disable @typescript-eslint/no-explicit-any -- v1 handlers and middleware are JavaScript */ const rateLimit = require('express-rate-limit') as (opts: object) => any; @@ -26,101 +27,136 @@ const filters = (...names: string[]) => z.looseObject(Object.fromEntries(names.m const tokenParams = z.object({ token: z.string().min(1).max(500) }); const exportLimiter = rateLimit({ windowMs: 10 * 60 * 1000, max: 10, standardHeaders: true, legacyHeaders: false }); +// ─── Documented shapes (docs.ts) ───────────────────────────────────────────── + +const news = D.obj({ email: D.bool, whatsapp: D.bool }); +const dataRequest = D.obj({ + id: D.str, type: z.enum(['access', 'correction', 'deletion']), status: z.enum(['open', 'completed', 'rejected', 'cancelled']), + userId: D.optStr, name: D.str.optional(), email: D.str.optional(), details: D.optStr, response: D.optStr, dueAt: D.optDate.describe('30 days after it was made'), + closedAt: D.optDate, createdAt: D.date, +}); +const noticeSection = D.obj({ key: D.str.optional(), title: D.str, body: D.str.describe('Text; {placeholders} are filled in') }); +const operatorInput = D.obj({ name: D.str, purpose: D.str.describe('What they do for the church'), dataShared: D.optStr, location: D.optStr.describe('Country the data is kept in'), website: D.optStr, active: D.optBool, order: D.optNum }); +const operator = operatorInput.extend({ id: D.str, active: D.bool, order: D.num, createdAt: D.date, updatedAt: D.date }); +const logPage = (row: T) => D.obj({ total: D.num, pageSize: D.num, rows: z.array(row) }); +const breachInput = D.obj({ + title: D.str, description: D.str, dataAffected: D.str, peopleAffected: D.numeric.nullish(), whoAffected: D.optStr, consequences: D.optStr, + actionsTaken: D.optStr, adviceToPeople: D.optStr, causedBy: D.optStr, status: D.optStr.describe('open or closed'), + discoveredAt: D.date, occurredAt: D.optDate, regulatorNotifiedAt: D.optDate.describe('When the Information Regulator was told'), peopleNotifiedAt: D.optDate, +}); +const breach = breachInput.extend({ id: D.str, status: D.str, createdAt: D.date, updatedAt: D.date, createdBy: D.obj({ name: D.str }).nullish() }); +const retentionState = D.obj({ + policies: D.anyObj.describe('Per kind of information: how long it is kept'), definitions: D.anyObj, preview: D.anyObj.describe('What the rules would remove now'), + lastRun: D.anyObj.nullish(), related: D.obj({ medicalDays: D.num, backupCount: D.num, analyticsDays: D.num }), +}); +const hubStatus = D.obj({ + state: D.str.describe('active, grace, suspended, revoked, none…'), readOnly: D.bool, daysLeft: D.optNum, endsAt: D.optDate, graceEndsAt: D.optDate, + licence: D.obj({ customer: D.optStr, plan: D.optStr, status: D.optStr, licenceExpiresAt: D.optDate, graceDays: D.optNum, issuedAt: D.optDate, validUntil: D.optDate, limits: D.anyObj }).nullish(), + connected: D.bool, keyConfigured: D.bool, hubUrl: D.optStr, lastHeartbeatAt: D.optDate, lastError: D.optStr, + version: D.str.describe('This site\'s version'), latestVersion: D.optStr, updateAvailable: D.bool, urgentUpdate: D.bool, updateSnoozed: D.optBool, + releases: z.array(D.anyObj).optional().describe('What\'s new in each version since this one'), updateRequest: D.anyObj.nullish(), notices: z.array(D.anyObj).optional(), +}); +const webhook = D.obj({ + id: D.str, name: D.str, url: D.str, events: z.array(D.str).describe('Event types it gets'), isActive: D.bool, operatorId: D.optStr.describe('Its entry in the operator register'), + lastSuccessAt: D.optDate, lastFailureAt: D.optDate, createdAt: D.date, +}); +const delivered = D.obj({ status: D.optStr.describe('succeeded, failed, retrying…'), statusCode: D.optNum, error: D.optStr }); + // ─── My privacy ────────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/me/privacy', tag: 'Privacy', summary: 'My privacy settings', description: 'News consent, open requests, and whether there\'s a privacy notice to accept.', access: 'user', v1: privacy.getMyPrivacy }); -v1Route({ method: 'put', path: '/me/privacy/news', tag: 'Privacy', summary: 'Choose whether to get news', access: 'user', body: loose, v1: privacy.updateMyNews }); +v1Route({ method: 'get', path: '/me/privacy', tag: 'Privacy', summary: 'My privacy settings', description: 'News consent, open requests, and whether there\'s a privacy notice to accept.', access: 'user', documented: { response: D.obj({ news, newsAskedAt: D.optDate, canWhatsApp: D.bool, notificationPreference: D.optStr, history: z.array(D.anyObj).describe('Every change to my news consent'), requests: z.array(dataRequest) }) }, v1: privacy.getMyPrivacy }); +v1Route({ method: 'put', path: '/me/privacy/news', tag: 'Privacy', summary: 'Choose whether to get news', access: 'user', body: loose, documented: { body: D.obj({ email: D.optBool, whatsapp: D.optBool, source: D.optStr.describe('Where it was changed, for the consent log') }), response: D.obj({ news, newsAskedAt: D.optDate }) }, v1: privacy.updateMyNews }); v1Route({ method: 'get', path: '/me/privacy/export', tag: 'Privacy', summary: 'Download everything held about me', description: '`format=pdf` or JSON (the default).', access: 'user', middleware: [exportLimiter], query: filters('format'), file: { contentType: 'application/json' }, v1: privacy.exportMyData }); -v1Route({ method: 'post', path: '/me/privacy/requests', tag: 'Privacy', summary: 'Ask for my data to be corrected or deleted', access: 'user', status: 201, body: loose, v1: privacy.createMyRequest }); -v1Route({ method: 'post', path: '/me/privacy/notice/accept', tag: 'Privacy', summary: 'Accept the privacy notice', access: 'user', body: loose, v1: privacy.acceptMyNotice }); -v1Route({ method: 'get', path: '/privacy/notice', tag: 'Privacy', summary: 'The published privacy notice', access: 'public', query: filters('version'), v1: privacy.getNotice }); -v1Route({ method: 'get', path: '/unsubscribe/:token', tag: 'Privacy', summary: 'What an unsubscribe link is for', description: 'The token in the link is the credential.', access: 'public', params: tokenParams, v1: privacy.getUnsubscribe }); -v1Route({ method: 'post', path: '/unsubscribe/:token', tag: 'Privacy', summary: 'Unsubscribe with a link', access: 'public', params: tokenParams, body: loose, v1: privacy.postUnsubscribe }); +v1Route({ method: 'post', path: '/me/privacy/requests', tag: 'Privacy', summary: 'Ask for my data to be corrected or deleted', access: 'user', status: 201, body: loose, documented: { body: D.obj({ type: z.enum(['correction', 'deletion']), details: D.optStr.describe('A correction: what to change'), password: D.optStr.describe('A deletion: closes the account too') }), response: D.obj({ request: dataRequest, message: D.str }) }, v1: privacy.createMyRequest }); +v1Route({ method: 'post', path: '/me/privacy/notice/accept', tag: 'Privacy', summary: 'Accept the privacy notice', access: 'user', body: loose, documented: { response: D.obj({ version: D.num.describe('The version accepted') }) }, v1: privacy.acceptMyNotice }); +v1Route({ method: 'get', path: '/privacy/notice', tag: 'Privacy', summary: 'The published privacy notice', access: 'public', query: filters('version'), documented: { response: D.obj({ version: D.num.describe('0: the built-in text'), builtIn: D.optBool, current: D.optBool, publishedAt: D.optDate, effectiveDate: D.optStr, changeSummary: D.optStr, sections: z.array(D.anyObj).describe('Rendered sections'), versions: z.array(D.anyObj).describe('Every published version') }) }, v1: privacy.getNotice }); +v1Route({ method: 'get', path: '/unsubscribe/:token', tag: 'Privacy', summary: 'What an unsubscribe link is for', description: 'The token in the link is the credential.', access: 'public', params: tokenParams, documented: { response: D.obj({ kind: z.enum(['account', 'address']), email: D.optStr.describe('Partly hidden'), hasPhone: D.optBool, news: D.obj({ email: D.bool, whatsapp: D.bool }).optional(), address: D.optStr.describe('kind address: the email or phone, partly hidden') }) }, v1: privacy.getUnsubscribe }); +v1Route({ method: 'post', path: '/unsubscribe/:token', tag: 'Privacy', summary: 'Unsubscribe with a link', access: 'public', params: tokenParams, body: loose, documented: { body: D.obj({ channels: z.array(z.enum(['email', 'whatsapp'])).optional().describe('Default: the link\'s channel') }), response: D.message }, v1: privacy.postUnsubscribe }); // ─── Privacy admin ─────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/privacy/requests', tag: 'Privacy', summary: 'Data requests', description: '`status=open` (default), `closed` or `all`.', access: 'admin', query: filters('status', 'search', 'page', 'limit'), v1: privacy.listRequests }); -v1Route({ method: 'post', path: '/privacy/requests/:id/complete', tag: 'Privacy', summary: 'Mark a data request done', access: 'admin', params: idParams, body: loose, v1: privacy.completeRequest }); -v1Route({ method: 'post', path: '/privacy/requests/:id/reject', tag: 'Privacy', summary: 'Turn down a data request', access: 'admin', params: idParams, body: loose, v1: privacy.rejectRequest }); -v1Route({ method: 'get', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'The privacy notice being drafted', access: 'admin', v1: privacy.getNoticeDraft }); -v1Route({ method: 'put', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'Save the draft notice', access: 'admin', body: loose, v1: privacy.saveNoticeDraft }); -v1Route({ method: 'delete', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'Throw the draft away', access: 'admin', v1: privacy.discardNoticeDraft }); -v1Route({ method: 'post', path: '/privacy/notice/publish', tag: 'Privacy', summary: 'Publish the draft notice', description: 'Everyone is asked to accept it at their next sign-in.', access: 'admin', body: loose, v1: privacy.publishNotice }); -v1Route({ method: 'post', path: '/privacy/notice/builtin-reviewed', tag: 'Privacy', summary: 'Mark the built-in notice as reviewed', access: 'admin', body: loose, v1: privacy.markBuiltInReviewed }); -v1Route({ method: 'get', path: '/privacy/operators', tag: 'Privacy', summary: 'Who processes personal information for the church', access: 'admin', v1: privacy.listOperators }); -v1Route({ method: 'post', path: '/privacy/operators', tag: 'Privacy', summary: 'Add an operator', access: 'admin', status: 201, body: loose, v1: privacy.createOperator }); -v1Route({ method: 'put', path: '/privacy/operators/:id', tag: 'Privacy', summary: 'Change an operator', access: 'admin', params: idParams, body: loose, v1: privacy.updateOperator }); -v1Route({ method: 'delete', path: '/privacy/operators/:id', tag: 'Privacy', summary: 'Remove an operator', access: 'admin', params: idParams, v1: privacy.deleteOperator }); -v1Route({ method: 'get', path: '/privacy/consent-log', tag: 'Privacy', summary: 'Consent given and withdrawn', access: 'admin', query: filters('type', 'page', 'q'), v1: privacy.consentLog }); -v1Route({ method: 'get', path: '/privacy/access-log', tag: 'Privacy', summary: 'Who looked at sensitive information', access: 'admin', query: filters('page', 'action', 'sensitive', 'actorId', 'from', 'to'), v1: privacy.accessLog }); -v1Route({ method: 'get', path: '/privacy/readiness', tag: 'Privacy', summary: 'POPIA checklist', access: 'admin', v1: privacy.getReadiness }); -v1Route({ method: 'get', path: '/privacy/retention', tag: 'Privacy', summary: 'How long information is kept', access: 'admin', v1: privacy.getRetention }); -v1Route({ method: 'put', path: '/privacy/retention', tag: 'Privacy', summary: 'Change how long information is kept', access: 'admin', body: loose, v1: privacy.saveRetention }); -v1Route({ method: 'post', path: '/privacy/retention/run', tag: 'Privacy', summary: 'Apply the retention rules now', access: 'admin', body: loose, v1: privacy.runRetentionNow }); -v1Route({ method: 'get', path: '/privacy/breaches', tag: 'Privacy', summary: 'Recorded data breaches', access: 'admin', v1: privacy.listBreaches }); -v1Route({ method: 'post', path: '/privacy/breaches', tag: 'Privacy', summary: 'Record a data breach', access: 'admin', status: 201, body: loose, v1: privacy.createBreach }); -v1Route({ method: 'put', path: '/privacy/breaches/:id', tag: 'Privacy', summary: 'Update a data breach', access: 'admin', params: idParams, body: loose, v1: privacy.updateBreach }); +v1Route({ method: 'get', path: '/privacy/requests', tag: 'Privacy', summary: 'Data requests', description: '`status=open` (default), `closed` or `all`.', access: 'admin', query: filters('status', 'search', 'page', 'limit'), documented: { response: D.obj({ requests: z.array(dataRequest.extend({ overdue: D.optBool, blockers: z.array(D.anyObj).optional().describe('Upcoming registrations that stop a deletion') })), openCount: D.num, total: D.num, page: D.num, limit: D.num, pages: D.num }) }, v1: privacy.listRequests }); +v1Route({ method: 'post', path: '/privacy/requests/:id/complete', tag: 'Privacy', summary: 'Mark a data request done', access: 'admin', params: idParams, body: loose, documented: { body: D.obj({ response: D.optStr.describe('Emailed to them; needed for a correction') }), response: D.obj({ request: dataRequest, anonymised: D.anyObj.nullish().describe('A deletion: what was removed') }) }, v1: privacy.completeRequest }); +v1Route({ method: 'post', path: '/privacy/requests/:id/reject', tag: 'Privacy', summary: 'Turn down a data request', access: 'admin', params: idParams, body: loose, documented: { body: D.obj({ response: D.str.describe('The reason, emailed to them'), cancelled: D.optBool.describe('They withdrew it') }), response: D.obj({ request: dataRequest }) }, v1: privacy.rejectRequest }); +v1Route({ method: 'get', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'The privacy notice being drafted', access: 'admin', documented: { response: D.obj({ sections: z.array(noticeSection), isDraft: D.optBool, rendered: z.array(D.anyObj).describe('The sections with placeholders filled in'), placeholders: z.array(D.str).describe('The placeholders the text can use'), versions: z.array(D.anyObj).describe('Published versions'), builtIn: z.array(noticeSection), builtInUpdates: z.array(D.anyObj).describe('Changes to the built-in text not reviewed yet') }) }, v1: privacy.getNoticeDraft }); +v1Route({ method: 'put', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'Save the draft notice', access: 'admin', body: loose, documented: { body: D.obj({ sections: z.array(noticeSection) }), response: D.obj({ sections: z.array(noticeSection), rendered: z.array(D.anyObj), isDraft: z.literal(true), savedAt: D.date }) }, v1: privacy.saveNoticeDraft }); +v1Route({ method: 'delete', path: '/privacy/notice/draft', tag: 'Privacy', summary: 'Throw the draft away', access: 'admin', documented: { response: D.message }, v1: privacy.discardNoticeDraft }); +v1Route({ method: 'post', path: '/privacy/notice/publish', tag: 'Privacy', summary: 'Publish the draft notice', description: 'Everyone is asked to accept it at their next sign-in.', access: 'admin', body: loose, documented: { body: D.obj({ sections: z.array(noticeSection).optional(), changeSummary: D.str.describe('Shown to people asked to accept it'), requiresAcceptance: D.optBool }), response: D.obj({ version: D.num, publishedAt: D.date, requiresAcceptance: D.bool }) }, v1: privacy.publishNotice }); +v1Route({ method: 'post', path: '/privacy/notice/builtin-reviewed', tag: 'Privacy', summary: 'Mark the built-in notice as reviewed', access: 'admin', body: loose, documented: { response: D.obj({ builtInUpdates: z.array(D.anyObj) }) }, v1: privacy.markBuiltInReviewed }); +v1Route({ method: 'get', path: '/privacy/operators', tag: 'Privacy', summary: 'Who processes personal information for the church', access: 'admin', documented: { response: z.array(operator) }, v1: privacy.listOperators }); +v1Route({ method: 'post', path: '/privacy/operators', tag: 'Privacy', summary: 'Add an operator', access: 'admin', status: 201, body: loose, documented: { body: operatorInput, response: operator }, v1: privacy.createOperator }); +v1Route({ method: 'put', path: '/privacy/operators/:id', tag: 'Privacy', summary: 'Change an operator', access: 'admin', params: idParams, body: loose, documented: { body: operatorInput.partial(), response: operator }, v1: privacy.updateOperator }); +v1Route({ method: 'delete', path: '/privacy/operators/:id', tag: 'Privacy', summary: 'Remove an operator', access: 'admin', params: idParams, documented: { response: D.message }, v1: privacy.deleteOperator }); +v1Route({ method: 'get', path: '/privacy/consent-log', tag: 'Privacy', summary: 'Consent given and withdrawn', access: 'admin', query: filters('type', 'page', 'q'), documented: { response: logPage(D.obj({ id: D.str, at: D.optDate, name: D.optStr })).describe('`type` news: email, channel, granted, source, ip; notice: email, version, source, ip; parental: child, event, status, signedName') }, v1: privacy.consentLog }); +v1Route({ method: 'get', path: '/privacy/access-log', tag: 'Privacy', summary: 'Who looked at sensitive information', access: 'admin', query: filters('page', 'action', 'sensitive', 'actorId', 'from', 'to'), documented: { response: logPage(D.obj({ id: D.str, at: D.date, actor: D.str, actorRole: D.optStr, action: D.str, what: D.optStr, records: D.optNum, eventId: D.optStr, ip: D.optStr, sensitive: D.bool })).extend({ actions: z.array(D.str), actors: z.array(D.obj({ id: D.str, name: D.str })) }) }, v1: privacy.accessLog }); +v1Route({ method: 'get', path: '/privacy/readiness', tag: 'Privacy', summary: 'POPIA checklist', access: 'admin', documented: { response: D.obj({ score: D.num.describe('%'), passed: D.num, total: D.num, checks: z.array(D.obj({ key: D.str, label: D.str, ok: D.bool, detail: D.optStr, href: D.optStr, applies: D.bool })) }) }, v1: privacy.getReadiness }); +v1Route({ method: 'get', path: '/privacy/retention', tag: 'Privacy', summary: 'How long information is kept', access: 'admin', documented: { response: retentionState }, v1: privacy.getRetention }); +v1Route({ method: 'put', path: '/privacy/retention', tag: 'Privacy', summary: 'Change how long information is kept', access: 'admin', body: loose, documented: { body: D.obj({ policies: D.anyObj.describe('Per kind of information: { enabled, months }') }), response: retentionState }, v1: privacy.saveRetention }); +v1Route({ method: 'post', path: '/privacy/retention/run', tag: 'Privacy', summary: 'Apply the retention rules now', access: 'admin', body: loose, documented: { response: D.obj({ result: D.anyObj.describe('What was removed or anonymised'), state: retentionState }) }, v1: privacy.runRetentionNow }); +v1Route({ method: 'get', path: '/privacy/breaches', tag: 'Privacy', summary: 'Recorded data breaches', access: 'admin', documented: { response: z.array(breach) }, v1: privacy.listBreaches }); +v1Route({ method: 'post', path: '/privacy/breaches', tag: 'Privacy', summary: 'Record a data breach', access: 'admin', status: 201, body: loose, documented: { body: breachInput, response: breach }, v1: privacy.createBreach }); +v1Route({ method: 'put', path: '/privacy/breaches/:id', tag: 'Privacy', summary: 'Update a data breach', access: 'admin', params: idParams, body: loose, documented: { body: breachInput.partial(), response: breach }, v1: privacy.updateBreach }); // ─── Admin ─────────────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/admin/audit-log', tag: 'Admin', summary: 'The audit log', access: 'admin', query: filters('page', 'limit', 'actorId', 'action', 'role', 'from', 'to', 'search'), v1: audit.listAuditLog }); -v1Route({ method: 'get', path: '/admin/jobs', tag: 'Admin', summary: 'Background jobs', access: 'admin', v1: jobs.listJobs }); -v1Route({ method: 'post', path: '/admin/jobs/:name/run', tag: 'Admin', summary: 'Run a background job now', access: 'admin', params: z.object({ name: z.string().min(1).max(100) }), body: loose, v1: jobs.runJobNow }); -v1Route({ method: 'get', path: '/admin/impersonation-sessions', tag: 'Admin', summary: 'Times admins viewed the site as someone else', access: 'admin', query: filters('limit'), v1: imp.listSessions }); -v1Route({ method: 'post', path: '/admin/impersonate/:userId', tag: 'Admin', summary: 'View the site as someone (read-only)', description: 'Answers a token for a read-only session, logged.', access: 'admin', params: z.object({ userId: z.string().min(1).max(64) }), body: loose, v1: imp.startImpersonation }); -v1Route({ method: 'get', path: '/me/impersonation', tag: 'Admin', summary: 'The viewing-as session I\'m in, if any', access: 'user', v1: imp.currentImpersonation }); -v1Route({ method: 'post', path: '/me/impersonation/end', tag: 'Admin', summary: 'Stop viewing as someone', access: 'user', body: loose, v1: imp.endImpersonation }); -v1Route({ method: 'post', path: '/me/impersonation/log', tag: 'Admin', summary: 'Record a page viewed while viewing as someone', access: 'user', body: loose, v1: imp.logPageView }); +v1Route({ method: 'get', path: '/admin/audit-log', tag: 'Admin', summary: 'The audit log', access: 'admin', query: filters('page', 'limit', 'actorId', 'action', 'role', 'from', 'to', 'search'), documented: { response: D.obj({ rows: z.array(D.auditEntry), total: D.num, page: D.num, limit: D.num }) }, v1: audit.listAuditLog }); +v1Route({ method: 'get', path: '/admin/jobs', tag: 'Admin', summary: 'Background jobs', access: 'admin', documented: { response: D.obj({ mode: D.str.describe('on, off or timers'), timezone: D.str, jobs: z.array(D.obj({ name: D.str, label: D.str, cron: D.optStr, enabled: D.bool, envFlag: D.optStr, nextRun: D.optDate, recent: z.array(D.anyObj).describe('Recent runs') })) }) }, v1: jobs.listJobs }); +v1Route({ method: 'post', path: '/admin/jobs/:name/run', tag: 'Admin', summary: 'Run a background job now', access: 'admin', params: z.object({ name: z.string().min(1).max(100) }), body: loose, documented: { response: D.obj({ queued: D.bool, id: D.optStr, output: z.unknown().optional().describe('When it ran straight away') }) }, v1: jobs.runJobNow }); +v1Route({ method: 'get', path: '/admin/impersonation-sessions', tag: 'Admin', summary: 'Times admins viewed the site as someone else', access: 'admin', query: filters('limit'), documented: { response: z.array(D.obj({ id: D.str, reason: D.optStr, startedAt: D.optDate, endedAt: D.optDate, expiresAt: D.optDate, admin: D.obj({ name: D.str, email: D.optStr }).nullish(), target: D.obj({ name: D.str, email: D.optStr }).nullish(), requests: z.array(D.obj({ method: D.str, path: D.str, blocked: D.bool, createdAt: D.date })).describe('What they did (up to 500)') })) }, v1: imp.listSessions }); +v1Route({ method: 'post', path: '/admin/impersonate/:userId', tag: 'Admin', summary: 'View the site as someone (read-only)', description: 'Answers a token for a read-only session, logged.', access: 'admin', params: z.object({ userId: z.string().min(1).max(64) }), body: loose, documented: { body: D.obj({ reason: D.str.describe('Why — kept in the log') }), response: D.obj({ token: D.str.describe('A read-only sign-in token'), session: D.obj({ id: D.str, expiresAt: D.date, target: D.obj({ id: D.str, name: D.str, email: D.str, role: D.str }) }) }) }, v1: imp.startImpersonation }); +v1Route({ method: 'get', path: '/me/impersonation', tag: 'Admin', summary: 'The viewing-as session I\'m in, if any', access: 'user', documented: { response: D.obj({ id: D.str, expiresAt: D.date, target: D.userRef }).nullable() }, v1: imp.currentImpersonation }); +v1Route({ method: 'post', path: '/me/impersonation/end', tag: 'Admin', summary: 'Stop viewing as someone', access: 'user', body: loose, documented: { response: D.message }, v1: imp.endImpersonation }); +v1Route({ method: 'post', path: '/me/impersonation/log', tag: 'Admin', summary: 'Record a page viewed while viewing as someone', access: 'user', body: loose, documented: { body: D.obj({ path: D.str }), response: z.null().describe('Always 204, no content') }, v1: imp.logPageView }); // ─── Settings and first-run set-up ─────────────────────────────────────────── -v1Route({ method: 'get', path: '/settings', tag: 'Site', summary: 'Public site settings', description: 'Name, branding, contact details and what\'s switched on.', access: 'public', v1: settings.getSettings }); -v1Route({ method: 'get', path: '/settings/all', tag: 'Site', summary: 'Every setting', description: 'Admins. Secrets are masked.', access: 'admin', v1: settings.getAllSettings }); -v1Route({ method: 'put', path: '/settings', tag: 'Site', summary: 'Change settings', access: 'admin', body: loose, v1: settings.updateSettings }); -v1Route({ method: 'post', path: '/settings/test-smtp', tag: 'Site', summary: 'Send a test email', access: 'admin', body: loose, v1: settings.testSmtp }); -v1Route({ method: 'get', path: '/setup/needed', tag: 'Site', summary: 'Does the site still need setting up?', access: 'public', v1: settings.needsSetup }); -v1Route({ method: 'post', path: '/setup/register', tag: 'Site', summary: 'Create the first admin', description: 'Only while no account exists.', access: 'public', body: loose, v1: settings.setupRegister }); -v1Route({ method: 'post', path: '/setup', tag: 'Site', summary: 'Finish first-run set-up', access: 'admin', body: loose, v1: settings.runSetup }); +v1Route({ method: 'get', path: '/settings', tag: 'Site', summary: 'Public site settings', description: 'Name, branding, contact details and what\'s switched on.', access: 'public', documented: { response: z.record(z.string(), z.string()).describe('Setting key → value: name, logo, colours, contact details, what\'s switched on') }, v1: settings.getSettings }); +v1Route({ method: 'get', path: '/settings/all', tag: 'Site', summary: 'Every setting', description: 'Admins. Secrets are masked.', access: 'admin', documented: { response: z.record(z.string(), z.unknown()).describe('Setting key → value; secrets masked') }, v1: settings.getAllSettings }); +v1Route({ method: 'put', path: '/settings', tag: 'Site', summary: 'Change settings', access: 'admin', body: loose, documented: { body: z.record(z.string(), z.unknown()).describe('Setting key → new value'), response: D.message }, v1: settings.updateSettings }); +v1Route({ method: 'post', path: '/settings/test-smtp', tag: 'Site', summary: 'Send a test email', access: 'admin', body: loose, documented: { body: D.obj({ host: D.optStr, port: D.numeric.optional(), secure: z.union([D.bool, D.str]).optional(), user: D.optStr, pass: D.optStr, from: D.optStr }).describe('Unsaved SMTP details to try (default: the saved ones)'), response: D.message }, v1: settings.testSmtp }); +v1Route({ method: 'get', path: '/setup/needed', tag: 'Site', summary: 'Does the site still need setting up?', access: 'public', documented: { response: D.obj({ needsSetup: D.bool }) }, v1: settings.needsSetup }); +v1Route({ method: 'post', path: '/setup/register', tag: 'Site', summary: 'Create the first admin', description: 'Only while no account exists.', access: 'public', body: loose, documented: { body: D.obj({ adminName: D.str, adminEmail: D.str, adminPassword: D.str.describe('At least 8 characters') }), response: D.obj({ token: D.str, name: D.str, email: D.str }) }, v1: settings.setupRegister }); +v1Route({ method: 'post', path: '/setup', tag: 'Site', summary: 'Finish first-run set-up', access: 'admin', body: loose, documented: { body: D.obj({ settings: z.record(z.string(), z.unknown()).describe('Setting key → value') }), response: D.message }, v1: settings.runSetup }); // ─── Hub ───────────────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/hub/status', tag: 'Site', summary: 'The connection to the provider\'s Hub', access: 'admin', v1: hub.getStatus }); -v1Route({ method: 'post', path: '/hub/connect', tag: 'Site', summary: 'Connect to the Hub', access: 'admin', body: loose, v1: hub.connect }); -v1Route({ method: 'post', path: '/hub/heartbeat', tag: 'Site', summary: 'Check in with the Hub now', access: 'admin', body: loose, v1: hub.heartbeatNow }); -v1Route({ method: 'post', path: '/hub/update-request', tag: 'Site', summary: 'Ask for the update to be installed', access: 'admin', body: loose, v1: hub.requestUpdate }); -v1Route({ method: 'post', path: '/hub/update-request/cancel', tag: 'Site', summary: 'Withdraw the update request', access: 'admin', body: loose, v1: hub.cancelUpdateRequest }); -v1Route({ method: 'post', path: '/hub/update-snooze', tag: 'Site', summary: 'Remind me about the update later', access: 'admin', body: loose, v1: hub.snoozeUpdate }); +v1Route({ method: 'get', path: '/hub/status', tag: 'Site', summary: 'The connection to the provider\'s Hub', access: 'admin', documented: { response: hubStatus }, v1: hub.getStatus }); +v1Route({ method: 'post', path: '/hub/connect', tag: 'Site', summary: 'Connect to the Hub', access: 'admin', body: loose, documented: { body: D.obj({ licenceKey: D.str }), response: hubStatus }, v1: hub.connect }); +v1Route({ method: 'post', path: '/hub/heartbeat', tag: 'Site', summary: 'Check in with the Hub now', access: 'admin', body: loose, documented: { response: hubStatus }, v1: hub.heartbeatNow }); +v1Route({ method: 'post', path: '/hub/update-request', tag: 'Site', summary: 'Ask for the update to be installed', access: 'admin', body: loose, documented: { response: hubStatus }, v1: hub.requestUpdate }); +v1Route({ method: 'post', path: '/hub/update-request/cancel', tag: 'Site', summary: 'Withdraw the update request', access: 'admin', body: loose, documented: { response: hubStatus }, v1: hub.cancelUpdateRequest }); +v1Route({ method: 'post', path: '/hub/update-snooze', tag: 'Site', summary: 'Remind me about the update later', access: 'admin', body: loose, documented: { body: D.obj({ snooze: D.optBool.describe('false: stop putting it off') }), response: hubStatus }, v1: hub.snoozeUpdate }); v1Route({ method: 'get', path: '/hub/notices', tag: 'Site', summary: 'Notices from the provider', - access: 'supervisor', campusScope: 'campusIndependent (notices from the provider are for the whole site)', middleware: [campusIndependent('notices from the provider are for the whole site')], v1: hub.getNotices, + access: 'supervisor', campusScope: 'campusIndependent (notices from the provider are for the whole site)', middleware: [campusIndependent('notices from the provider are for the whole site')], documented: { response: z.array(D.obj({ id: D.str, level: D.str.describe('info, warning, critical'), title: D.str, message: D.str, startsAt: D.optDate, endsAt: D.optDate, updatedAt: D.optDate })) }, v1: hub.getNotices, }); // ─── Outbound webhooks ─────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/outbound-webhooks', tag: 'Webhooks', summary: 'Webhooks the site sends', access: 'admin', v1: hooks.list }); -v1Route({ method: 'post', path: '/outbound-webhooks', tag: 'Webhooks', summary: 'Add a webhook', description: 'Answers its signing secret once.', access: 'admin', status: 201, body: loose, v1: hooks.create }); -v1Route({ method: 'post', path: '/outbound-webhook-deliveries/:id/resend', tag: 'Webhooks', summary: 'Send a delivery again', access: 'admin', params: idParams, body: loose, v1: hooks.resend }); -v1Route({ method: 'patch', path: '/outbound-webhooks/:id', tag: 'Webhooks', summary: 'Change a webhook', access: 'admin', params: idParams, body: loose, v1: hooks.update }); -v1Route({ method: 'delete', path: '/outbound-webhooks/:id', tag: 'Webhooks', summary: 'Remove a webhook', access: 'admin', params: idParams, v1: hooks.remove }); -v1Route({ method: 'post', path: '/outbound-webhooks/:id/rotate-secret', tag: 'Webhooks', summary: 'Give a webhook a new signing secret', access: 'admin', params: idParams, body: loose, v1: hooks.rotateSecret }); -v1Route({ method: 'post', path: '/outbound-webhooks/:id/test', tag: 'Webhooks', summary: 'Send a test delivery', access: 'admin', params: idParams, body: loose, v1: hooks.test }); -v1Route({ method: 'get', path: '/outbound-webhooks/:id/deliveries', tag: 'Webhooks', summary: 'A webhook\'s recent deliveries', access: 'admin', params: idParams, query: filters('page', 'limit'), v1: hooks.deliveries }); +v1Route({ method: 'get', path: '/outbound-webhooks', tag: 'Webhooks', summary: 'Webhooks the site sends', access: 'admin', documented: { response: D.obj({ eventTypes: z.array(D.anyObj).describe('Every event type, with an example body'), keepDays: D.num.describe('How long deliveries are kept'), endpoints: z.array(webhook.extend({ lastWeek: z.record(z.string(), z.number()).describe('Status → deliveries in the last 7 days') })) }) }, v1: hooks.list }); +v1Route({ method: 'post', path: '/outbound-webhooks', tag: 'Webhooks', summary: 'Add a webhook', description: 'Answers its signing secret once.', access: 'admin', status: 201, body: loose, documented: { body: D.obj({ name: D.str, url: D.str.describe('https:// address'), events: z.array(D.str) }), response: webhook.extend({ secret: D.str.describe('For checking signatures — shown only now') }) }, v1: hooks.create }); +v1Route({ method: 'post', path: '/outbound-webhook-deliveries/:id/resend', tag: 'Webhooks', summary: 'Send a delivery again', access: 'admin', params: idParams, body: loose, documented: { response: delivered }, v1: hooks.resend }); +v1Route({ method: 'patch', path: '/outbound-webhooks/:id', tag: 'Webhooks', summary: 'Change a webhook', access: 'admin', params: idParams, body: loose, documented: { body: D.obj({ name: D.optStr, url: D.optStr, events: z.array(D.str).optional(), isActive: D.optBool }), response: webhook }, v1: hooks.update }); +v1Route({ method: 'delete', path: '/outbound-webhooks/:id', tag: 'Webhooks', summary: 'Remove a webhook', access: 'admin', params: idParams, documented: { response: D.ok }, v1: hooks.remove }); +v1Route({ method: 'post', path: '/outbound-webhooks/:id/rotate-secret', tag: 'Webhooks', summary: 'Give a webhook a new signing secret', access: 'admin', params: idParams, body: loose, documented: { response: D.obj({ secret: D.str.describe('Shown only now; the old one stops working') }) }, v1: hooks.rotateSecret }); +v1Route({ method: 'post', path: '/outbound-webhooks/:id/test', tag: 'Webhooks', summary: 'Send a test delivery', access: 'admin', params: idParams, body: loose, documented: { response: delivered }, v1: hooks.test }); +v1Route({ method: 'get', path: '/outbound-webhooks/:id/deliveries', tag: 'Webhooks', summary: 'A webhook\'s recent deliveries', access: 'admin', params: idParams, query: filters('page', 'limit', 'status', 'before'), documented: { response: z.array(D.obj({ id: D.str, eventId: D.str, type: D.str.describe('The event type'), payload: z.unknown(), status: D.str.describe('pending, sending, retrying, succeeded, failed'), attempts: D.num, nextAttemptAt: D.optDate, lastStatusCode: D.optNum, lastError: D.optStr, createdAt: D.date, deliveredAt: D.optDate })) }, v1: hooks.deliveries }); // ─── Backups ───────────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/backups', tag: 'Admin', summary: 'Database backups', access: 'admin', v1: backups.getBackups }); -v1Route({ method: 'post', path: '/backups/run', tag: 'Admin', summary: 'Back up the database now', access: 'admin', body: loose, v1: backups.triggerBackup }); +v1Route({ method: 'get', path: '/backups', tag: 'Admin', summary: 'Database backups', access: 'admin', documented: { response: z.array(D.obj({ filename: D.str, size: D.num.describe('Bytes'), createdAt: D.date })) }, v1: backups.getBackups }); +v1Route({ method: 'post', path: '/backups/run', tag: 'Admin', summary: 'Back up the database now', access: 'admin', body: loose, documented: { response: D.anyObj.describe('The backup made') }, v1: backups.triggerBackup }); v1Route({ method: 'get', path: '/backups/:filename/download', tag: 'Admin', summary: 'Download a backup', access: 'admin', params: z.object({ filename: z.string().min(1).max(200) }), file: { contentType: 'application/octet-stream' }, v1: backups.downloadBackup }); // ─── Yoco and PayFast settings (admins; their incoming webhooks are separate) ─ const yoco = require('../../controllers/yocoController'); const payfast = require('../../controllers/payfastController'); -v1Route({ method: 'get', path: '/payments/yoco/config', tag: 'Payments', summary: 'Yoco settings', description: 'Keys are masked.', access: 'admin', v1: yoco.getConfig }); -v1Route({ method: 'put', path: '/payments/yoco/config', tag: 'Payments', summary: 'Change Yoco settings', access: 'admin', body: loose, v1: yoco.updateConfig }); -v1Route({ method: 'get', path: '/payments/yoco/webhooks', tag: 'Payments', summary: 'Webhooks registered with Yoco', access: 'admin', v1: yoco.getWebhooks }); -v1Route({ method: 'post', path: '/payments/yoco/webhooks', tag: 'Payments', summary: 'Register a webhook with Yoco', access: 'admin', body: loose, v1: yoco.createWebhook }); -v1Route({ method: 'delete', path: '/payments/yoco/webhooks/:id', tag: 'Payments', summary: 'Remove a webhook from Yoco', access: 'admin', params: z.object({ id: z.string().min(1).max(200) }), v1: yoco.removeWebhook }); -v1Route({ method: 'get', path: '/payments/payfast/config', tag: 'Payments', summary: 'PayFast settings', description: 'The passphrase is masked.', access: 'admin', v1: payfast.getConfig }); -v1Route({ method: 'put', path: '/payments/payfast/config', tag: 'Payments', summary: 'Change PayFast settings', access: 'admin', body: loose, v1: payfast.updateConfig }); -v1Route({ method: 'post', path: '/payments/payfast/test', tag: 'Payments', summary: 'Check the PayFast details work', access: 'admin', body: loose, v1: payfast.testConnection }); +v1Route({ method: 'get', path: '/payments/yoco/config', tag: 'Payments', summary: 'Yoco settings', description: 'Keys are masked.', access: 'admin', documented: { response: D.obj({ secretKeyMasked: D.str, secretKeySource: D.optStr.describe('settings or env'), mode: D.optStr.describe('test or live'), webhookSecretMasked: D.str, webhookSecretSource: D.optStr, webhookId: D.str, webhookUrl: D.str, configured: D.bool }) }, v1: yoco.getConfig }); +v1Route({ method: 'put', path: '/payments/yoco/config', tag: 'Payments', summary: 'Change Yoco settings', access: 'admin', body: loose, documented: { body: D.obj({ secretKey: D.optStr.describe('sk_test_… or sk_live_…'), webhookSecret: D.optStr.describe('whsec_…') }), response: D.message }, v1: yoco.updateConfig }); +v1Route({ method: 'get', path: '/payments/yoco/webhooks', tag: 'Payments', summary: 'Webhooks registered with Yoco', access: 'admin', documented: { response: D.obj({ webhooks: z.array(D.obj({ id: D.str, name: D.optStr, url: D.str, mode: D.optStr, isActive: D.bool, pointsHere: D.bool })), defaultUrl: D.str }) }, v1: yoco.getWebhooks }); +v1Route({ method: 'post', path: '/payments/yoco/webhooks', tag: 'Payments', summary: 'Register a webhook with Yoco', access: 'admin', body: loose, documented: { body: D.obj({ name: D.optStr, url: D.optStr.describe('Default: this site\'s webhook address') }), response: D.obj({ message: D.str, webhook: D.obj({ id: D.str, name: D.optStr, url: D.str, mode: D.optStr }), webhookSecretMasked: D.str }) }, v1: yoco.createWebhook }); +v1Route({ method: 'delete', path: '/payments/yoco/webhooks/:id', tag: 'Payments', summary: 'Remove a webhook from Yoco', access: 'admin', params: z.object({ id: z.string().min(1).max(200) }), documented: { response: D.obj({ message: D.str, clearedSecret: D.bool }) }, v1: yoco.removeWebhook }); +v1Route({ method: 'get', path: '/payments/payfast/config', tag: 'Payments', summary: 'PayFast settings', description: 'The passphrase is masked.', access: 'admin', documented: { response: D.obj({ merchantId: D.str, merchantKey: D.str, passphraseMasked: D.str, hasPassphrase: D.bool, mode: z.enum(['sandbox', 'live']), notifyUrl: D.str, notifyUrlProblem: D.optStr.describe('Why PayFast couldn\'t reach it'), configured: D.bool }) }, v1: payfast.getConfig }); +v1Route({ method: 'put', path: '/payments/payfast/config', tag: 'Payments', summary: 'Change PayFast settings', access: 'admin', body: loose, documented: { body: D.obj({ merchantId: D.optStr, merchantKey: D.optStr, passphrase: D.optStr.describe('At most 32 characters'), mode: z.enum(['sandbox', 'live']).optional() }), response: D.message }, v1: payfast.updateConfig }); +v1Route({ method: 'post', path: '/payments/payfast/test', tag: 'Payments', summary: 'Check the PayFast details work', access: 'admin', body: loose, documented: { response: D.message }, v1: payfast.testConnection }); diff --git a/apps/events/backend/src/v2/resources/attendance.ts b/apps/events/backend/src/v2/resources/attendance.ts index c1fbdf0..7415c71 100644 --- a/apps/events/backend/src/v2/resources/attendance.ts +++ b/apps/events/backend/src/v2/resources/attendance.ts @@ -7,6 +7,7 @@ import { z } from 'zod'; import { id, idParams } from '../schemas'; import { v1Route } from '../viaV1'; +import * as D from '../docs'; /* eslint-disable @typescript-eslint/no-explicit-any -- v1 handlers and middleware are JavaScript */ const cs = require('../../utils/campusScope') as { @@ -25,114 +26,148 @@ const asEvent = (ctx: any) => ({ params: { ...ctx.req.params, eventId: ctx.param const loose = z.looseObject({}); const tokenParams = z.object({ token: z.string().min(1).max(200) }); const SCOPE_LIST = 'scopeList (the handler filters by listWhere)'; + +// ─── Documented shapes (docs.ts) ───────────────────────────────────────────── + +const usage = D.obj({ id: D.str.optional(), scannedAt: D.date, quantityRedeemed: D.num, sessionId: D.optStr, manual: D.optBool.describe('Ticked present by hand') }); +const ticketFull = D.ticket.extend({ + usages: z.array(usage).optional().describe('Check-ins'), + event: D.event.partial().nullish(), + user: D.userSummary.nullish().describe('The payer'), + attendee: D.obj({ name: D.str }).nullish(), + registrationOption: D.obj({ eventOption: D.eventOption.partial().nullish(), variant: D.obj({ name: D.str }).nullish(), registration: D.registration.partial().nullish() }).nullish(), +}); +const sent = D.obj({ message: D.str, ticketIds: D.ids.optional().describe('The tickets sent') }); +const lockView = D.obj({ + id: D.str, eventId: D.str, sectionId: D.optStr, sectionName: D.optStr, deviceId: D.str, deviceName: D.optStr, + user: D.userRef.nullish().describe('Who holds it'), lockedAt: D.date, snapshotAt: D.optDate, lastSyncAt: D.optDate, releasedAt: D.optDate, +}); +const transferInput = D.obj({ + name: D.str.describe('Who it goes to'), email: D.optStr, phone: D.optStr.describe('Email or phone needed'), + dateOfBirth: D.optDate.describe('Youth events'), gender: D.optStr, parentName: D.optStr, parentEmail: D.optStr, parentPhone: D.optStr, +}); +const certificate = D.obj({ id: D.str, code: D.str.describe('For checking it at /verify'), name: D.str, issuedAt: D.date, sessionsAttended: D.optNum, totalSessions: D.optNum, event: D.eventRef.partial().nullish() }); +const registerRow = D.obj({ + ticketId: D.str, bookedSessions: D.ids.nullable().describe('Picked/ticked sessions (null: all)'), sessionTickets: z.record(z.string(), z.string()).nullable(), + name: D.str, bookedBy: D.str, email: D.str, phone: D.str, option: D.str, variant: D.optStr, quantity: D.num, + checkIns: z.record(z.string(), z.number()).describe('Session id (or `event`) → people checked in'), + attended: D.num, total: D.num, completed: D.bool.describe('Meets the certificate rule'), certificate: D.anyObj.nullish(), +}); +const groupInput = D.obj({ + name: D.optStr, capacity: D.numeric.nullish(), gender: z.enum(['male', 'female', 'mixed']).nullish(), leaderUserId: D.optStr.describe('A staff member'), + minAge: D.numeric.nullish(), maxAge: D.numeric.nullish(), ratio: D.numeric.nullish().describe('Children per leader'), +}); +const group = D.obj({ id: D.str, setId: D.str, name: D.str, capacity: D.optNum, gender: D.optStr, leaderUserId: D.optStr, minAge: D.optNum, maxAge: D.optNum, ratio: D.optNum, order: D.num }); +const allocationSet = D.obj({ id: D.str, eventId: D.str, name: D.str, showOnTicket: D.bool, order: D.num }); +const member = D.obj({ attendeeId: D.str.optional(), name: D.str, gender: D.optStr, dateOfBirth: D.optDate, groupId: D.optStr }); const ticketOwner = cs.scopeEvent({ resolve: 'ticket', ownerOk: true }); const qrScope = cs.scopeEvent({ resolve: 'ticketQr', from: (req: any) => req.params.qrCode, nameCampus: true }); // ─── Tickets ───────────────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/me/tickets', tag: 'Tickets', summary: 'My tickets', description: 'Including ones transferred to me.', access: 'user', v1: t.getUserTickets }); +v1Route({ method: 'get', path: '/me/tickets', tag: 'Tickets', summary: 'My tickets', description: 'Including ones transferred to me.', access: 'user', documented: { response: z.array(ticketFull) }, v1: t.getUserTickets }); v1Route({ method: 'post', path: '/me/tickets/email', tag: 'Tickets', summary: 'Send me my tickets', description: 'For a registration (`registrationId`) or chosen tickets (`ticketIds`), by email and/or WhatsApp (`channel`).', - access: 'user', body: z.looseObject({ registrationId: id.optional(), ticketIds: z.array(id).max(500).optional(), channel: z.string().max(20).optional() }), v1: t.emailTickets, + access: 'user', body: z.looseObject({ registrationId: id.optional(), ticketIds: z.array(id).max(500).optional(), channel: z.string().max(20).optional() }), documented: { response: sent }, v1: t.emailTickets, }); v1Route({ - method: 'get', path: '/tickets/scans/recent', tag: 'Tickets', summary: 'Recent scans', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'limit'), v1: t.getRecentScans, + method: 'get', path: '/tickets/scans/recent', tag: 'Tickets', summary: 'Recent scans', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'limit'), documented: { response: z.array(D.obj({ id: D.str, scannedAt: D.date, quantityRedeemed: D.num, scannedBy: D.userRef.nullish(), ticket: D.obj({ id: D.str, event: D.obj({ title: D.str }), registrationOption: D.anyObj.nullish() }) })) }, v1: t.getRecentScans, }); v1Route({ - method: 'get', path: '/tickets/scans/stats', tag: 'Tickets', summary: 'Scan counts', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId'), v1: t.getScanStats, + method: 'get', path: '/tickets/scans/stats', tag: 'Tickets', summary: 'Scan counts', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId'), documented: { response: D.obj({ totalToday: D.num, myToday: D.num, lastHour: D.num, byStaff: z.array(D.obj({ scannedById: D.str, name: D.str, count: D.num })) }) }, v1: t.getScanStats, }); v1Route({ method: 'post', path: '/tickets/send', tag: 'Tickets', summary: 'Send tickets to someone', description: 'Staff: a registration\'s tickets (or chosen ones) to an email address or phone number.', - access: 'staff', campusScope: 'scopeBody(registrationId, ticketIds)', middleware: [cs.scopeBody([['registrationId', 'registration'], ['ticketIds', 'ticket']])], body: loose, v1: t.sendTicketsTo, + access: 'staff', campusScope: 'scopeBody(registrationId, ticketIds)', middleware: [cs.scopeBody([['registrationId', 'registration'], ['ticketIds', 'ticket']])], body: loose, documented: { body: D.obj({ registrationId: D.optStr, ticketIds: D.ids.optional().describe('Or registrationId'), channel: D.channel, overrideEmail: D.optStr.describe('Send here instead'), overridePhone: D.optStr }), response: sent }, v1: t.sendTicketsTo, }); v1Route({ method: 'post', path: '/tickets/generate', tag: 'Tickets', summary: 'Issue a registration\'s tickets', - access: 'supervisor', campusScope: 'scopeBody(registrationId)', middleware: [cs.scopeBody([['registrationId', 'registration']])], body: z.looseObject({ registrationId: id }), v1: t.generateTickets, + access: 'supervisor', campusScope: 'scopeBody(registrationId)', middleware: [cs.scopeBody([['registrationId', 'registration']])], body: z.looseObject({ registrationId: id }), documented: { response: D.obj({ message: D.str, tickets: z.array(ticketFull) }) }, v1: t.generateTickets, }); v1Route({ - method: 'post', path: '/tickets/email-sent', tag: 'Tickets', summary: 'Mark tickets as emailed', access: 'admin', body: loose, v1: t.markTicketsAsEmailSent, + method: 'post', path: '/tickets/email-sent', tag: 'Tickets', summary: 'Mark tickets as emailed', access: 'admin', body: loose, documented: { body: D.obj({ ticketIds: D.ids }), response: D.message }, v1: t.markTicketsAsEmailSent, }); v1Route({ - method: 'get', path: '/tickets', tag: 'Tickets', summary: 'Every ticket', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'page', 'limit'), v1: t.getTickets, + method: 'get', path: '/tickets', tag: 'Tickets', summary: 'Every ticket', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'page', 'limit'), documented: { response: D.v1Page(ticketFull) }, v1: t.getTickets, }); v1Route({ method: 'get', path: '/tickets/qr/:qrCode', tag: 'Tickets', summary: 'The ticket for a QR code', description: 'Without checking it in (that\'s POST /checkin/{qrCode}).', - access: 'staff', campusScope: 'scopeEvent(ticketQr)', middleware: [qrScope], params: z.object({ qrCode: z.string().min(1).max(200) }), v1: t.getTicketByQrCode, + access: 'staff', campusScope: 'scopeEvent(ticketQr)', middleware: [qrScope], params: z.object({ qrCode: z.string().min(1).max(200) }), documented: { response: ticketFull }, v1: t.getTicketByQrCode, }); v1Route({ method: 'get', path: '/events/:id/tickets', tag: 'Tickets', summary: 'An event\'s tickets', - access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: t.getTicketsByEvent, + access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: z.array(ticketFull) }, v1: t.getTicketsByEvent, }); v1Route({ method: 'get', path: '/ticket-transfers/:token', tag: 'Tickets', summary: 'A ticket someone is giving you', - description: 'What the transfer link shows (the token is the credential).', access: 'public', params: tokenParams, v1: t.getTransferOffer, + description: 'What the transfer link shows (the token is the credential).', access: 'public', params: tokenParams, documented: { response: D.obj({ status: D.str.describe('pending, accepted, declined, cancelled, expired'), toName: D.str, expiresAt: D.date, fromName: D.str, event: D.event.partial(), option: D.str }) }, v1: t.getTransferOffer, }); -v1Route({ method: 'post', path: '/ticket-transfers/:token/accept', tag: 'Tickets', summary: 'Accept a ticket', access: 'public', params: tokenParams, body: loose, v1: t.acceptTransferOffer }); -v1Route({ method: 'post', path: '/ticket-transfers/:token/decline', tag: 'Tickets', summary: 'Decline a ticket', access: 'public', params: tokenParams, body: loose, v1: t.declineTransferOffer }); +v1Route({ method: 'post', path: '/ticket-transfers/:token/accept', tag: 'Tickets', summary: 'Accept a ticket', access: 'public', params: tokenParams, body: loose, documented: { response: D.obj({ message: D.str, ticketId: D.str }) }, v1: t.acceptTransferOffer }); +v1Route({ method: 'post', path: '/ticket-transfers/:token/decline', tag: 'Tickets', summary: 'Decline a ticket', access: 'public', params: tokenParams, body: loose, documented: { response: D.message }, v1: t.declineTransferOffer }); v1Route({ - method: 'get', path: '/tickets/:id', tag: 'Tickets', summary: 'One ticket', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, v1: t.getTicketById, + method: 'get', path: '/tickets/:id', tag: 'Tickets', summary: 'One ticket', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, documented: { response: ticketFull }, v1: t.getTicketById, }); v1Route({ method: 'post', path: '/tickets/:id/transfer', tag: 'Tickets', summary: 'Give a ticket to someone', description: 'Sends them a link to accept it; the ticket is theirs once they do.', - access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, body: loose, v1: t.transferTicketHandler, + access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, body: loose, documented: { body: transferInput, response: D.obj({ message: D.str, requestId: D.str, expiresAt: D.date }) }, v1: t.transferTicketHandler, }); v1Route({ - method: 'delete', path: '/tickets/:id/transfer', tag: 'Tickets', summary: 'Cancel a ticket transfer', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, v1: t.cancelTransferHandler, + method: 'delete', path: '/tickets/:id/transfer', tag: 'Tickets', summary: 'Cancel a ticket transfer', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, documented: { response: D.message }, v1: t.cancelTransferHandler, }); v1Route({ - method: 'get', path: '/tickets/:id/transfers', tag: 'Tickets', summary: 'A ticket\'s transfers', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, v1: t.getTicketTransfers, + method: 'get', path: '/tickets/:id/transfers', tag: 'Tickets', summary: 'A ticket\'s transfers', access: 'user', campusScope: 'scopeEvent(ticket, owner-ok)', middleware: [ticketOwner], params: idParams, documented: { response: z.array(D.obj({ id: D.str, ticketId: D.str, fromUserId: D.optStr, toUserId: D.optStr, createdAt: D.date })) }, v1: t.getTicketTransfers, }); // ─── Scan locks (offline scanning) ─────────────────────────────────────────── v1Route({ method: 'get', path: '/scan-locks', tag: 'Check-in', summary: 'Devices scanning offline for an event', - access: 'staff', campusScope: 'scopeEvent(query.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.query.eventId })], query: z.looseObject({ eventId: id }), v1: locks.listLocks, + access: 'staff', campusScope: 'scopeEvent(query.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.query.eventId })], query: z.looseObject({ eventId: id }), documented: { response: z.array(lockView) }, v1: locks.listLocks, }); v1Route({ method: 'post', path: '/scan-locks', tag: 'Check-in', summary: 'Take tickets offline on this device', description: 'Locks the chosen tickets to this device until it syncs or releases them.', - access: 'staff', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], status: 201, body: z.looseObject({ eventId: id }), v1: locks.createLock, + access: 'staff', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], status: 201, body: z.looseObject({ eventId: id }), documented: { body: D.obj({ eventId: D.str, sectionId: D.optStr.describe('Just this section (default: the whole event)'), deviceId: D.str, deviceName: D.optStr }), response: lockView }, v1: locks.createLock, }); v1Route({ method: 'get', path: '/scan-locks/reports', tag: 'Check-in', summary: 'Offline sync reports to review', - access: 'supervisor', campusScope: 'scopeEvent(query.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.query.eventId })], query: z.looseObject({ eventId: id, unreviewed: z.string().max(10).optional() }), v1: locks.listReports, + access: 'supervisor', campusScope: 'scopeEvent(query.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.query.eventId })], query: z.looseObject({ eventId: id, unreviewed: z.string().max(10).optional() }), documented: { response: z.array(D.obj({ id: D.str, accepted: D.optNum, duplicates: D.optNum, conflicts: z.unknown().optional(), reviewedAt: D.optDate, createdAt: D.date, scanLock: lockView })) }, v1: locks.listReports, }); v1Route({ method: 'post', path: '/scan-locks/reports/:id/review', tag: 'Check-in', summary: 'Mark a sync report reviewed', - access: 'supervisor', campusScope: 'scopeEvent(syncReport)', middleware: [cs.scopeEvent({ resolve: 'syncReport' })], params: idParams, body: loose, v1: locks.reviewReport, + access: 'supervisor', campusScope: 'scopeEvent(syncReport)', middleware: [cs.scopeEvent({ resolve: 'syncReport' })], params: idParams, body: loose, documented: { response: D.obj({ id: D.str, reviewedAt: D.date, reviewedById: D.str }) }, v1: locks.reviewReport, }); v1Route({ method: 'get', path: '/scan-locks/:id/snapshot', tag: 'Check-in', summary: 'The tickets a device took offline', - access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, query: filters('deviceId'), v1: locks.getSnapshot, + access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, query: filters('deviceId'), documented: { response: D.obj({ lock: lockView, snapshotAt: D.date, session: D.obj({ id: D.str, label: D.str }).nullable(), noSessionToday: D.bool, tickets: z.array(D.obj({ id: D.str, qrCode: D.str, holder: D.str, bookedBy: D.str, option: D.str, variant: D.optStr, quantity: D.num, remaining: D.num, consentStatus: D.str })) }) }, v1: locks.getSnapshot, }); v1Route({ method: 'post', path: '/scan-locks/:id/sync', tag: 'Check-in', summary: 'Upload scans made offline', - access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: loose, v1: locks.syncLock, + access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: loose, documented: { body: D.obj({ deviceId: D.str, scans: z.array(D.obj({ clientScanId: D.str.describe('The device\'s id for the scan (repeats are ignored)'), qrCode: D.str, qty: D.numeric.optional(), scannedAt: D.optDate, sessionId: D.optStr })).max(2000) }), response: D.obj({ accepted: D.num, duplicates: D.num, conflicts: z.array(D.anyObj).describe('Scans that clashed with online check-ins'), reportId: D.str, released: D.bool }) }, v1: locks.syncLock, }); v1Route({ method: 'post', path: '/scan-locks/:id/force-release', tag: 'Check-in', summary: 'Release a lost device\'s tickets', - access: 'supervisor', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: loose, v1: locks.forceRelease, + access: 'supervisor', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: loose, documented: { response: D.message }, v1: locks.forceRelease, }); v1Route({ method: 'delete', path: '/scan-locks/:id', tag: 'Check-in', summary: 'Release tickets back online', - access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: z.looseObject({ deviceId: z.string().max(200).optional() }), v1: locks.releaseLock, + access: 'staff', campusScope: 'scopeEvent(scanLock)', middleware: [cs.scopeEvent({ resolve: 'scanLock' })], params: idParams, body: z.looseObject({ deviceId: z.string().max(200).optional() }), documented: { response: D.message }, v1: locks.releaseLock, }); // ─── Attendance and certificates ───────────────────────────────────────────── v1Route({ method: 'get', path: '/certificates/verify/:code', tag: 'Attendance', summary: 'Check a certificate is genuine', - access: 'public', params: z.object({ code: z.string().min(1).max(100) }), v1: att.verifyCertificate, + access: 'public', params: z.object({ code: z.string().min(1).max(100) }), documented: { response: D.obj({ valid: D.bool, revoked: D.optBool, name: D.optStr, event: D.optStr, completedOn: D.optDate, issuedAt: D.optDate }) }, v1: att.verifyCertificate, }); -v1Route({ method: 'get', path: '/me/certificates', tag: 'Me', summary: 'My certificates', access: 'user', v1: att.myCertificates }); +v1Route({ method: 'get', path: '/me/certificates', tag: 'Me', summary: 'My certificates', access: 'user', documented: { response: z.array(certificate) }, v1: att.myCertificates }); v1Route({ method: 'post', path: '/certificates/preview', tag: 'Attendance', summary: 'Preview a certificate template', - access: 'supervisor', campusScope: 'campusIndependent (previews a template from the request body)', middleware: [cs.campusIndependent('previews a certificate template from the request body')], body: loose, file: { contentType: 'application/pdf' }, v1: att.previewCertificate, + access: 'supervisor', campusScope: 'campusIndependent (previews a template from the request body)', middleware: [cs.campusIndependent('previews a certificate template from the request body')], body: loose, file: { contentType: 'application/pdf' }, documented: { body: D.obj({ title: D.optStr.describe('Event title to show'), config: D.obj({ template: D.optStr.describe('classic, modern, elegant, simple'), title: D.optStr, body: D.optStr.describe('{name} and {event} are filled in') }).optional() }) }, v1: att.previewCertificate, }); v1Route({ method: 'get', path: '/certificates/:id/pdf', tag: 'Attendance', summary: 'Download a certificate', @@ -140,11 +175,11 @@ v1Route({ }); v1Route({ method: 'post', path: '/certificates/:id/revoke', tag: 'Attendance', summary: 'Withdraw a certificate', - access: 'supervisor', campusScope: 'scopeEvent(certificate)', middleware: [cs.scopeEvent({ resolve: 'certificate' })], params: idParams, body: loose, v1: att.revokeCertificate, + access: 'supervisor', campusScope: 'scopeEvent(certificate)', middleware: [cs.scopeEvent({ resolve: 'certificate' })], params: idParams, body: loose, documented: { response: D.ok }, v1: att.revokeCertificate, }); v1Route({ method: 'get', path: '/events/:id/attendance', tag: 'Attendance', summary: 'An event\'s attendance register', - access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: att.getRegister, + access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: D.obj({ event: D.event.partial().extend({ certificatesEnabled: D.optBool, certificateConfig: D.anyObj.nullish() }), columns: z.array(D.obj({ id: D.str.describe('Session id, or `event`'), label: D.str })), rows: z.array(registerRow), totals: z.record(z.string(), z.number()) }) }, v1: att.getRegister, }); v1Route({ method: 'get', path: '/events/:id/attendance/export', tag: 'Attendance', summary: 'The register as a file', @@ -153,15 +188,15 @@ v1Route({ }); v1Route({ method: 'post', path: '/events/:id/attendance', tag: 'Attendance', summary: 'Mark attendance', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, v1: att.markAttendance, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ ticketId: D.str, sessionId: D.str.describe('A session id, or `event` on a single-date event'), present: D.bool }), response: D.ok }, v1: att.markAttendance, }); v1Route({ method: 'post', path: '/events/:id/certificates', tag: 'Attendance', summary: 'Issue certificates', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, v1: att.issueCertificates, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ ticketId: D.optStr.describe('Just this person (default: everyone who qualifies)') }), response: D.obj({ issued: D.num }) }, v1: att.issueCertificates, }); v1Route({ method: 'post', path: '/events/:id/certificates/send', tag: 'Attendance', summary: 'Send certificates', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, v1: att.sendCertificatesHandler, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ certificateId: D.optStr.describe('Just this one (default: every one not sent yet)') }), response: D.obj({ sent: D.num, skipped: D.num }) }, v1: att.sendCertificatesHandler, }); v1Route({ method: 'get', path: '/events/:id/certificates.pdf', tag: 'Attendance', summary: 'Every certificate for an event, as one PDF', @@ -172,24 +207,24 @@ v1Route({ v1Route({ method: 'get', path: '/me/allocation-groups', tag: 'Allocations', summary: 'Groups I lead', - access: 'staff', campusScope: 'campusIndependent (only the groups the signed-in person leads)', middleware: [cs.campusIndependent('only the groups the signed-in person leads')], v1: alloc.getMyGroups, + access: 'staff', campusScope: 'campusIndependent (only the groups the signed-in person leads)', middleware: [cs.campusIndependent('only the groups the signed-in person leads')], documented: { response: D.obj({ medicalShown: D.bool, groups: z.array(D.obj({ id: D.str, name: D.str, capacity: D.optNum, gender: D.optStr, setName: D.str, event: D.eventRef.partial(), members: z.array(member) })) }) }, v1: alloc.getMyGroups, }); v1Route({ method: 'get', path: '/events/:id/allocations', tag: 'Allocations', summary: 'An event\'s allocation board', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: alloc.getBoard, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: D.obj({ event: D.anyObj, sets: z.array(allocationSet.extend({ groups: z.array(group), assignments: z.array(D.obj({ attendeeId: D.str, groupId: D.str })) })), attendees: z.array(D.obj({ id: D.str, name: D.str, gender: D.optStr, dateOfBirth: D.optDate, registrationId: D.str, bookedBy: D.str })), leaders: z.array(D.userRef), unnamedPlaces: D.num.describe('Places with no name yet') }) }, v1: alloc.getBoard, }); v1Route({ method: 'post', path: '/allocation-sets', tag: 'Allocations', summary: 'Start a set of groups', - access: 'supervisor', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], status: 201, body: z.looseObject({ eventId: id }), v1: alloc.createSet, + access: 'supervisor', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], status: 201, body: z.looseObject({ eventId: id }), documented: { body: D.obj({ eventId: D.str, name: D.str.describe('e.g. Cabins, Buses'), showOnTicket: D.optBool }), response: allocationSet }, v1: alloc.createSet, }); const setScope = cs.scopeEvent({ resolve: 'allocationSet' }); const groupScope = cs.scopeEvent({ resolve: 'allocationGroup' }); -v1Route({ method: 'patch', path: '/allocation-sets/:id', tag: 'Allocations', summary: 'Change a set', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, v1: alloc.updateSet }); -v1Route({ method: 'delete', path: '/allocation-sets/:id', tag: 'Allocations', summary: 'Delete a set', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, v1: alloc.deleteSet }); -v1Route({ method: 'get', path: '/allocation-sets/:id/lists', tag: 'Allocations', summary: 'A set\'s lists (who is in each group)', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, query: filters('medical'), v1: alloc.getSetLists }); -v1Route({ method: 'post', path: '/allocation-sets/:id/groups', tag: 'Allocations', summary: 'Add a group', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], status: 201, params: idParams, body: loose, v1: alloc.createGroup }); -v1Route({ method: 'put', path: '/allocation-sets/:id/assignments', tag: 'Allocations', summary: 'Put people in groups', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, v1: alloc.assign }); -v1Route({ method: 'delete', path: '/allocation-sets/:id/assignments', tag: 'Allocations', summary: 'Empty every group', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, v1: alloc.clearAssignments }); -v1Route({ method: 'post', path: '/allocation-sets/:id/auto', tag: 'Allocations', summary: 'Fill the groups automatically', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, v1: alloc.autoAssign }); -v1Route({ method: 'patch', path: '/allocation-groups/:id', tag: 'Allocations', summary: 'Change a group', access: 'supervisor', campusScope: 'scopeEvent(allocationGroup)', middleware: [groupScope], params: idParams, body: loose, v1: alloc.updateGroup }); -v1Route({ method: 'delete', path: '/allocation-groups/:id', tag: 'Allocations', summary: 'Delete a group', access: 'supervisor', campusScope: 'scopeEvent(allocationGroup)', middleware: [groupScope], params: idParams, v1: alloc.deleteGroup }); +v1Route({ method: 'patch', path: '/allocation-sets/:id', tag: 'Allocations', summary: 'Change a set', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, documented: { body: D.obj({ name: D.optStr, showOnTicket: D.optBool }), response: allocationSet }, v1: alloc.updateSet }); +v1Route({ method: 'delete', path: '/allocation-sets/:id', tag: 'Allocations', summary: 'Delete a set', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, documented: { response: D.message }, v1: alloc.deleteSet }); +v1Route({ method: 'get', path: '/allocation-sets/:id/lists', tag: 'Allocations', summary: 'A set\'s lists (who is in each group)', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, query: filters('medical'), documented: { response: D.obj({ set: D.obj({ id: D.str, name: D.str }), event: D.anyObj, groups: z.array(D.obj({ id: D.str, name: D.str, capacity: D.optNum, gender: D.optStr, leader: D.optStr, members: z.array(member) })) }) }, v1: alloc.getSetLists }); +v1Route({ method: 'post', path: '/allocation-sets/:id/groups', tag: 'Allocations', summary: 'Add a group', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], status: 201, params: idParams, body: loose, documented: { body: groupInput, response: group }, v1: alloc.createGroup }); +v1Route({ method: 'put', path: '/allocation-sets/:id/assignments', tag: 'Allocations', summary: 'Put people in groups', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, documented: { body: D.obj({ attendeeId: D.str, groupId: D.optStr.describe('null takes them out') }), response: D.message }, v1: alloc.assign }); +v1Route({ method: 'delete', path: '/allocation-sets/:id/assignments', tag: 'Allocations', summary: 'Empty every group', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, documented: { response: D.message }, v1: alloc.clearAssignments }); +v1Route({ method: 'post', path: '/allocation-sets/:id/auto', tag: 'Allocations', summary: 'Fill the groups automatically', access: 'supervisor', campusScope: 'scopeEvent(allocationSet)', middleware: [setScope], params: idParams, body: loose, documented: { body: D.obj({ mode: z.enum(['together', 'split']).optional().describe('Keep each booking together, or spread them') }), response: D.obj({ placed: D.num, unplaced: D.num, message: D.str }) }, v1: alloc.autoAssign }); +v1Route({ method: 'patch', path: '/allocation-groups/:id', tag: 'Allocations', summary: 'Change a group', access: 'supervisor', campusScope: 'scopeEvent(allocationGroup)', middleware: [groupScope], params: idParams, body: loose, documented: { body: groupInput, response: group }, v1: alloc.updateGroup }); +v1Route({ method: 'delete', path: '/allocation-groups/:id', tag: 'Allocations', summary: 'Delete a group', access: 'supervisor', campusScope: 'scopeEvent(allocationGroup)', middleware: [groupScope], params: idParams, documented: { response: D.message }, v1: alloc.deleteGroup }); diff --git a/apps/events/backend/src/v2/resources/eventsManage.ts b/apps/events/backend/src/v2/resources/eventsManage.ts index 7c0e2b0..5f045b6 100644 --- a/apps/events/backend/src/v2/resources/eventsManage.ts +++ b/apps/events/backend/src/v2/resources/eventsManage.ts @@ -1,4 +1,5 @@ import { z } from 'zod'; +import * as D from '../docs'; import type { Request } from 'express'; import { defineRoute, type ApiUser } from '../route'; import { single } from '../paging'; @@ -148,6 +149,7 @@ export const copyFrom = defineRoute({ middleware: [campusScope.scopeEvent({ need: 'manage' }), campusScope.scopeBody([['fromEventId', 'event']])], params: idParams, body: z.object({ fromEventId: id }), + documented: { response: D.obj({ sets: D.num.describe('Allocation sets copied'), groups: D.num.describe('Groups copied'), costs: D.num.describe('Costs copied (admins)') }) }, response: single(z.looseObject({})), async handler({ params, body, user }) { return { data: JSON.parse(JSON.stringify(await copySetupFrom(params.id, body.fromEventId, actorOf(user)) ?? {})) }; diff --git a/apps/events/backend/src/v2/resources/kidsVolunteers.ts b/apps/events/backend/src/v2/resources/kidsVolunteers.ts index 55aa732..e54953f 100644 --- a/apps/events/backend/src/v2/resources/kidsVolunteers.ts +++ b/apps/events/backend/src/v2/resources/kidsVolunteers.ts @@ -5,6 +5,7 @@ import { z } from 'zod'; import { id, idParams } from '../schemas'; import { v1Route } from '../viaV1'; +import * as D from '../docs'; /* eslint-disable @typescript-eslint/no-explicit-any -- v1 handlers and middleware are JavaScript */ const cs = require('../../utils/campusScope') as { @@ -22,71 +23,119 @@ const SCOPE_LIST = 'scopeList (the handler filters by listWhere)'; const view = { campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()] }; const manage = { campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })] }; +// ─── Documented shapes (docs.ts) ───────────────────────────────────────────── + +const child = D.obj({ + id: D.str, firstName: D.str, lastName: D.str, name: D.str, dateOfBirth: D.optDate, age: D.optNum, gender: D.optStr, + allergies: D.optStr, hasMedical: D.bool, hasCustody: D.bool.describe('There are custody notes'), + medicalNotes: D.optStr.describe('Only where notes may be shown'), custodyNotes: D.optStr, lastCheckInAt: D.optDate, +}); +const childInput = D.obj({ + firstName: D.str, lastName: D.optStr, dateOfBirth: D.optDate, gender: D.optStr.describe('male or female (anything else: not given)'), + allergies: D.optStr, medicalNotes: D.optStr, custodyNotes: D.optStr.describe('Kept encrypted, like the medical notes'), +}); +const adultInput = D.obj({ name: D.str, phone: D.optStr, relationship: D.optStr }); +const adult = adultInput.extend({ id: D.str }); +const family = D.obj({ + id: D.str, name: D.str, + parents: z.array(D.obj({ userId: D.str, name: D.str, phone: D.optStr, email: D.optStr })), + children: z.array(child), adults: z.array(adult).describe('Others who may collect the children'), +}); +const myFamily = D.obj({ + family: family.nullable(), qrToken: D.optStr.describe('The family QR code (shown at the desk)'), + codes: z.array(D.anyObj).describe('Collection codes for children checked in now'), pages: z.array(D.anyObj).describe('Recent "come to the room" messages'), +}); +const parentInput = D.obj({ name: D.str, email: D.optStr, phone: D.optStr.describe('Email or phone needed: the collection code is sent there') }); +const room = D.obj({ id: D.str, name: D.str, minAge: D.optNum, maxAge: D.optNum, capacity: D.optNum, ratio: D.optNum, order: D.optNum, leaderNames: z.array(D.str).optional(), leaderIds: D.ids.optional() }); +const board = D.obj({ + event: D.anyObj, occasion: D.str.describe('The day or session it\'s for'), sessionId: D.optStr, sessionLabel: D.optStr, + rooms: z.array(room), checkIns: z.array(D.anyObj).describe('Children checked in, with room and code'), +}); +const roleShift = D.obj({ startsAt: D.date, endsAt: D.date, text: D.str, hours: D.num }); +const role = D.obj({ + id: D.str, eventId: D.str, sessionId: D.optStr, sessionLabel: D.optStr, name: D.str, description: D.str, + startsAt: D.optDate, endsAt: D.optDate, shift: roleShift, kidsRoom: D.anyObj.nullish(), order: D.num, past: D.bool, + needed: D.optNum, filled: D.optNum, + mine: D.obj({ slotId: D.str, checkedInAt: D.optDate, swapId: D.optStr }).nullable().describe('My place in it'), + coverNeeded: z.array(D.obj({ swapId: D.str, note: D.str })), + volunteers: z.array(D.obj({ slotId: D.str, userId: D.str, name: D.str, phone: D.optStr, email: D.optStr, assignedBy: D.optStr, checkedInAt: D.optDate, checkedInBy: D.optStr, checkInMethod: D.optStr, swapOpen: D.bool, hasTicket: D.bool })).optional().describe('Staff only'), +}); +const roster = D.obj({ + event: D.anyObj, sessions: z.array(D.obj({ id: D.str, label: D.str, startsAt: D.date, endsAt: D.date })), roles: z.array(role), + totals: D.obj({ needed: D.optNum, filled: D.optNum, fillRate: D.optNum.describe('%') }), +}); +const roleInput = D.obj({ + name: D.str, description: D.optStr, sessionId: D.optStr.describe('A multi-day event: the session'), startsAt: D.optDate, endsAt: D.optDate.describe('Default: the event\'s or session\'s times'), + needed: D.numeric.nullish().describe('How many people'), kidsRoomId: D.optStr.describe('Serving in a kids room: counts as a leader on duty'), order: D.numeric.optional(), +}); +const roleRecord = D.obj({ id: D.str, eventId: D.str, name: D.str, description: D.optStr, sessionId: D.optStr, startsAt: D.optDate, endsAt: D.optDate, needed: D.optNum, kidsRoomId: D.optStr, order: D.num }); +const signedUp = D.obj({ slotId: D.str, ticket: D.bool.describe('A free volunteer ticket was issued') }); + // ─── Kids: my family ───────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/me/family', tag: 'Kids', summary: 'My family', description: 'Children, the adults who may collect them, and the family QR code.', access: 'user', v1: kids.getMine }); -v1Route({ method: 'post', path: '/me/family', tag: 'Kids', summary: 'Start my family', access: 'user', status: 201, body: loose, v1: kids.createMine }); -v1Route({ method: 'patch', path: '/me/family', tag: 'Kids', summary: 'Rename my family', access: 'user', body: loose, v1: kids.renameMine }); -v1Route({ method: 'delete', path: '/me/family', tag: 'Kids', summary: 'Leave my family', access: 'user', v1: kids.leaveMine }); -v1Route({ method: 'post', path: '/me/family/children', tag: 'Kids', summary: 'Add a child', access: 'user', status: 201, body: loose, v1: kids.saveMyChild }); -v1Route({ method: 'put', path: '/me/family/children/:id', tag: 'Kids', summary: 'Change a child', access: 'user', params: idParams, body: loose, v1: kids.saveMyChild }); -v1Route({ method: 'delete', path: '/me/family/children/:id', tag: 'Kids', summary: 'Remove a child', access: 'user', params: idParams, v1: kids.deleteMyChild }); -v1Route({ method: 'post', path: '/me/family/adults', tag: 'Kids', summary: 'Add an adult who may collect', access: 'user', status: 201, body: loose, v1: kids.saveMyAdult }); -v1Route({ method: 'put', path: '/me/family/adults/:id', tag: 'Kids', summary: 'Change an adult', access: 'user', params: idParams, body: loose, v1: kids.saveMyAdult }); -v1Route({ method: 'delete', path: '/me/family/adults/:id', tag: 'Kids', summary: 'Remove an adult', access: 'user', params: idParams, v1: kids.deleteMyAdult }); +v1Route({ method: 'get', path: '/me/family', tag: 'Kids', summary: 'My family', description: 'Children, the adults who may collect them, and the family QR code.', access: 'user', documented: { response: myFamily }, v1: kids.getMine }); +v1Route({ method: 'post', path: '/me/family', tag: 'Kids', summary: 'Start my family', access: 'user', status: 201, body: loose, documented: { body: D.obj({ name: D.optStr }), response: myFamily }, v1: kids.createMine }); +v1Route({ method: 'patch', path: '/me/family', tag: 'Kids', summary: 'Rename my family', access: 'user', body: loose, documented: { body: D.obj({ name: D.str }), response: family }, v1: kids.renameMine }); +v1Route({ method: 'delete', path: '/me/family', tag: 'Kids', summary: 'Leave my family', access: 'user', documented: { response: D.anyObj.describe('What happened: left, or the family was deleted as the last parent') }, v1: kids.leaveMine }); +v1Route({ method: 'post', path: '/me/family/children', tag: 'Kids', summary: 'Add a child', access: 'user', status: 201, body: loose, documented: { body: childInput, response: child }, v1: kids.saveMyChild }); +v1Route({ method: 'put', path: '/me/family/children/:id', tag: 'Kids', summary: 'Change a child', access: 'user', params: idParams, body: loose, documented: { body: childInput.partial(), response: child }, v1: kids.saveMyChild }); +v1Route({ method: 'delete', path: '/me/family/children/:id', tag: 'Kids', summary: 'Remove a child', access: 'user', params: idParams, documented: { response: D.message }, v1: kids.deleteMyChild }); +v1Route({ method: 'post', path: '/me/family/adults', tag: 'Kids', summary: 'Add an adult who may collect', access: 'user', status: 201, body: loose, documented: { body: adultInput, response: adult }, v1: kids.saveMyAdult }); +v1Route({ method: 'put', path: '/me/family/adults/:id', tag: 'Kids', summary: 'Change an adult', access: 'user', params: idParams, body: loose, documented: { body: adultInput, response: adult }, v1: kids.saveMyAdult }); +v1Route({ method: 'delete', path: '/me/family/adults/:id', tag: 'Kids', summary: 'Remove an adult', access: 'user', params: idParams, documented: { response: D.message }, v1: kids.deleteMyAdult }); // ─── Kids: set-up and the check-in desk ────────────────────────────────────── -v1Route({ method: 'get', path: '/kids/setup-events', tag: 'Kids', summary: 'Events that can have kids check-in', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], v1: kids.setupEvents }); -v1Route({ method: 'get', path: '/kids/events', tag: 'Kids', summary: 'Events with kids check-in', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], v1: kids.listEvents }); -v1Route({ method: 'get', path: '/events/:id/kids/settings', tag: 'Kids', summary: 'An event\'s kids check-in set-up', access: 'supervisor', ...view, params: idParams, map: asEvent, v1: kids.getSettings }); -v1Route({ method: 'put', path: '/events/:id/kids/settings', tag: 'Kids', summary: 'Set up kids check-in', access: 'supervisor', ...manage, params: idParams, body: loose, map: asEvent, v1: kids.saveSettings }); -v1Route({ method: 'get', path: '/events/:id/kids/board', tag: 'Kids', summary: 'Who is checked in, by room', access: 'staff', ...view, params: idParams, query: filters('sessionId', 'log'), map: asEvent, v1: kids.getBoard }); -v1Route({ method: 'get', path: '/events/:id/kids/families', tag: 'Kids', summary: 'Find a family', access: 'staff', ...view, params: idParams, query: filters('q', 'sessionId'), map: asEvent, v1: kids.searchFamilies }); -v1Route({ method: 'post', path: '/events/:id/kids/families', tag: 'Kids', summary: 'Register a family at the desk', access: 'staff', ...view, status: 201, params: idParams, body: loose, map: asEvent, v1: kids.createFamilyAtDesk }); -v1Route({ method: 'get', path: '/events/:id/kids/families/qr/:token', tag: 'Kids', summary: 'The family for a QR code', access: 'staff', ...view, params: z.object({ id, token: z.string().min(1).max(200) }), map: asEvent, v1: kids.familyByQr }); +v1Route({ method: 'get', path: '/kids/setup-events', tag: 'Kids', summary: 'Events that can have kids check-in', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], documented: { response: z.array(D.event.partial().extend({ kidsCheckIn: D.optBool })) }, v1: kids.setupEvents }); +v1Route({ method: 'get', path: '/kids/events', tag: 'Kids', summary: 'Events with kids check-in', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], documented: { response: z.array(D.event.partial()) }, v1: kids.listEvents }); +v1Route({ method: 'get', path: '/events/:id/kids/settings', tag: 'Kids', summary: 'An event\'s kids check-in set-up', access: 'supervisor', ...view, params: idParams, map: asEvent, documented: { response: D.obj({ event: D.obj({ id: D.str, title: D.str, scheduleType: D.optStr, kidsCheckIn: D.bool, kidsOptionId: D.optStr, kidsRoomSetId: D.optStr }), options: z.array(D.eventOption.partial()), sets: z.array(D.anyObj).describe('Allocation sets that can be the rooms') }) }, v1: kids.getSettings }); +v1Route({ method: 'put', path: '/events/:id/kids/settings', tag: 'Kids', summary: 'Set up kids check-in', access: 'supervisor', ...manage, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ enabled: D.optBool, optionId: D.optStr.describe('The kids ticket (`new` makes a free one; null: none)'), roomSetId: D.optStr.describe('The allocation set used as rooms') }).describe('Only what changes'), response: D.anyObj.describe('The saved set-up, as GET answers') }, v1: kids.saveSettings }); +v1Route({ method: 'get', path: '/events/:id/kids/board', tag: 'Kids', summary: 'Who is checked in, by room', access: 'staff', ...view, params: idParams, query: filters('sessionId', 'log'), map: asEvent, documented: { response: board }, v1: kids.getBoard }); +v1Route({ method: 'get', path: '/events/:id/kids/families', tag: 'Kids', summary: 'Find a family', access: 'staff', ...view, params: idParams, query: filters('q', 'sessionId'), map: asEvent, documented: { response: z.array(family) }, v1: kids.searchFamilies }); +v1Route({ method: 'post', path: '/events/:id/kids/families', tag: 'Kids', summary: 'Register a family at the desk', access: 'staff', ...view, status: 201, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ name: D.optStr, parent: parentInput, children: z.array(childInput).max(12).optional() }), response: family }, v1: kids.createFamilyAtDesk }); +v1Route({ method: 'get', path: '/events/:id/kids/families/qr/:token', tag: 'Kids', summary: 'The family for a QR code', access: 'staff', ...view, params: z.object({ id, token: z.string().min(1).max(200) }), map: asEvent, documented: { response: family }, v1: kids.familyByQr }); const familyParams = z.object({ id, familyId: id }); -v1Route({ method: 'get', path: '/events/:id/kids/families/:familyId', tag: 'Kids', summary: 'One family', access: 'staff', ...view, params: familyParams, map: asEvent, v1: kids.getFamily }); -v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/parents', tag: 'Kids', summary: 'Add a parent at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, v1: kids.addParentAtDesk }); -v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/children', tag: 'Kids', summary: 'Add a child at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, v1: kids.saveChildAtDesk }); -v1Route({ method: 'put', path: '/events/:id/kids/families/:familyId/children/:childId', tag: 'Kids', summary: 'Change a child at the desk', access: 'staff', ...view, params: z.object({ id, familyId: id, childId: id }), body: loose, map: asEvent, v1: kids.saveChildAtDesk }); -v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/adults', tag: 'Kids', summary: 'Add an adult at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, v1: kids.addAdultAtDesk }); -v1Route({ method: 'post', path: '/events/:id/kids/check-in', tag: 'Kids', summary: 'Check children in', description: 'Answers the collection code and labels to print.', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, v1: kids.checkIn }); -v1Route({ method: 'post', path: '/events/:id/kids/check-out', tag: 'Kids', summary: 'Check children out', description: 'With the collection code; refused for someone not allowed to collect.', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, v1: kids.checkOut }); -v1Route({ method: 'get', path: '/events/:id/kids/code/:code', tag: 'Kids', summary: 'Who a collection code is for', access: 'staff', ...view, params: z.object({ id, code: z.string().min(1).max(40) }), query: filters('sessionId'), map: asEvent, v1: kids.lookupCode }); -v1Route({ method: 'post', path: '/events/:id/kids/duty', tag: 'Kids', summary: 'Say which room I\'m on', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, v1: kids.setDuty }); -v1Route({ method: 'get', path: '/events/:id/kids/offline', tag: 'Kids', summary: 'Everything the desk needs offline', access: 'staff', ...view, params: idParams, query: filters('deviceId', 'sessionId'), map: asEvent, v1: kids.offlineSnapshot }); -v1Route({ method: 'post', path: '/events/:id/kids/sync', tag: 'Kids', summary: 'Upload check-ins made offline', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, v1: kids.syncOffline }); +v1Route({ method: 'get', path: '/events/:id/kids/families/:familyId', tag: 'Kids', summary: 'One family', access: 'staff', ...view, params: familyParams, map: asEvent, documented: { response: family }, v1: kids.getFamily }); +v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/parents', tag: 'Kids', summary: 'Add a parent at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, documented: { body: parentInput, response: family }, v1: kids.addParentAtDesk }); +v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/children', tag: 'Kids', summary: 'Add a child at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, documented: { body: childInput, response: child }, v1: kids.saveChildAtDesk }); +v1Route({ method: 'put', path: '/events/:id/kids/families/:familyId/children/:childId', tag: 'Kids', summary: 'Change a child at the desk', access: 'staff', ...view, params: z.object({ id, familyId: id, childId: id }), body: loose, map: asEvent, documented: { body: childInput.partial(), response: child }, v1: kids.saveChildAtDesk }); +v1Route({ method: 'post', path: '/events/:id/kids/families/:familyId/adults', tag: 'Kids', summary: 'Add an adult at the desk', access: 'staff', ...view, status: 201, params: familyParams, body: loose, map: asEvent, documented: { body: adultInput, response: family }, v1: kids.addAdultAtDesk }); +v1Route({ method: 'post', path: '/events/:id/kids/check-in', tag: 'Kids', summary: 'Check children in', description: 'Answers the collection code and labels to print.', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ familyId: D.str, sessionId: D.optStr, children: z.array(D.obj({ childId: D.str, roomId: D.optStr })).describe('Who, and into which room (default: by age)'), sendToAdultId: D.optStr.describe('Send the code to this adult too') }), response: D.obj({ code: D.str.describe('The collection code'), qr: D.str, occasion: D.str, family: D.obj({ id: D.str, name: D.str }), checkIns: z.array(D.obj({ id: D.str, name: D.str, firstName: D.str, room: D.anyObj.nullish(), already: D.bool, sticker: D.optStr.describe('Write this on the sticker') })) }) }, v1: kids.checkIn }); +v1Route({ method: 'post', path: '/events/:id/kids/check-out', tag: 'Kids', summary: 'Check children out', description: 'With the collection code; refused for someone not allowed to collect.', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ code: D.str, checkInIds: D.ids.optional().describe('Just these children (default: all on the code)'), collectedBy: D.optStr.describe('Who collected them'), roomId: D.optStr, sessionId: D.optStr }), response: D.obj({ checkedOut: z.array(D.obj({ id: D.str, name: D.str, room: D.optStr })) }) }, v1: kids.checkOut }); +v1Route({ method: 'get', path: '/events/:id/kids/code/:code', tag: 'Kids', summary: 'Who a collection code is for', access: 'staff', ...view, params: z.object({ id, code: z.string().min(1).max(40) }), query: filters('sessionId'), map: asEvent, documented: { response: D.obj({ code: D.str, found: D.bool, family: D.anyObj.nullish(), children: z.array(D.obj({ id: D.str, name: D.str, room: D.anyObj.nullish(), checkedOutAt: D.optDate, collectedBy: D.optStr })) }) }, v1: kids.lookupCode }); +v1Route({ method: 'post', path: '/events/:id/kids/duty', tag: 'Kids', summary: 'Say which room I\'m on', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ roomId: D.str, sessionId: D.optStr, on: D.optBool.describe('false: off duty') }), response: D.obj({ roomId: D.str, on: D.bool }) }, v1: kids.setDuty }); +v1Route({ method: 'get', path: '/events/:id/kids/offline', tag: 'Kids', summary: 'Everything the desk needs offline', access: 'staff', ...view, params: idParams, query: filters('deviceId', 'sessionId'), map: asEvent, documented: { response: board.extend({ families: z.array(family), codes: z.array(D.anyObj).describe('Codes reserved for this device'), downloadedAt: D.date }) }, v1: kids.offlineSnapshot }); +v1Route({ method: 'post', path: '/events/:id/kids/sync', tag: 'Kids', summary: 'Upload check-ins made offline', access: 'staff', ...view, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ deviceId: D.str, sessionId: D.optStr, checkIns: z.array(D.anyObj).optional(), checkOuts: z.array(D.anyObj).optional() }), response: D.obj({ checkedIn: D.num, checkedOut: D.num, conflicts: z.array(D.anyObj) }) }, v1: kids.syncOffline }); const checkInScope = { campusScope: 'scopeEvent(kidsCheckIn)', middleware: [cs.scopeEvent({ resolve: 'kidsCheckIn' })] }; -v1Route({ method: 'post', path: '/kids/check-ins/:id/override', tag: 'Kids', summary: 'Let someone not on the list collect', description: 'Logged, with the reason.', access: 'staff', ...checkInScope, params: idParams, body: loose, v1: kids.overrideCheckOut }); -v1Route({ method: 'post', path: '/kids/check-ins/:id/page', tag: 'Kids', summary: 'Page a child\'s parent', access: 'staff', ...checkInScope, params: idParams, body: loose, v1: kids.pageParent }); -v1Route({ method: 'put', path: '/kids/check-ins/:id/room', tag: 'Kids', summary: 'Move a child to another room', access: 'staff', ...checkInScope, params: idParams, body: loose, v1: kids.moveRoom }); -v1Route({ method: 'post', path: '/kids/alerts/:id/resolve', tag: 'Kids', summary: 'Resolve an alert', access: 'staff', campusScope: 'scopeEvent(kidsAlert)', middleware: [cs.scopeEvent({ resolve: 'kidsAlert' })], params: idParams, body: loose, v1: kids.resolveAlert }); +v1Route({ method: 'post', path: '/kids/check-ins/:id/override', tag: 'Kids', summary: 'Let someone not on the list collect', description: 'Logged, with the reason.', access: 'staff', ...checkInScope, params: idParams, body: loose, documented: { body: D.obj({ reason: D.str, collectedBy: D.str }), response: D.obj({ id: D.str, checkedOutAt: D.date }) }, v1: kids.overrideCheckOut }); +v1Route({ method: 'post', path: '/kids/check-ins/:id/page', tag: 'Kids', summary: 'Page a child\'s parent', access: 'staff', ...checkInScope, params: idParams, body: loose, documented: { body: D.obj({ message: D.optStr }), response: D.obj({ sent: z.array(D.str).describe('Channels used'), text: D.str }) }, v1: kids.pageParent }); +v1Route({ method: 'put', path: '/kids/check-ins/:id/room', tag: 'Kids', summary: 'Move a child to another room', access: 'staff', ...checkInScope, params: idParams, body: loose, documented: { body: D.obj({ roomId: D.str }), response: D.obj({ id: D.str, roomId: D.str }) }, v1: kids.moveRoom }); +v1Route({ method: 'post', path: '/kids/alerts/:id/resolve', tag: 'Kids', summary: 'Resolve an alert', access: 'staff', campusScope: 'scopeEvent(kidsAlert)', middleware: [cs.scopeEvent({ resolve: 'kidsAlert' })], params: idParams, body: loose, documented: { response: D.obj({ resolved: D.num }) }, v1: kids.resolveAlert }); // ─── Volunteering: mine ────────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/me/volunteering', tag: 'Volunteers', summary: 'Where I\'m serving', access: 'user', v1: vol.getMine }); -v1Route({ method: 'get', path: '/events/:id/volunteer-roles', tag: 'Volunteers', summary: 'Roles I can serve in at an event', access: 'user', params: idParams, map: asEvent, v1: vol.getEventRoles }); -v1Route({ method: 'post', path: '/volunteer-roles/:id/sign-up', tag: 'Volunteers', summary: 'Sign up to serve', access: 'user', status: 201, params: idParams, body: loose, v1: vol.signUp }); -v1Route({ method: 'delete', path: '/volunteer-slots/:id', tag: 'Volunteers', summary: 'Stop serving in a slot', access: 'user', params: idParams, v1: vol.withdraw }); -v1Route({ method: 'post', path: '/volunteer-slots/:id/swap', tag: 'Volunteers', summary: 'Ask someone to take my slot', access: 'user', params: idParams, body: loose, v1: vol.requestSwap }); -v1Route({ method: 'delete', path: '/volunteer-swaps/:id', tag: 'Volunteers', summary: 'Cancel a swap request', access: 'user', params: idParams, v1: vol.cancelSwap }); -v1Route({ method: 'post', path: '/volunteer-swaps/:id/accept', tag: 'Volunteers', summary: 'Take someone\'s slot', access: 'user', params: idParams, body: loose, v1: vol.acceptSwap }); -v1Route({ method: 'post', path: '/volunteering/check-in', tag: 'Volunteers', summary: 'Check myself in (the event\'s QR code)', access: 'user', body: loose, v1: vol.checkIn }); +v1Route({ method: 'get', path: '/me/volunteering', tag: 'Volunteers', summary: 'Where I\'m serving', access: 'user', documented: { response: D.obj({ slots: z.array(D.obj({ slotId: D.str, role: D.anyObj, event: D.anyObj, shift: roleShift, checkedInAt: D.optDate, canCheckIn: D.bool, past: D.bool, swapId: D.optStr, hasTicket: D.bool })), cover: z.array(D.anyObj).describe('Slots others want covered'), events: z.array(D.obj({ id: D.str, title: D.str, startDate: D.date, endDate: D.date, location: D.optStr, roles: D.num })) }) }, v1: vol.getMine }); +v1Route({ method: 'get', path: '/events/:id/volunteer-roles', tag: 'Volunteers', summary: 'Roles I can serve in at an event', access: 'user', params: idParams, map: asEvent, documented: { response: roster }, v1: vol.getEventRoles }); +v1Route({ method: 'post', path: '/volunteer-roles/:id/sign-up', tag: 'Volunteers', summary: 'Sign up to serve', access: 'user', status: 201, params: idParams, body: loose, documented: { response: signedUp }, v1: vol.signUp }); +v1Route({ method: 'delete', path: '/volunteer-slots/:id', tag: 'Volunteers', summary: 'Stop serving in a slot', access: 'user', params: idParams, documented: { response: D.message }, v1: vol.withdraw }); +v1Route({ method: 'post', path: '/volunteer-slots/:id/swap', tag: 'Volunteers', summary: 'Ask someone to take my slot', access: 'user', params: idParams, body: loose, documented: { body: D.obj({ note: D.optStr }), response: D.obj({ swapId: D.str }) }, v1: vol.requestSwap }); +v1Route({ method: 'delete', path: '/volunteer-swaps/:id', tag: 'Volunteers', summary: 'Cancel a swap request', access: 'user', params: idParams, documented: { response: D.obj({ cancelled: z.literal(true) }) }, v1: vol.cancelSwap }); +v1Route({ method: 'post', path: '/volunteer-swaps/:id/accept', tag: 'Volunteers', summary: 'Take someone\'s slot', access: 'user', params: idParams, body: loose, documented: { response: D.obj({ slotId: D.str, role: D.str, event: D.str }) }, v1: vol.acceptSwap }); +v1Route({ method: 'post', path: '/volunteering/check-in', tag: 'Volunteers', summary: 'Check myself in (the event\'s QR code)', access: 'user', body: loose, documented: { body: D.obj({ qr: D.str.describe('What the QR code holds') }), response: D.obj({ event: D.obj({ id: D.str, title: D.str }), checkedIn: z.array(D.obj({ role: D.str, kidsRoom: D.optStr })), already: z.array(D.str) }) }, v1: vol.checkIn }); // ─── Volunteering: rosters ─────────────────────────────────────────────────── -v1Route({ method: 'get', path: '/volunteering/events', tag: 'Volunteers', summary: 'Events with volunteer roles', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('all'), v1: vol.listEvents }); -v1Route({ method: 'get', path: '/volunteering/hours', tag: 'Volunteers', summary: 'Hours served', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('from', 'to', 'eventId'), v1: vol.hours }); -v1Route({ method: 'get', path: '/events/:id/volunteers', tag: 'Volunteers', summary: 'An event\'s roster', access: 'staff', ...view, params: idParams, query: filters('log'), map: asEvent, v1: vol.getRoster }); -v1Route({ method: 'get', path: '/events/:id/volunteers/qr', tag: 'Volunteers', summary: 'The self check-in QR code', access: 'staff', ...view, params: idParams, map: asEvent, v1: vol.getQr }); -v1Route({ method: 'get', path: '/events/:id/volunteers/settings', tag: 'Volunteers', summary: 'Volunteer set-up', access: 'supervisor', ...view, params: idParams, map: asEvent, v1: vol.getSettings }); -v1Route({ method: 'put', path: '/events/:id/volunteers/settings', tag: 'Volunteers', summary: 'Set up volunteering', access: 'supervisor', ...manage, params: idParams, body: loose, map: asEvent, v1: vol.saveSettings }); -v1Route({ method: 'post', path: '/events/:id/volunteer-roles', tag: 'Volunteers', summary: 'Add a role', access: 'supervisor', ...manage, status: 201, params: idParams, body: loose, map: asEvent, v1: vol.createRole }); +v1Route({ method: 'get', path: '/volunteering/events', tag: 'Volunteers', summary: 'Events with volunteer roles', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('all'), documented: { response: z.array(D.obj({ id: D.str, title: D.str, startDate: D.date, endDate: D.date, scheduleType: D.optStr, campusId: D.optStr, roles: D.num })) }, v1: vol.listEvents }); +v1Route({ method: 'get', path: '/volunteering/hours', tag: 'Volunteers', summary: 'Hours served', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('from', 'to', 'eventId'), documented: { response: z.array(D.obj({ userId: D.str.optional(), name: D.str, hours: D.num, shifts: D.optNum })) }, v1: vol.hours }); +v1Route({ method: 'get', path: '/events/:id/volunteers', tag: 'Volunteers', summary: 'An event\'s roster', access: 'staff', ...view, params: idParams, query: filters('log'), map: asEvent, documented: { response: roster }, v1: vol.getRoster }); +v1Route({ method: 'get', path: '/events/:id/volunteers/qr', tag: 'Volunteers', summary: 'The self check-in QR code', access: 'staff', ...view, params: idParams, map: asEvent, documented: { response: D.obj({ token: D.str, qr: D.str.describe('Put this in the QR code') }) }, v1: vol.getQr }); +v1Route({ method: 'get', path: '/events/:id/volunteers/settings', tag: 'Volunteers', summary: 'Volunteer set-up', access: 'supervisor', ...view, params: idParams, map: asEvent, documented: { response: D.obj({ event: D.obj({ id: D.str, title: D.str, volunteerOptionId: D.optStr }), options: z.array(D.eventOption.partial()), kidsRooms: z.array(D.anyObj) }) }, v1: vol.getSettings }); +v1Route({ method: 'put', path: '/events/:id/volunteers/settings', tag: 'Volunteers', summary: 'Set up volunteering', access: 'supervisor', ...manage, params: idParams, body: loose, map: asEvent, documented: { body: D.obj({ optionId: D.optStr.describe('The free volunteer ticket (null: none)') }), response: D.anyObj.describe('The saved set-up, as GET answers') }, v1: vol.saveSettings }); +v1Route({ method: 'post', path: '/events/:id/volunteer-roles', tag: 'Volunteers', summary: 'Add a role', access: 'supervisor', ...manage, status: 201, params: idParams, body: loose, map: asEvent, documented: { body: roleInput, response: roleRecord }, v1: vol.createRole }); const roleManage = { campusScope: 'scopeEvent(servingRole, manage)', middleware: [cs.scopeEvent({ resolve: 'servingRole', need: 'manage' })] }; -v1Route({ method: 'patch', path: '/volunteer-roles/:id', tag: 'Volunteers', summary: 'Change a role', access: 'supervisor', ...roleManage, params: idParams, body: loose, v1: vol.updateRole }); -v1Route({ method: 'delete', path: '/volunteer-roles/:id', tag: 'Volunteers', summary: 'Delete a role', access: 'supervisor', ...roleManage, params: idParams, v1: vol.deleteRole }); -v1Route({ method: 'post', path: '/volunteer-roles/:id/assign', tag: 'Volunteers', summary: 'Put someone in a role', access: 'supervisor', campusScope: 'scopeEvent(servingRole)', middleware: [cs.scopeEvent({ resolve: 'servingRole' })], params: idParams, body: loose, v1: vol.assign }); +v1Route({ method: 'patch', path: '/volunteer-roles/:id', tag: 'Volunteers', summary: 'Change a role', access: 'supervisor', ...roleManage, params: idParams, body: loose, documented: { body: roleInput.partial(), response: roleRecord }, v1: vol.updateRole }); +v1Route({ method: 'delete', path: '/volunteer-roles/:id', tag: 'Volunteers', summary: 'Delete a role', access: 'supervisor', ...roleManage, params: idParams, documented: { response: D.obj({ message: D.str, volunteers: D.num.describe('People who were in it (told by message)') }) }, v1: vol.deleteRole }); +v1Route({ method: 'post', path: '/volunteer-roles/:id/assign', tag: 'Volunteers', summary: 'Put someone in a role', access: 'supervisor', campusScope: 'scopeEvent(servingRole)', middleware: [cs.scopeEvent({ resolve: 'servingRole' })], params: idParams, body: loose, documented: { body: D.obj({ userId: D.str }), response: signedUp }, v1: vol.assign }); const slotScope = { campusScope: 'scopeEvent(volunteerSlot)', middleware: [cs.scopeEvent({ resolve: 'volunteerSlot' })] }; -v1Route({ method: 'post', path: '/volunteer-slots/:id/check-in', tag: 'Volunteers', summary: 'Check a volunteer in', access: 'staff', ...slotScope, params: idParams, body: loose, v1: vol.checkInManual }); -v1Route({ method: 'post', path: '/volunteer-slots/:id/remove', tag: 'Volunteers', summary: 'Take someone off a slot', access: 'supervisor', ...slotScope, params: idParams, body: loose, v1: vol.remove }); +v1Route({ method: 'post', path: '/volunteer-slots/:id/check-in', tag: 'Volunteers', summary: 'Check a volunteer in', access: 'staff', ...slotScope, params: idParams, body: loose, documented: { body: D.obj({ undo: D.optBool }), response: D.obj({ slotId: D.str, changed: D.bool }) }, v1: vol.checkInManual }); +v1Route({ method: 'post', path: '/volunteer-slots/:id/remove', tag: 'Volunteers', summary: 'Take someone off a slot', access: 'supervisor', ...slotScope, params: idParams, body: loose, documented: { response: D.message }, v1: vol.remove }); diff --git a/apps/events/backend/src/v2/resources/money.ts b/apps/events/backend/src/v2/resources/money.ts index 4901dd1..b9b627d 100644 --- a/apps/events/backend/src/v2/resources/money.ts +++ b/apps/events/backend/src/v2/resources/money.ts @@ -6,6 +6,7 @@ import { z } from 'zod'; import { id, idParams } from '../schemas'; import { listData, v1Route } from '../viaV1'; +import * as D from '../docs'; /* eslint-disable @typescript-eslint/no-explicit-any -- v1 handlers and middleware are JavaScript */ const rateLimit = require('express-rate-limit') as (opts: object) => any; @@ -33,38 +34,88 @@ const asEvent = (ctx: any) => ({ params: { ...ctx.req.params, eventId: ctx.param // Links in messages are credentials, so guessing stays slow (as on v1). const linkLimiter = () => rateLimit({ windowMs: 60 * 1000, max: 30, message: { message: 'Too many attempts. Please try again in a minute.' } }); const SCOPE_LIST = 'scopeList (the handler filters by listWhere)'; + +// ─── Documented shapes (docs.ts) ───────────────────────────────────────────── + +const providerRow = D.obj({ id: D.str.describe('yoco, payfast'), label: D.str }); +const providerSettings = D.obj({ + id: D.str, label: D.str, enabled: D.bool, configured: D.bool.describe('Its keys are set up'), + capabilities: D.anyObj.describe('What the provider can do, e.g. look payments up'), +}); +const openCheckout = D.obj({ + id: D.str, provider: D.str, providerLabel: D.str, canCheck: D.bool.describe('The provider can be asked whether it was paid'), + amount: D.rand, description: D.str, type: D.optStr.describe('registration, donation, sponsorship, season_pass…'), + registrationId: D.optStr, payer: D.optStr, createdAt: D.date, +}); +const payPage = D.obj({ + id: D.str, status: z.enum(['open', 'paid']), amount: D.rand, description: D.str, + provider: D.optStr.describe('The provider already chosen, if any'), providers: z.array(providerRow), cancelUrl: D.optStr, + redirectUrl: D.optStr, form: D.anyObj.nullish().describe('A signed form to post (PayFast)'), +}); +const paymentFull = D.payment.extend({ + registration: D.registration.nullish(), + generatedTickets: z.array(D.ticket).optional().describe('Tickets issued because this paid it in full'), + formsNeeded: D.optNum.describe('Attendee forms still holding the tickets back (1.52.0)'), + donationSplit: D.payment.optional().describe('What was paid over the balance, kept as a donation'), +}); +const cashupLineInput = D.obj({ + method: D.str.describe('cash, card, eft…'), + bankAmount: D.optRand, onHandAmount: D.optRand.describe('Cash only'), pendingAmount: D.optRand.describe('Not cash'), pendingReference: D.optStr, + writeOffs: z.array(D.obj({ category: D.str, amount: D.optRand, reason: D.optStr })).optional(), notes: D.optStr, +}); +const cashupRecord = D.obj({ id: D.str, eventId: D.str, action: D.optStr.describe('close, quick_close, reopen'), notes: D.optStr, createdAt: D.date, performedBy: D.userRef.nullish() }); +const providerTransaction = D.obj({ + id: D.str, provider: D.str, providerLabel: D.str, externalId: D.str.describe('The provider\'s id'), + amount: D.optNum.describe('Cents'), currency: D.optStr, createdDate: D.optDate, checkoutId: D.optStr, methodType: D.optStr, + reconciled: D.bool, ignored: D.bool, paymentId: D.optStr, note: D.optStr.describe('Why it needs a look'), metadata: D.anyObj.nullish(), +}); +const txAnswer = (data: T) => D.obj({ success: D.bool, data, message: D.optStr }); +const waitlistEntry = D.obj({ + id: D.str, eventId: D.str, eventOptionId: D.str, variantId: D.optStr, sessionId: D.optStr, userId: D.str, + quantity: D.num, position: D.num.describe('Place in the queue'), status: D.str.describe('waiting, offered, claimed, expired, removed, left'), + offeredQuantity: D.optNum, offeredAt: D.optDate, offerExpiresAt: D.optDate, claimedAt: D.optDate, registrationId: D.optStr, createdAt: D.date, +}); +const consentRow = D.obj({ + name: D.str.describe('The young person'), status: D.str.describe('not_requested, pending, given, declined'), + parentName: D.optStr, parentEmail: D.optStr, parentPhone: D.optStr, request: D.anyObj.nullish(), +}); +const feedbackField = D.obj({ id: D.str.optional(), type: D.str.describe('rating, multiple_choice, text, yes_no…'), label: D.str, isRequired: D.optBool, helpText: D.optStr, options: z.array(D.str).nullish() }); +const feedbackForm = D.obj({ + id: D.str, eventId: D.str, sendAt: D.optDate, sentAt: D.optDate, audience: D.str.describe('checked_in or everyone'), anonymous: D.bool, intro: D.optStr, + fields: z.array(feedbackField), invited: D.optNum, responses: z.unknown().optional().describe('Answers per question'), +}).nullable().describe('null when the event has no feedback form'); const UNSCOPED = 'unscopedOnly (admins and unscoped supervisors)'; // ─── Payments ──────────────────────────────────────────────────────────────── v1Route({ method: 'get', path: '/payments/providers', tag: 'Payments', summary: 'The payment providers switched on', - access: 'public', v1: providers.listPaymentProviders, + access: 'public', documented: { response: D.obj({ providers: z.array(providerRow), minimumAmount: D.rand.describe('Smallest online payment') }) }, v1: providers.listPaymentProviders, }); v1Route({ method: 'get', path: '/payments/providers/settings', tag: 'Payments', summary: 'Payment provider settings', - description: 'Admins. Keys are masked.', access: 'admin', v1: providers.getPaymentProviderSettings, + description: 'Admins. Keys are masked.', access: 'admin', documented: { response: D.obj({ providers: z.array(providerSettings), minimumAmount: D.rand }) }, v1: providers.getPaymentProviderSettings, }); v1Route({ method: 'put', path: '/payments/providers/settings', tag: 'Payments', summary: 'Change payment provider settings', - access: 'admin', body: z.looseObject({}), v1: providers.updatePaymentProviderSettings, + access: 'admin', body: z.looseObject({}), documented: { body: D.obj({ providers: z.array(D.obj({ id: D.str, enabled: D.bool })).min(1).describe('Every provider, in the order to offer them') }), response: D.obj({ message: D.str, providers: z.array(providerSettings) }) }, v1: providers.updatePaymentProviderSettings, }); v1Route({ method: 'get', path: '/payments/open-checkouts', tag: 'Payments', summary: 'Checkouts started but not finished', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], v1: providers.listOpenCheckouts, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], documented: { response: D.obj({ checkouts: z.array(openCheckout), days: D.num.describe('How far back it looks') }) }, v1: providers.listOpenCheckouts, }); v1Route({ method: 'post', path: '/payments/open-checkouts/check', tag: 'Payments', summary: 'Ask the provider about open checkouts', description: 'Records any that were paid (for when a webhook was missed).', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], body: z.looseObject({}), v1: providers.checkCheckoutStatus, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], body: z.looseObject({}), documented: { body: D.obj({ ids: D.ids.optional().describe('Checkouts to ask about (default: every open one), at most 200') }), response: D.obj({ results: z.array(D.anyObj), recorded: D.num.describe('Payments found and recorded'), message: D.str }) }, v1: providers.checkCheckoutStatus, }); v1Route({ - method: 'get', path: '/payments/stats', tag: 'Payments', summary: 'Payment totals', access: 'admin', query: paymentFilters, v1: pay.getPaymentStats, + method: 'get', path: '/payments/stats', tag: 'Payments', summary: 'Payment totals', access: 'admin', query: paymentFilters, documented: { response: D.obj({ totalToday: D.rand, totalWeek: D.rand, totalMonth: D.rand }) }, v1: pay.getPaymentStats, }); v1Route({ method: 'get', path: '/payments', tag: 'Payments', summary: 'Every payment', description: 'For the events you may see. `page` and `limit` page it (otherwise everything); see v1 for the filters it takes.', - access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: paymentFilters, v1: pay.getPayments, + access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: paymentFilters, documented: { response: D.v1Page(D.payment.extend({ registration: D.registration.nullish() })) }, v1: pay.getPayments, }); v1Route({ method: 'post', path: '/payments', tag: 'Payments', summary: 'Record a payment', @@ -72,129 +123,129 @@ v1Route({ access: 'supervisor', campusScope: 'scopeBody(registrationId, eventId; deny orphans)', status: 201, middleware: [cs.scopeBody([['registrationId', 'registration'], ['eventId', 'event']], { orphan: 'deny' })], body: z.looseObject({ registrationId: id.nullish(), eventId: id.nullish(), amount: z.union([z.number(), z.string()]), method: z.string().max(20).optional() }), - v1: pay.createPayment, + documented: { body: D.obj({ registrationId: D.optStr, eventId: D.optStr.describe('A donation: the event'), amount: D.numeric, method: D.str.describe('cash, card, eft or other'), isDonation: D.optBool, paidAt: D.optDate.describe('Backdate it'), userId: D.optStr.describe('A donation: who gave it') }), response: paymentFull }, v1: pay.createPayment, }); v1Route({ method: 'post', path: '/payments/refunds', tag: 'Payments', summary: 'Refund a payment', access: 'supervisor', campusScope: 'scopeBody(paymentId, registrationId; manage, deny orphans)', status: 201, middleware: [cs.scopeBody([['paymentId', 'payment'], ['registrationId', 'registration']], { need: 'manage', orphan: 'deny' })], - body: z.looseObject({ paymentId: id.optional(), registrationId: id.optional() }), v1: pay.createRefund, + body: z.looseObject({ paymentId: id.optional(), registrationId: id.optional() }), documented: { body: D.obj({ paymentId: D.optStr.describe('The payment refunded (or registrationId)'), registrationId: D.optStr, userId: D.str, amount: D.numeric.describe('Positive; stored as a negative payment'), method: D.str, reason: D.optStr }), response: D.payment }, v1: pay.createRefund, }); v1Route({ method: 'post', path: '/payments/donations/assign', tag: 'Payments', summary: 'Put a donation towards a registration', access: 'supervisor', campusScope: 'scopeBody(paymentId deny orphans; registrationId)', middleware: [cs.scopeBody([['paymentId', 'payment']], { orphan: 'deny' }), cs.scopeBody([['registrationId', 'registration']])], - body: z.looseObject({ paymentId: id, registrationId: id }), v1: pay.assignDonationToRegistration, + body: z.looseObject({ paymentId: id, registrationId: id }), documented: { body: D.obj({ paymentId: D.str.describe('The donation'), registrationId: D.str, amount: D.numeric.optional().describe('Default: as much as both allow') }), response: D.obj({ message: D.optStr, updatedRegistration: D.registration.optional(), generatedTickets: z.array(D.ticket).optional() }) }, v1: pay.assignDonationToRegistration, }); v1Route({ method: 'post', path: '/payments/donations/unassign', tag: 'Payments', summary: 'Take a donation back off a registration', access: 'supervisor', campusScope: 'scopeBody(legId; deny orphans)', middleware: [cs.scopeBody([['legId', 'payment']], { orphan: 'deny' })], - body: z.looseObject({ legId: id }), v1: pay.unassignDonationFromRegistration, + body: z.looseObject({ legId: id }), documented: { response: D.obj({ message: D.str, updatedRegistration: D.registration, donationId: D.str }) }, v1: pay.unassignDonationFromRegistration, }); v1Route({ method: 'post', path: '/donations/checkout', tag: 'Payments', summary: 'Give to an event', description: 'Starts a checkout for a donation of `amount` to `eventId`; answers where to send the person (`redirectUrl`).', - access: 'user', body: z.looseObject({ eventId: id, amount: z.union([z.number(), z.string()]) }), v1: pay.createCheckout, + access: 'user', body: z.looseObject({ eventId: id, amount: z.union([z.number(), z.string()]) }), documented: { body: D.obj({ eventId: D.str, amount: D.numeric, provider: D.optStr, successUrl: D.optStr, cancelUrl: D.optStr, failureUrl: D.optStr }), response: D.checkout.extend({ amount: D.rand, event: D.eventRef.partial() }) }, v1: pay.createCheckout, }); v1Route({ - method: 'get', path: '/me/payments', tag: 'Me', summary: 'My payments', access: 'user', query: paymentFilters, v1: pay.getUserPayments, + method: 'get', path: '/me/payments', tag: 'Me', summary: 'My payments', access: 'user', query: paymentFilters, documented: { response: D.v1Page(D.payment.extend({ registration: D.registration.nullish() })) }, v1: pay.getUserPayments, }); v1Route({ method: 'get', path: '/payments/:id', tag: 'Payments', summary: 'One payment', - access: 'user', campusScope: 'scopeEvent(payment, owner-ok)', middleware: [cs.scopeEvent({ resolve: 'payment', ownerOk: true })], params: idParams, v1: pay.getPaymentById, + access: 'user', campusScope: 'scopeEvent(payment, owner-ok)', middleware: [cs.scopeEvent({ resolve: 'payment', ownerOk: true })], params: idParams, documented: { response: D.payment.extend({ registration: D.registration.nullish() }) }, v1: pay.getPaymentById, }); v1Route({ method: 'post', path: '/payments/:id/receipt', tag: 'Payments', summary: 'Send the receipt again', access: 'user', campusScope: 'scopeEvent(payment, owner-ok)', middleware: [cs.scopeEvent({ resolve: 'payment', ownerOk: true })], params: idParams, - body: z.looseObject({ channel: z.string().max(20).optional() }), v1: pay.sendReceipt, + body: z.looseObject({ channel: z.string().max(20).optional() }), documented: { response: D.message }, v1: pay.sendReceipt, }); v1Route({ method: 'get', path: '/registrations/:id/payments', tag: 'Payments', summary: 'A registration\'s payments', access: 'user', campusScope: 'scopeEvent(registration, owner-ok)', middleware: [cs.scopeEvent({ resolve: 'registration', ownerOk: true })], params: idParams, - response: listData, map: ctx => ({ params: { registrationId: ctx.params.id } }), v1: pay.getPaymentsByRegistration, + response: listData, documented: { response: z.array(D.payment) }, map: ctx => ({ params: { registrationId: ctx.params.id } }), v1: pay.getPaymentsByRegistration, }); v1Route({ method: 'post', path: '/registrations/:id/payment-link', tag: 'Payments', summary: 'Make a link to pay', description: 'Supervisors: a checkout for `amount` (part of what\'s owed) for someone else to pay. Answers `redirectUrl` (the link) — or `priceUpdated` when an early-bird price ran out.', access: 'supervisor', campusScope: 'scopeEvent(registration)', middleware: [cs.scopeEvent({ resolve: 'registration' })], params: idParams, - body: z.looseObject({ amount: z.union([z.number(), z.string()]).optional() }), map: ctx => ({ body: { ...(ctx.req.body || {}), registrationId: ctx.params.id } }), v1: pay.createCheckout, + body: z.looseObject({ amount: z.union([z.number(), z.string()]).optional() }), map: ctx => ({ body: { ...(ctx.req.body || {}), registrationId: ctx.params.id } }), documented: { body: D.obj({ amount: D.numeric.optional(), donationAmount: D.numeric.optional(), provider: D.optStr, successUrl: D.optStr, cancelUrl: D.optStr, failureUrl: D.optStr }), response: D.checkout.extend({ priceUpdated: D.optBool, newTotal: D.optRand }) }, v1: pay.createCheckout, }); v1Route({ method: 'post', path: '/registrations/:id/payment-link/send', tag: 'Payments', summary: 'Send someone a link to pay', description: 'By email and/or WhatsApp, for what\'s still owing.', access: 'supervisor', campusScope: 'scopeEvent(registration)', middleware: [cs.scopeEvent({ resolve: 'registration' })], params: idParams, - body: z.looseObject({}), map: ctx => ({ body: { ...(ctx.req.body || {}), registrationId: ctx.params.id } }), v1: pay.sendPaymentLink, + body: z.looseObject({}), map: ctx => ({ body: { ...(ctx.req.body || {}), registrationId: ctx.params.id } }), documented: { body: D.obj({ redirectUrl: D.str.describe('The link to send'), channel: z.enum(['email', 'whatsapp']) }), response: D.obj({ sent: z.literal(true), channel: D.str }) }, v1: pay.sendPaymentLink, }); v1Route({ method: 'get', path: '/events/:id/payments', tag: 'Payments', summary: 'An event\'s payments', - access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: pay.getPaymentsByEvent, + access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: z.array(D.payment) }, v1: pay.getPaymentsByEvent, }); v1Route({ method: 'get', path: '/payment-links/:id', tag: 'Payments', summary: 'A pay page', description: 'What a payment link shows: what\'s owed and the providers to pay with. The id in the link is the credential.', - access: 'public', params: idParams, v1: providers.getPayPage, + access: 'public', params: idParams, documented: { response: payPage }, v1: providers.getPayPage, }); v1Route({ method: 'post', path: '/payment-links/:id', tag: 'Payments', summary: 'Pay from a pay page', description: 'Starts a checkout with the chosen provider; answers where to send the person.', - access: 'public', params: idParams, body: z.looseObject({ provider: z.string().max(40).optional() }), v1: providers.choosePayProvider, + access: 'public', params: idParams, body: z.looseObject({ provider: z.string().max(40).optional() }), documented: { response: D.obj({ provider: D.str, redirectUrl: D.optStr, form: D.anyObj.nullish() }) }, v1: providers.choosePayProvider, }); // ─── Cash-ups ──────────────────────────────────────────────────────────────── const cashupBase = '/events/:id/cashup'; v1Route({ - method: 'get', path: '/cashups/audit', tag: 'Cash-ups', summary: 'Cash-up history', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'from', 'to'), v1: cashup.getCashupAudit, + method: 'get', path: '/cashups/audit', tag: 'Cash-ups', summary: 'Cash-up history', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'from', 'to'), documented: { response: z.array(cashupRecord) }, v1: cashup.getCashupAudit, }); v1Route({ method: 'get', path: cashupBase, tag: 'Cash-ups', summary: 'An event\'s cash-up', description: 'Income by method, costs, what each drawer should hold, and the saved draft.', - access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, v1: cashup.getEventCashup, + access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, documented: { response: D.obj({ event: D.anyObj, paymentsByMethod: D.anyObj.describe('Income per method'), totalRevenue: D.rand, costs: z.array(D.anyObj), totalCosts: D.rand, expectedCashByMethod: D.anyObj, reconciled: D.anyObj.nullish().describe('The last close, line by line'), netProfit: D.rand, totalDonations: D.rand, unallocatedDonationsTotal: D.rand, discountsTotal: D.optRand, salesByOption: z.array(D.anyObj).optional() }) }, v1: cashup.getEventCashup, }); v1Route({ method: 'get', path: `${cashupBase}/cash-by-user`, tag: 'Cash-ups', summary: 'Cash taken by each person', - access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, v1: cashup.getCashByRecordedUser, + access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, documented: { response: D.obj({ rows: z.array(D.anyObj).describe('Per person: who, cash recorded, cash counted'), cashActualTotal: D.optRand, cashDenominations: D.anyObj.nullish() }) }, v1: cashup.getCashByRecordedUser, }); v1Route({ method: 'put', path: `${cashupBase}/person-cash/:userId`, tag: 'Cash-ups', summary: 'Count one person\'s cash', access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: z.object({ id, userId: id }), - body: z.looseObject({}), map: ctx => ({ params: { eventId: ctx.params.id, userId: ctx.params.userId } }), v1: cashup.savePersonCash, + body: z.looseObject({}), map: ctx => ({ params: { eventId: ctx.params.id, userId: ctx.params.userId } }), documented: { body: D.obj({ denominations: z.array(D.obj({ value: D.num.describe('The note or coin, in rand'), count: D.num })), notes: D.optStr }), response: D.anyObj.describe('The saved count') }, v1: cashup.savePersonCash, }); v1Route({ method: 'put', path: `${cashupBase}/draft`, tag: 'Cash-ups', summary: 'Save the cash-up as a draft', - access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, v1: cashup.saveEventCashupDraft, + access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, documented: { body: D.obj({ lines: z.array(cashupLineInput), notes: D.optStr }), response: D.message }, v1: cashup.saveEventCashupDraft, }); v1Route({ method: 'post', path: `${cashupBase}/close`, tag: 'Cash-ups', summary: 'Close the event', description: 'Admins. Nothing about the event\'s money can change until it\'s reopened.', - access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, v1: cashup.closeEvent, + access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, documented: { body: D.obj({ lines: z.array(cashupLineInput).optional().describe('Per payment method: in the bank, on hand, pending, write-offs (leave out for a quick close)'), notes: D.optStr }), response: cashupRecord }, v1: cashup.closeEvent, }); v1Route({ method: 'post', path: `${cashupBase}/reopen`, tag: 'Cash-ups', summary: 'Reopen a closed event', - access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, v1: cashup.reopenEvent, + access: 'admin', params: idParams, body: z.looseObject({}), map: asEvent, documented: { body: D.obj({ notes: D.optStr.describe('Why') }), response: cashupRecord }, v1: cashup.reopenEvent, }); v1Route({ method: 'post', path: '/cashup-lines/:id/pending', tag: 'Cash-ups', summary: 'Settle a pending cash-up line', - access: 'admin', params: idParams, body: z.looseObject({}), map: ctx => ({ params: { lineId: ctx.params.id } }), v1: cashup.resolvePending, + access: 'admin', params: idParams, body: z.looseObject({}), map: ctx => ({ params: { lineId: ctx.params.id } }), documented: { body: D.obj({ outcome: z.enum(['received', 'written_off']), amount: D.numeric, category: D.optStr.describe('A write-off: what it was for'), notes: D.optStr }), response: D.anyObj.describe('The settlement recorded') }, v1: cashup.resolvePending, }); // ─── Provider transactions ─────────────────────────────────────────────────── v1Route({ method: 'get', path: '/provider-transactions', tag: 'Payments', summary: 'Transactions from Yoco and PayFast', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], query: filters('provider'), v1: ptx.getAllProviderTransactions, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], query: filters('provider'), documented: { response: txAnswer(z.array(providerTransaction)) }, v1: ptx.getAllProviderTransactions, }); v1Route({ method: 'get', path: '/provider-transactions/unreconciled', tag: 'Payments', summary: 'Provider transactions not matched yet', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], v1: ptx.getUnreconciledProviderTransactions, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], documented: { response: txAnswer(z.array(providerTransaction)) }, v1: ptx.getUnreconciledProviderTransactions, }); v1Route({ method: 'post', path: '/provider-transactions/:id/reconcile', tag: 'Payments', summary: 'Match a provider transaction to a registration', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], params: idParams, body: z.looseObject({}), v1: ptx.reconcileProviderTransaction, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], params: idParams, body: z.looseObject({}), documented: { body: D.obj({ registrationId: D.optStr, eventId: D.optStr.describe('As a donation to this event instead'), userId: D.optStr }), response: txAnswer(D.obj({ transaction: providerTransaction, payment: D.payment, generatedTickets: z.array(D.ticket).optional() })) }, v1: ptx.reconcileProviderTransaction, }); v1Route({ method: 'post', path: '/provider-transactions/:id/ignore', tag: 'Payments', summary: 'Ignore a provider transaction', - access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], params: idParams, body: z.looseObject({}), v1: ptx.ignoreProviderTransaction, + access: 'supervisor', campusScope: UNSCOPED, middleware: [cs.unscopedOnly], params: idParams, body: z.looseObject({}), documented: { response: txAnswer(providerTransaction) }, v1: ptx.ignoreProviderTransaction, }); // ─── Waitlist ──────────────────────────────────────────────────────────────── @@ -202,73 +253,78 @@ v1Route({ v1Route({ method: 'post', path: '/waitlist', tag: 'Waitlist', summary: 'Join a sold-out event\'s waitlist', description: 'Signed in, or with a name and email or phone. When places free up, people are offered them in order.', - access: 'optional', status: 201, body: z.looseObject({ eventId: id }), v1: waitlist.joinWaitlist, + access: 'optional', status: 201, body: z.looseObject({ eventId: id }), documented: { body: D.obj({ eventId: D.str, eventOptionId: D.str, variantId: D.optStr, sessionId: D.optStr.describe('Per-session tickets: the session'), quantity: D.numeric, guestName: D.optStr.describe('Not signed in'), guestEmail: D.optStr, guestPhone: D.optStr }), response: waitlistEntry.extend({ ahead: D.num.describe('People ahead'), message: D.str }) }, v1: waitlist.joinWaitlist, }); -v1Route({ method: 'get', path: '/me/waitlist', tag: 'Me', summary: 'Waitlists I\'m on', access: 'user', v1: waitlist.myWaitlist }); +v1Route({ method: 'get', path: '/me/waitlist', tag: 'Me', summary: 'Waitlists I\'m on', access: 'user', documented: { response: z.array(waitlistEntry) }, v1: waitlist.myWaitlist }); v1Route({ method: 'get', path: '/waitlist/claims/:token', tag: 'Waitlist', summary: 'A waitlist offer', description: 'What an offer link shows (the token is the credential). Register with `waitlistToken` to take it.', - access: 'public', middleware: [linkLimiter()], params: tokenParams, v1: waitlist.claimInfo, + access: 'public', middleware: [linkLimiter()], params: tokenParams, documented: { response: D.obj({ eventId: D.optStr, eventTitle: D.optStr, eventStart: D.optDate, eventOptionId: D.str, optionName: D.str, variantId: D.optStr, variantName: D.optStr, sessionId: D.optStr, sessionName: D.optStr, sessionStart: D.optDate, lineName: D.str, quantity: D.optNum.describe('Places offered'), requested: D.num, expiresAt: D.optDate, name: D.optStr }) }, v1: waitlist.claimInfo, }); v1Route({ method: 'get', path: '/events/:id/waitlist', tag: 'Waitlist', summary: 'An event\'s waitlist', - access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, query: filters('all'), map: asEvent, v1: waitlist.eventWaitlist, + access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, query: filters('all'), map: asEvent, documented: { response: z.array(waitlistEntry.extend({ user: D.userSummary.nullish() })) }, v1: waitlist.eventWaitlist, }); for (const [action, summary, handler] of [['offer', 'Offer someone their places now', waitlist.offerManually], ['move', 'Move someone up or down the waitlist', waitlist.moveEntry], ['remove', 'Take someone off the waitlist', waitlist.removeEntry]] as const) { v1Route({ method: 'post', path: `/waitlist/:id/${action}`, tag: 'Waitlist', summary, access: 'supervisor', campusScope: 'scopeEvent(waitlistEntry)', middleware: [cs.scopeEvent({ resolve: 'waitlistEntry' })], params: idParams, body: z.looseObject({}), v1: handler, + documented: { + body: action === 'offer' ? D.obj({ quantity: D.numeric.optional().describe('Places to offer (default: all they asked for)') }) + : action === 'move' ? D.obj({ direction: z.enum(['up', 'down']) }) : D.anyObj, + response: D.message, + }, }); } -v1Route({ method: 'delete', path: '/waitlist/:id', tag: 'Waitlist', summary: 'Leave a waitlist', access: 'user', params: idParams, v1: waitlist.leaveWaitlist }); +v1Route({ method: 'delete', path: '/waitlist/:id', tag: 'Waitlist', summary: 'Leave a waitlist', access: 'user', params: idParams, documented: { response: D.message }, v1: waitlist.leaveWaitlist }); // ─── Sponsorship ───────────────────────────────────────────────────────────── v1Route({ method: 'get', path: '/events/:id/sponsorship', tag: 'Sponsorship', summary: 'Sponsoring places at an event', - description: 'Whether it\'s on, and the suggested amounts.', access: 'public', params: idParams, map: asEvent, v1: sponsor.getEventSponsorship, + description: 'Whether it\'s on, and the suggested amounts.', access: 'public', params: idParams, map: asEvent, documented: { response: D.obj({ enabled: D.bool, open: D.optBool, spotPrice: D.optRand, showProgress: D.optBool, goalSpots: D.optNum, spotsFunded: D.optNum, sponsors: z.unknown().optional() }) }, v1: sponsor.getEventSponsorship, }); v1Route({ method: 'get', path: '/events/:id/sponsorship/pool', tag: 'Sponsorship', summary: 'The sponsorship pool', - description: 'What\'s been given and what\'s been used.', access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: sponsor.getPool, + description: 'What\'s been given and what\'s been used.', access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: D.obj({ eventId: D.str, spotPrice: D.rand, goalSpots: D.optNum }).describe('Plus the pool: given, used and places funded') }, v1: sponsor.getPool, }); v1Route({ method: 'post', path: '/sponsorships/checkout', tag: 'Sponsorship', summary: 'Give towards places', - description: 'Starts a checkout; answers where to send the person.', access: 'optional', body: z.looseObject({ eventId: id }), v1: sponsor.createSponsorCheckout, + description: 'Starts a checkout; answers where to send the person.', access: 'optional', body: z.looseObject({ eventId: id }), documented: { body: D.obj({ eventId: D.str, spots: D.numeric.optional().describe('Places to fund (or amount)'), amount: D.numeric.optional(), anonymous: D.optBool, sponsorName: D.optStr, message: D.optStr, name: D.optStr.describe('Not signed in'), email: D.optStr, phone: D.optStr, provider: D.optStr }), response: D.checkout.extend({ amount: D.rand }) }, v1: sponsor.createSponsorCheckout, }); // ─── Consent ───────────────────────────────────────────────────────────────── v1Route({ method: 'get', path: '/events/:id/consent', tag: 'Consent', summary: 'Parental consent for an event', - access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: consent.listEventConsent, + access: 'staff', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: D.obj({ event: D.anyObj, counts: z.record(z.string(), z.number()).describe('Status → how many'), rows: z.array(consentRow) }) }, v1: consent.listEventConsent, }); v1Route({ method: 'get', path: '/events/:id/consent/medical', tag: 'Consent', summary: 'Medical notes from consent forms', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: consent.medicalList, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: D.obj({ event: D.eventRef.partial(), rows: z.array(D.obj({ name: D.str, dateOfBirth: D.optDate, parentName: D.optStr, parentPhone: D.optStr, parentEmail: D.optStr, medical: D.anyObj.nullish(), emergency: D.anyObj.nullish(), photoConsent: D.optBool, purged: D.bool.describe('Medical details removed after the event') })) }) }, v1: consent.medicalList, }); v1Route({ method: 'post', path: '/events/:id/consent/resend-pending', tag: 'Consent', summary: 'Remind everyone who hasn\'t answered', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: z.looseObject({}), map: asEvent, v1: consent.resendPending, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, body: z.looseObject({}), map: asEvent, documented: { response: D.obj({ message: D.str, sent: D.num, pending: D.num }) }, v1: consent.resendPending, }); v1Route({ method: 'post', path: '/events/:id/consent/rerequest', tag: 'Consent', summary: 'Ask for consent again', description: 'After the consent wording changed.', access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, - body: z.looseObject({}), map: ctx => ({ params: { eventId: ctx.params.id }, body: ctx.req.body }), v1: consent.rerequestConsent, + body: z.looseObject({}), map: ctx => ({ params: { eventId: ctx.params.id }, body: ctx.req.body }), documented: { response: D.obj({ message: D.str, created: D.num }) }, v1: consent.rerequestConsent, }); v1Route({ method: 'post', path: '/consent-requests/:id/resend', tag: 'Consent', summary: 'Send a consent request again', access: 'user', campusScope: 'scopeEvent(consentRequest, owner-ok)', middleware: [cs.scopeEvent({ resolve: 'consentRequest', ownerOk: true })], params: idParams, - body: z.looseObject({}), v1: consent.resendRequest, + body: z.looseObject({}), documented: { response: D.message }, v1: consent.resendRequest, }); v1Route({ method: 'get', path: '/consent/:token', tag: 'Consent', summary: 'A consent form', description: 'What the link in a consent request shows (the token is the parent\'s credential).', - access: 'public', middleware: [linkLimiter()], params: tokenParams, v1: consent.getConsent, + access: 'public', middleware: [linkLimiter()], params: tokenParams, documented: { response: D.obj({ status: D.str, superseded: D.bool, expired: D.bool, respondedAt: D.optDate, attendeeName: D.str, parentName: D.optStr, consentText: D.str, textVersion: D.optNum, event: D.obj({ title: D.str, startDate: D.date, endDate: D.date, location: D.optStr }), collect: D.obj({ medical: D.bool, emergency: D.bool, photo: D.bool }).describe('What the form asks for') }) }, v1: consent.getConsent, }); v1Route({ method: 'post', path: '/consent/:token', tag: 'Consent', summary: 'Answer a consent form', - access: 'public', middleware: [linkLimiter()], params: tokenParams, body: z.looseObject({}), v1: consent.answerConsent, + access: 'public', middleware: [linkLimiter()], params: tokenParams, body: z.looseObject({}), documented: { body: D.obj({ decision: z.enum(['give', 'decline']), signedName: D.str, isGuardian: D.bool.describe('Must be true'), medical: D.obj({ allergies: D.optStr, medication: D.optStr, conditions: D.optStr, medicalAid: D.optStr }).optional(), emergency: D.obj({ name: D.str, phone: D.str, relationship: D.optStr }).optional(), photoConsent: D.optBool }), response: D.obj({ message: D.str, status: z.enum(['given', 'declined']) }) }, v1: consent.answerConsent, }); // ─── Attendee form answers ─────────────────────────────────────────────────── @@ -276,35 +332,35 @@ v1Route({ v1Route({ method: 'get', path: '/form-responses', tag: 'Registrations', summary: 'Attendee form answers', description: 'For an event (`eventId`) or a registration (`registrationId`), for events you may see.', - access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'registrationId', 'userId', 'cursor'), v1: forms.listFormResponses, + access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'registrationId', 'userId', 'cursor'), documented: { response: D.obj({ items: z.array(D.obj({ id: D.str, registrationId: D.str, attendeeId: D.optStr, createdAt: D.date, answers: z.array(D.obj({ fieldId: D.str, value: D.str })).optional() })), nextCursor: D.optStr.describe('Pass as `cursor` for the next page') }) }, v1: forms.listFormResponses, }); // ─── Feedback ──────────────────────────────────────────────────────────────── v1Route({ - method: 'get', path: '/feedback/summary', tag: 'Feedback', summary: 'Feedback across events', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventIds'), v1: feedback.getSummary, + method: 'get', path: '/feedback/summary', tag: 'Feedback', summary: 'Feedback across events', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventIds'), documented: { response: z.array(D.obj({ eventId: D.str, title: D.str, startDate: D.date, anonymous: D.bool, sentAt: D.optDate, invited: D.num, responses: D.num, responseRate: D.optNum.describe('%'), questions: z.array(D.anyObj).describe('Each question with its answers summarised') })) }, v1: feedback.getSummary, }); v1Route({ method: 'get', path: '/feedback-forms/:token', tag: 'Feedback', summary: 'A feedback form', - description: 'What the link sent after an event shows (the token is the credential).', access: 'public', params: tokenParams, v1: feedback.getPublicForm, + description: 'What the link sent after an event shows (the token is the credential).', access: 'public', params: tokenParams, documented: { response: D.obj({ event: D.anyObj, name: D.str, intro: D.optStr, anonymous: D.bool, responded: D.bool, fields: z.array(feedbackField) }) }, v1: feedback.getPublicForm, }); v1Route({ method: 'post', path: '/feedback-forms/:token', tag: 'Feedback', summary: 'Answer a feedback form', - access: 'public', params: tokenParams, body: z.looseObject({}), v1: feedback.submitPublicForm, + access: 'public', params: tokenParams, body: z.looseObject({}), documented: { body: D.obj({ answers: z.record(z.string(), z.unknown()).describe('Field id → answer') }), response: D.message }, v1: feedback.submitPublicForm, }); v1Route({ method: 'get', path: '/events/:id/feedback', tag: 'Feedback', summary: 'An event\'s feedback set-up and answers', - access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, v1: feedback.getEventFeedback, + access: 'supervisor', campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()], params: idParams, map: asEvent, documented: { response: feedbackForm }, v1: feedback.getEventFeedback, }); v1Route({ method: 'put', path: '/events/:id/feedback', tag: 'Feedback', summary: 'Set up an event\'s feedback form', - access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, body: z.looseObject({}), map: asEvent, v1: feedback.saveEventFeedback, + access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, body: z.looseObject({}), map: asEvent, documented: { body: D.obj({ sendAt: D.optDate, audience: D.optStr.describe('checked_in or everyone'), anonymous: D.optBool, intro: D.optStr, fields: z.array(feedbackField) }), response: feedbackForm }, v1: feedback.saveEventFeedback, }); v1Route({ method: 'delete', path: '/events/:id/feedback', tag: 'Feedback', summary: 'Remove an event\'s feedback form', - access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, v1: feedback.deleteEventFeedback, + access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, map: asEvent, documented: { response: D.message }, v1: feedback.deleteEventFeedback, }); v1Route({ method: 'post', path: '/events/:id/feedback/send-now', tag: 'Feedback', summary: 'Send the feedback form now', - access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, body: z.looseObject({}), map: asEvent, v1: feedback.sendNow, + access: 'supervisor', campusScope: 'scopeEvent(manage)', middleware: [cs.scopeEvent({ need: 'manage' })], params: idParams, body: z.looseObject({}), map: asEvent, documented: { response: D.obj({ invited: D.num, message: D.str }) }, v1: feedback.sendNow, }); diff --git a/apps/events/backend/src/v2/resources/peopleMessaging.ts b/apps/events/backend/src/v2/resources/peopleMessaging.ts index 9b885c9..732618f 100644 --- a/apps/events/backend/src/v2/resources/peopleMessaging.ts +++ b/apps/events/backend/src/v2/resources/peopleMessaging.ts @@ -9,6 +9,7 @@ import { z } from 'zod'; import type { Request } from 'express'; import { id, idParams } from '../schemas'; import { v1Route } from '../viaV1'; +import * as D from '../docs'; /* eslint-disable @typescript-eslint/no-explicit-any -- v1 handlers and middleware are JavaScript */ const rateLimit = require('express-rate-limit') as (opts: object) => any; @@ -38,38 +39,76 @@ const dashboardRouter = require('../../routes/dashboardRoutes'); const loose = z.looseObject({}); const filters = (...names: string[]) => z.looseObject(Object.fromEntries(names.map(n => [n, z.string().max(4000).optional()]))); const SCOPE_LIST = 'scopeList (the handler filters by listWhere)'; + +// ─── Documented shapes (docs.ts) ───────────────────────────────────────────── + +const challenge = D.obj({ challengeId: D.str, method: z.enum(['email', 'whatsapp']), destination: D.str.describe('Where the code went, partly hidden') }); +const signedIn = D.obj({ message: D.optStr, id: D.str, name: D.str, email: D.str, role: D.str, token: D.str.describe('A new sign-in token') }); +const kind = z.enum(['update', 'news']).describe('update: about something they booked (always sent). news: needs their news consent'); +const attendeeFilter = D.obj({ + status: D.optStr.describe('any, paid, unpaid, checked_in, not_checked_in…'), attendeeIds: D.ids.optional(), registrationIds: D.ids.optional(), + allocationGroupId: D.optStr.describe('People in one room or group'), name: D.optStr, email: D.optStr, phone: D.optStr, + audience: z.enum(['sponsors']).optional().describe('Sponsors of the event instead'), +}); +const emailAttendees = D.obj({ + subject: D.optStr, html: D.optStr, text: D.optStr.describe('subject and html or text, unless template is tickets'), + template: z.enum(['custom', 'tickets', 'payment_reminder', 'event_reminder']).optional().describe('tickets: send everyone their tickets; the reminders fill in a standard message'), filter: attendeeFilter.optional(), + dryRun: D.optBool.describe('Only say who it would reach'), kind: kind.optional(), promoEventId: D.optStr.describe('Promote another event (news)'), +}); +const whatsappAttendees = D.obj({ + message: D.optStr.describe('Required unless template is tickets'), template: z.enum(['custom', 'tickets', 'payment_reminder', 'event_reminder']).optional(), filter: attendeeFilter.optional(), + dryRun: D.optBool, kind: kind.optional(), promoEventId: D.optStr, +}); +const reach = D.obj({ eventId: D.optStr, kind: D.optStr, matched: D.num, skipped: D.optNum.describe('Left out: no news consent'), recipients: z.array(D.anyObj).optional().describe('The first 20'), queued: D.optNum, template: D.optStr, sent: D.optNum }); +const scheduledJob = D.obj({ + id: D.str, kind: D.str.describe('broadcast or attendees'), eventId: D.optStr, broadcast: D.bool, channel: z.enum(['email', 'whatsapp']).or(D.str), + recipient: D.optStr, scheduledAt: D.date, createdAt: D.date, status: D.str.describe('queued, sent, failed, cancelled'), attempts: D.num, + sentAt: D.optDate, lastError: D.optStr, subject: D.str, html: D.str, text: D.str, message: D.str, hasHtml: D.bool, hasText: D.bool, +}); +const scheduled = D.obj({ message: D.str, job: D.anyObj }); +const bannerShape = D.obj({ message: D.str, type: D.str.describe('info, warning, success, error'), liveFrom: D.optDate, liveTill: D.optDate }); +const savedFilter = D.obj({ id: D.str, page: D.str.describe('The list page it belongs to'), name: D.str, params: D.anyObj.describe('The filters'), isDefault: D.bool, updatedAt: D.date }); +const scanStats = D.obj({ totalToday: D.num, myToday: D.num, lastHour: D.num, byStaff: z.array(D.anyObj) }).partial(); +const monthly = D.obj({ thisMonth: D.num, lastMonth: D.num, pctChange: D.optNum }); +const reportBody = D.obj({ + title: D.str, subtitle: D.optStr, kind: z.enum(['table', 'layered']), + table: D.obj({ columns: z.array(D.str), rows: z.array(z.array(z.unknown())) }).optional().describe('kind table'), + layered: D.obj({ header: D.optStr, sections: z.array(D.anyObj) }).optional().describe('kind layered: titled sections, each with its rows'), + orientation: z.enum(['portrait', 'landscape']).optional(), stats: z.array(D.anyObj).optional().describe('Figures shown above the table'), + chart: D.anyObj.optional(), note: D.optStr, extraTables: z.array(D.anyObj).optional(), +}); /** The query string of the v2 request, for a v1 router's URL. */ const qs = (req: Request) => (req.originalUrl.includes('?') ? req.originalUrl.slice(req.originalUrl.indexOf('?')) : ''); // ─── Accounts ──────────────────────────────────────────────────────────────── -v1Route({ method: 'post', path: '/auth/login/code/resend', tag: 'Accounts', summary: 'Send the sign-in code again', access: 'public', middleware: [loginLimiter], body: loose, v1: users.resendLoginTwoFactor }); -v1Route({ method: 'post', path: '/auth/password/forgot', tag: 'Accounts', summary: 'Email me a link to reset my password', description: 'Always the same answer, so it doesn\'t say whether an account has that email. Rate-limited like sign-in.', access: 'public', middleware: [loginLimiter], body: z.looseObject({ email: z.string().max(200) }), v1: users.requestPasswordReset }); -v1Route({ method: 'post', path: '/auth/password/reset', tag: 'Accounts', summary: 'Set a new password with a reset link', access: 'public', body: loose, v1: users.resetPassword }); -v1Route({ method: 'post', path: '/auth/activate', tag: 'Accounts', summary: 'Activate an account with its link', access: 'public', body: loose, v1: users.activateAccount }); -v1Route({ method: 'post', path: '/me/sessions/revoke', tag: 'Me', summary: 'Sign out everywhere else', access: 'user', body: loose, v1: users.revokeMySession }); -v1Route({ method: 'post', path: '/me/close', tag: 'Me', summary: 'Close my account', description: 'Needs the password. Personal details are removed; payment records stay, anonymised.', access: 'user', body: loose, v1: users.closeAccount }); -v1Route({ method: 'get', path: '/me/activity', tag: 'Me', summary: 'Recent sign-ins and changes to my account', access: 'user', v1: users.getMyActivity }); -v1Route({ method: 'post', path: '/me/verify-password', tag: 'Me', summary: 'Check my password (before a sensitive change)', access: 'user', middleware: [loginLimiter], body: loose, v1: users.verifyPassword }); -v1Route({ method: 'post', path: '/me/two-factor/enable', tag: 'Me', summary: 'Start turning on two-step sign-in', description: 'Sends a code to confirm with.', access: 'user', middleware: [loginLimiter], body: loose, v1: users.startEnableTwoFactor }); -v1Route({ method: 'post', path: '/me/two-factor/confirm', tag: 'Me', summary: 'Confirm two-step sign-in with the code', access: 'user', middleware: [loginLimiter], body: loose, v1: users.confirmEnableTwoFactor }); -v1Route({ method: 'post', path: '/me/two-factor/disable', tag: 'Me', summary: 'Turn off two-step sign-in', access: 'user', middleware: [loginLimiter], body: loose, v1: users.disableTwoFactor }); +v1Route({ method: 'post', path: '/auth/login/code/resend', tag: 'Accounts', summary: 'Send the sign-in code again', access: 'public', middleware: [loginLimiter], body: loose, documented: { body: D.obj({ challengeId: D.str }), response: challenge }, v1: users.resendLoginTwoFactor }); +v1Route({ method: 'post', path: '/auth/password/forgot', tag: 'Accounts', summary: 'Email me a link to reset my password', description: 'Always the same answer, so it doesn\'t say whether an account has that email. Rate-limited like sign-in.', access: 'public', middleware: [loginLimiter], body: z.looseObject({ email: z.string().max(200) }), documented: { response: D.message }, v1: users.requestPasswordReset }); +v1Route({ method: 'post', path: '/auth/password/reset', tag: 'Accounts', summary: 'Set a new password with a reset link', access: 'public', body: loose, documented: { body: D.obj({ token: D.str.describe('From the link'), password: D.str }), response: D.message }, v1: users.resetPassword }); +v1Route({ method: 'post', path: '/auth/activate', tag: 'Accounts', summary: 'Activate an account with its link', access: 'public', body: loose, documented: { body: D.obj({ token: D.str.describe('From the link'), password: D.str.describe('At least 8 characters'), acceptTerms: D.optBool }), response: signedIn }, v1: users.activateAccount }); +v1Route({ method: 'post', path: '/me/sessions/revoke', tag: 'Me', summary: 'Sign out everywhere else', access: 'user', body: loose, documented: { response: D.obj({ message: D.str, token: D.str.describe('A new token for this device (the old one stops working)') }) }, v1: users.revokeMySession }); +v1Route({ method: 'post', path: '/me/close', tag: 'Me', summary: 'Close my account', description: 'Needs the password. Personal details are removed; payment records stay, anonymised.', access: 'user', body: loose, documented: { body: D.obj({ password: D.str, deleteData: D.optBool.describe('Also ask for my personal information to be deleted') }), response: D.message }, v1: users.closeAccount }); +v1Route({ method: 'get', path: '/me/activity', tag: 'Me', summary: 'Recent sign-ins and changes to my account', access: 'user', documented: { response: z.array(D.obj({ id: D.str, type: D.str.describe('login, password_changed, two_factor_enabled…'), device: D.optStr, createdAt: D.date })) }, v1: users.getMyActivity }); +v1Route({ method: 'post', path: '/me/verify-password', tag: 'Me', summary: 'Check my password (before a sensitive change)', access: 'user', middleware: [loginLimiter], body: loose, documented: { body: D.obj({ password: D.str }), response: D.ok }, v1: users.verifyPassword }); +v1Route({ method: 'post', path: '/me/two-factor/enable', tag: 'Me', summary: 'Start turning on two-step sign-in', description: 'Sends a code to confirm with.', access: 'user', middleware: [loginLimiter], body: loose, documented: { body: D.obj({ method: z.enum(['email', 'whatsapp']), password: D.str }), response: challenge }, v1: users.startEnableTwoFactor }); +v1Route({ method: 'post', path: '/me/two-factor/confirm', tag: 'Me', summary: 'Confirm two-step sign-in with the code', access: 'user', middleware: [loginLimiter], body: loose, documented: { body: D.obj({ challengeId: D.str, code: D.str }), response: D.obj({ twoFactorEnabled: z.literal(true), twoFactorMethod: D.str }) }, v1: users.confirmEnableTwoFactor }); +v1Route({ method: 'post', path: '/me/two-factor/disable', tag: 'Me', summary: 'Turn off two-step sign-in', access: 'user', middleware: [loginLimiter], body: loose, documented: { body: D.obj({ password: D.str }), response: D.obj({ twoFactorEnabled: z.literal(false), twoFactorMethod: z.null() }) }, v1: users.disableTwoFactor }); v1Route({ method: 'get', path: '/users/exists', tag: 'Accounts', summary: 'Is there an account with this email or phone?', access: 'supervisor', campusScope: 'campusIndependent (accounts are shared across campuses)', middleware: [cs.campusIndependent('accounts are shared across campuses')], - query: filters('email', 'phone', 'phoneNumber'), v1: users.checkUserExists, + query: filters('email', 'phone', 'phoneNumber'), documented: { response: D.obj({ exists: D.bool, hasEmail: D.optBool, hasPhone: D.optBool, user: D.obj({ id: D.str, name: D.str, email: D.optStr, phoneNumber: D.optStr, notificationPreference: D.optStr }).nullish() }) }, v1: users.checkUserExists, }); v1Route({ method: 'get', path: '/users', tag: 'Accounts', summary: 'Every account', description: 'Paged (`page`, `limit`) and searchable (`q`, `role`, `campus`, …) — see v1 for every filter.', access: 'supervisor', campusScope: 'campusIndependent (accounts are shared across campuses)', middleware: [cs.campusIndependent('accounts are shared across campuses')], - query: filters('page', 'limit', 'search', 'role', 'isActive', 'campus'), v1: users.getUsers, + query: filters('page', 'limit', 'search', 'role', 'isActive', 'campus'), documented: { response: D.v1Page(D.user) }, v1: users.getUsers, }); -v1Route({ method: 'get', path: '/users/:id', tag: 'Accounts', summary: 'One account', access: 'admin', params: idParams, v1: users.getUserById }); -v1Route({ method: 'patch', path: '/users/:id', tag: 'Accounts', summary: 'Change an account', description: 'Name, contact details, role, campus limits, active.', access: 'admin', params: idParams, body: loose, v1: users.updateUser }); -v1Route({ method: 'delete', path: '/users/:id', tag: 'Accounts', summary: 'Delete an account', access: 'admin', params: idParams, v1: users.deleteUser }); -v1Route({ method: 'post', path: '/users/:id/sessions/revoke', tag: 'Accounts', summary: 'Sign someone out everywhere', access: 'admin', params: idParams, body: loose, v1: users.adminRevokeUserSessions }); -v1Route({ method: 'post', path: '/users/:id/anonymize', tag: 'Accounts', summary: 'Anonymise an account', description: 'Admins. Personal details are removed for good; payment records stay.', access: 'admin', params: idParams, body: loose, v1: users.anonymizeUser }); +v1Route({ method: 'get', path: '/users/:id', tag: 'Accounts', summary: 'One account', access: 'admin', params: idParams, documented: { response: D.user.extend({ scopedCampusIds: D.ids.optional().describe('Campuses they\'re limited to') }) }, v1: users.getUserById }); +v1Route({ method: 'patch', path: '/users/:id', tag: 'Accounts', summary: 'Change an account', description: 'Name, contact details, role, campus limits, active.', access: 'admin', params: idParams, body: loose, documented: { body: D.obj({ name: D.optStr, email: D.optStr, phoneNumber: D.optStr, role: D.optStr.describe('admin, supervisor, staff or user'), isActive: D.optBool, password: D.optStr.describe('Set a new password'), notificationPreference: D.optStr.describe('email, whatsapp or both'), twoFactorEnabled: D.optBool.describe('Only to turn it off'), scopedCampusIds: D.ids.optional().describe('Limit staff to these campuses (empty: all)') }), response: D.user }, v1: users.updateUser }); +v1Route({ method: 'delete', path: '/users/:id', tag: 'Accounts', summary: 'Delete an account', access: 'admin', params: idParams, documented: { response: D.message }, v1: users.deleteUser }); +v1Route({ method: 'post', path: '/users/:id/sessions/revoke', tag: 'Accounts', summary: 'Sign someone out everywhere', access: 'admin', params: idParams, body: loose, documented: { response: D.message }, v1: users.adminRevokeUserSessions }); +v1Route({ method: 'post', path: '/users/:id/anonymize', tag: 'Accounts', summary: 'Anonymise an account', description: 'Admins. Personal details are removed for good; payment records stay.', access: 'admin', params: idParams, body: loose, documented: { response: D.message }, v1: users.anonymizeUser }); // ─── Messaging an event's people ───────────────────────────────────────────── @@ -77,62 +116,72 @@ const toEvent = { campusScope: 'scopeEvent(view)', middleware: [cs.scopeEvent()] v1Route({ method: 'get', path: '/event-listing', tag: 'Events', summary: 'Upcoming public events in full', description: 'What the site\'s event lists show (ticket options, prices, early-bird tiers), not paged. `campus` (id or slug) and `series` (slug) narrow it. For a paged, slimmer list use GET /events.', - access: 'public', query: filters('campus', 'series'), v1: events.getEvents, + access: 'public', query: filters('campus', 'series'), documented: { response: z.array(D.event.extend({ eventOptions: z.array(D.eventOption).optional(), isSoldOut: D.optBool })) }, v1: events.getEvents, }); -v1Route({ method: 'get', path: '/admin/events', tag: 'Events (staff)', summary: 'Every event, including deactivated ones', access: 'admin', v1: events.getAllEvents }); -v1Route({ method: 'post', path: '/events/:id/email-attendees', tag: 'Messaging', summary: 'Email an event\'s people', description: 'Filtered by status or chosen people; news consent is checked.', access: 'supervisor', ...toEvent, params: idParams, body: loose, v1: events.emailEventAttendees }); -v1Route({ method: 'post', path: '/events/:id/email-attendees/schedule', tag: 'Messaging', summary: 'Schedule an email to an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, v1: events.scheduleEmailEventAttendees }); -v1Route({ method: 'post', path: '/events/:id/whatsapp-attendees', tag: 'Messaging', summary: 'WhatsApp an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, v1: events.whatsappEventAttendees }); -v1Route({ method: 'post', path: '/events/:id/whatsapp-attendees/schedule', tag: 'Messaging', summary: 'Schedule a WhatsApp to an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, v1: events.scheduleWhatsappEventAttendees }); +v1Route({ method: 'get', path: '/admin/events', tag: 'Events (staff)', summary: 'Every event, including deactivated ones', access: 'admin', documented: { response: z.array(D.event) }, v1: events.getAllEvents }); +v1Route({ method: 'post', path: '/events/:id/email-attendees', tag: 'Messaging', summary: 'Email an event\'s people', description: 'Filtered by status or chosen people; news consent is checked.', access: 'supervisor', ...toEvent, params: idParams, body: loose, documented: { body: emailAttendees, response: reach }, v1: events.emailEventAttendees }); +v1Route({ method: 'post', path: '/events/:id/email-attendees/schedule', tag: 'Messaging', summary: 'Schedule an email to an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, documented: { body: emailAttendees.extend({ scheduledAt: D.date }), response: scheduled }, v1: events.scheduleEmailEventAttendees }); +v1Route({ method: 'post', path: '/events/:id/whatsapp-attendees', tag: 'Messaging', summary: 'WhatsApp an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, documented: { body: whatsappAttendees, response: reach }, v1: events.whatsappEventAttendees }); +v1Route({ method: 'post', path: '/events/:id/whatsapp-attendees/schedule', tag: 'Messaging', summary: 'Schedule a WhatsApp to an event\'s people', access: 'supervisor', ...toEvent, params: idParams, body: loose, documented: { body: whatsappAttendees.extend({ scheduledAt: D.date }), response: scheduled }, v1: events.scheduleWhatsappEventAttendees }); for (const [channel, field, ctrl] of [['email', 'emails', bc], ['whatsapp', 'phones', wbc]] as const) { const scope = { campusScope: `scopeBroadcast(freeform ${field})`, middleware: [cs.scopeBroadcast({ freeformField: field })] }; const [preview, send, schedule] = channel === 'email' ? [ctrl.previewBroadcast, ctrl.sendBroadcast, ctrl.scheduleBroadcast] : [ctrl.previewWhatsAppBroadcast, ctrl.sendWhatsAppBroadcast, ctrl.scheduleWhatsAppBroadcast]; const name = channel === 'email' ? 'an email' : 'a WhatsApp'; - v1Route({ method: 'post', path: `/broadcasts/${channel}/preview`, tag: 'Messaging', summary: `Who ${name} broadcast would reach`, access: 'supervisor', ...scope, body: loose, v1: preview }); - v1Route({ method: 'post', path: `/broadcasts/${channel}/send`, tag: 'Messaging', summary: `Send ${name} broadcast`, description: 'To campuses, events, roles or listed people; news consent is checked.', access: 'supervisor', ...scope, body: loose, v1: send }); - v1Route({ method: 'post', path: `/broadcasts/${channel}/schedule`, tag: 'Messaging', summary: `Schedule ${name} broadcast`, access: 'supervisor', ...scope, body: loose, v1: schedule }); + const who = D.obj({ + userIds: D.ids.optional().describe('Chosen accounts'), + ...(channel === 'email' ? { emails: D.optStr.describe('Typed-in addresses, separated by commas or new lines') } : { phones: D.optStr.describe('Typed-in numbers, separated by commas or new lines') }), + eventId: D.optStr.describe('Everyone registered for this event'), kind: kind.optional().describe('Default news'), + }); + const content = channel === 'email' ? { subject: D.str, html: D.optStr, text: D.optStr } : { message: D.str }; + v1Route({ method: 'post', path: `/broadcasts/${channel}/preview`, tag: 'Messaging', summary: `Who ${name} broadcast would reach`, access: 'supervisor', ...scope, body: loose, documented: { body: who, response: reach.extend({ event: D.anyObj.nullish(), placeholders: z.array(D.str).optional() }) }, v1: preview }); + v1Route({ method: 'post', path: `/broadcasts/${channel}/send`, tag: 'Messaging', summary: `Send ${name} broadcast`, description: 'To campuses, events, roles or listed people; news consent is checked.', access: 'supervisor', ...scope, body: loose, documented: { body: who.extend(content), response: reach }, v1: send }); + v1Route({ method: 'post', path: `/broadcasts/${channel}/schedule`, tag: 'Messaging', summary: `Schedule ${name} broadcast`, access: 'supervisor', ...scope, body: loose, documented: { body: who.extend(content).extend({ scheduledAt: D.date }), response: scheduled }, v1: schedule }); } -v1Route({ method: 'get', path: '/scheduled-messages', tag: 'Messaging', summary: 'Scheduled emails and WhatsApps', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('status', 'eventId', 'channel'), v1: sched.listScheduledEmails }); -v1Route({ method: 'patch', path: '/scheduled-messages/:id', tag: 'Messaging', summary: 'Change a scheduled message', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], params: idParams, body: loose, v1: sched.updateScheduledEmail }); -v1Route({ method: 'delete', path: '/scheduled-messages/:id', tag: 'Messaging', summary: 'Cancel a scheduled message', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], params: idParams, v1: sched.deleteScheduledEmail }); +v1Route({ method: 'get', path: '/scheduled-messages', tag: 'Messaging', summary: 'Scheduled emails and WhatsApps', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('status', 'eventId', 'channel'), documented: { response: D.obj({ jobs: z.array(scheduledJob) }) }, v1: sched.listScheduledEmails }); +v1Route({ method: 'patch', path: '/scheduled-messages/:id', tag: 'Messaging', summary: 'Change a scheduled message', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], params: idParams, body: loose, documented: { body: D.obj({ scheduledAt: D.optDate, subject: D.optStr, html: D.optStr, text: D.optStr, message: D.optStr.describe('WhatsApp') }), response: D.obj({ message: D.str, job: scheduledJob }) }, v1: sched.updateScheduledEmail }); +v1Route({ method: 'delete', path: '/scheduled-messages/:id', tag: 'Messaging', summary: 'Cancel a scheduled message', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], params: idParams, documented: { response: D.message }, v1: sched.deleteScheduledEmail }); v1Route({ method: 'post', path: '/automations/schedule', tag: 'Messaging', summary: 'Schedule an event\'s reminder messages', - access: 'supervisor', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], body: z.looseObject({ eventId: id }), v1: auto.scheduleAutomations, + access: 'supervisor', campusScope: 'scopeEvent(body.eventId)', middleware: [cs.scopeEvent({ from: (req: any) => req.body?.eventId })], body: z.looseObject({ eventId: id }), documented: { body: D.obj({ eventId: D.str, jobs: z.array(D.obj({ scheduledAt: D.date, subject: D.str, html: D.optStr, text: D.optStr, audience: z.enum(['sponsors']).optional(), promoEventId: D.optStr })).min(1) }), response: D.obj({ message: D.str, jobs: z.array(D.anyObj) }) }, v1: auto.scheduleAutomations, }); // ─── WhatsApp connection (admins) ──────────────────────────────────────────── -v1Route({ method: 'get', path: '/whatsapp/config', tag: 'WhatsApp', summary: 'The WhatsApp connection settings', access: 'admin', v1: wa.getConfigHandler }); -v1Route({ method: 'put', path: '/whatsapp/config', tag: 'WhatsApp', summary: 'Change the WhatsApp connection settings', access: 'admin', body: loose, v1: wa.saveConfigHandler }); -v1Route({ method: 'post', path: '/whatsapp/instance', tag: 'WhatsApp', summary: 'Create the WhatsApp instance', access: 'admin', body: loose, v1: wa.createInstanceHandler }); -v1Route({ method: 'delete', path: '/whatsapp/instance', tag: 'WhatsApp', summary: 'Delete the WhatsApp instance', access: 'admin', v1: wa.deleteInstanceHandler }); -v1Route({ method: 'get', path: '/whatsapp/status', tag: 'WhatsApp', summary: 'Is WhatsApp connected?', access: 'admin', v1: wa.getStatusHandler }); -v1Route({ method: 'get', path: '/whatsapp/qr', tag: 'WhatsApp', summary: 'The QR code to link a phone', access: 'admin', v1: wa.getQrHandler }); +v1Route({ method: 'get', path: '/whatsapp/config', tag: 'WhatsApp', summary: 'The WhatsApp connection settings', access: 'admin', documented: { response: D.obj({ tokenMasked: D.str, instanceId: D.str, hasToken: D.bool, hasInstance: D.bool, configured: D.bool, webhookUrl: D.optStr }) }, v1: wa.getConfigHandler }); +v1Route({ method: 'put', path: '/whatsapp/config', tag: 'WhatsApp', summary: 'Change the WhatsApp connection settings', access: 'admin', body: loose, documented: { body: D.obj({ token: D.optStr, instanceId: D.optStr }), response: D.message }, v1: wa.saveConfigHandler }); +v1Route({ method: 'post', path: '/whatsapp/instance', tag: 'WhatsApp', summary: 'Create the WhatsApp instance', access: 'admin', body: loose, documented: { body: D.obj({ name: D.optStr }), response: D.obj({ message: D.str }).describe('Plus what the WhatsApp service answered') }, v1: wa.createInstanceHandler }); +v1Route({ method: 'delete', path: '/whatsapp/instance', tag: 'WhatsApp', summary: 'Delete the WhatsApp instance', access: 'admin', documented: { response: D.obj({ message: D.str }).describe('Plus what the WhatsApp service answered') }, v1: wa.deleteInstanceHandler }); +v1Route({ method: 'get', path: '/whatsapp/status', tag: 'WhatsApp', summary: 'Is WhatsApp connected?', access: 'admin', documented: { response: D.anyObj.describe('The WhatsApp service\'s status answer') }, v1: wa.getStatusHandler }); +v1Route({ method: 'get', path: '/whatsapp/qr', tag: 'WhatsApp', summary: 'The QR code to link a phone', access: 'admin', documented: { response: D.anyObj.describe('The WhatsApp service\'s answer, with the QR code image') }, v1: wa.getQrHandler }); for (const [action, summary, handler] of [['request-code', 'Link a phone with a code instead', wa.requestCodeHandler], ['logout', 'Unlink the phone', wa.logoutHandler], ['start', 'Start the WhatsApp session', wa.startHandler], ['restart', 'Restart the WhatsApp session', wa.restartHandler]] as const) { - v1Route({ method: 'post', path: `/whatsapp/${action}`, tag: 'WhatsApp', summary, access: 'admin', body: loose, v1: handler }); + v1Route({ + method: 'post', path: `/whatsapp/${action}`, tag: 'WhatsApp', summary, access: 'admin', body: loose, + documented: { body: action === 'request-code' ? D.obj({ phoneNumber: D.str }) : D.anyObj, response: D.anyObj.describe('The WhatsApp service\'s answer') }, + v1: handler, + }); } // ─── Banner, saved filters, dashboards, stats, analytics, reports ──────────── -v1Route({ method: 'get', path: '/banner', tag: 'Site', summary: 'The site-wide banner', access: 'public', v1: banner.getBanner }); -v1Route({ method: 'put', path: '/banner', tag: 'Site', summary: 'Set the site-wide banner', access: 'supervisor', campusScope: 'unscopedOnly (admins and unscoped supervisors)', middleware: [cs.unscopedOnly], body: loose, v1: banner.setBanner }); +v1Route({ method: 'get', path: '/banner', tag: 'Site', summary: 'The site-wide banner', access: 'public', documented: { response: bannerShape }, v1: banner.getBanner }); +v1Route({ method: 'put', path: '/banner', tag: 'Site', summary: 'Set the site-wide banner', access: 'supervisor', campusScope: 'unscopedOnly (admins and unscoped supervisors)', middleware: [cs.unscopedOnly], body: loose, documented: { body: bannerShape.partial().describe('An empty message takes the banner down'), response: bannerShape }, v1: banner.setBanner }); const OWN = 'campusIndependent (a person\'s own saved filters)'; -v1Route({ method: 'get', path: '/saved-filters', tag: 'Me', summary: 'My saved filters', description: 'For one list page (`page`).', access: 'staff', campusScope: OWN, query: filters('page'), v1: savedFilterRouter, map: ctx => ({ url: `/${qs(ctx.req)}` }) }); -v1Route({ method: 'post', path: '/saved-filters', tag: 'Me', summary: 'Save a filter', description: 'By name (replaces one with the same name); up to 30 per page.', access: 'staff', campusScope: OWN, body: loose, v1: savedFilterRouter, map: () => ({ url: '/' }) }); -v1Route({ method: 'put', path: '/saved-filters/:id', tag: 'Me', summary: 'Change a saved filter', access: 'staff', campusScope: OWN, params: idParams, body: loose, v1: savedFilterRouter, map: ctx => ({ url: `/${encodeURIComponent(ctx.params.id)}` }) }); -v1Route({ method: 'delete', path: '/saved-filters/:id', tag: 'Me', summary: 'Delete a saved filter', access: 'staff', campusScope: OWN, params: idParams, v1: savedFilterRouter, map: ctx => ({ url: `/${encodeURIComponent(ctx.params.id)}` }) }); -v1Route({ method: 'get', path: '/dashboard/today', tag: 'Dashboard', summary: 'Today at a glance', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], v1: dashboardRouter, map: ctx => ({ url: `/today${qs(ctx.req)}` }) }); -v1Route({ method: 'get', path: '/dashboard/search', tag: 'Dashboard', summary: 'Search people, registrations and events', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('q'), v1: dashboardRouter, map: ctx => ({ url: `/search${qs(ctx.req)}` }) }); -v1Route({ method: 'get', path: '/stats/staff', tag: 'Dashboard', summary: 'Staff dashboard numbers', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], v1: stats.getStaffDashboardStats }); -v1Route({ method: 'get', path: '/stats/supervisor', tag: 'Dashboard', summary: 'Supervisor dashboard numbers', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], v1: stats.getSupervisorDashboardStats }); -v1Route({ method: 'get', path: '/stats/admin', tag: 'Dashboard', summary: 'Admin dashboard numbers', access: 'admin', v1: stats.getAdminDashboardStats }); -v1Route({ method: 'get', path: '/stats/overview', tag: 'Dashboard', summary: 'Overview numbers', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('from', 'to', 'campus'), v1: stats.getOverviewStats }); +v1Route({ method: 'get', path: '/saved-filters', tag: 'Me', summary: 'My saved filters', description: 'For one list page (`page`).', access: 'staff', campusScope: OWN, query: filters('page'), documented: { response: z.array(savedFilter) }, v1: savedFilterRouter, map: ctx => ({ url: `/${qs(ctx.req)}` }) }); +v1Route({ method: 'post', path: '/saved-filters', tag: 'Me', summary: 'Save a filter', description: 'By name (replaces one with the same name); up to 30 per page.', access: 'staff', campusScope: OWN, body: loose, documented: { body: D.obj({ page: D.str, name: D.str, params: D.anyObj, isDefault: D.optBool }), response: savedFilter }, v1: savedFilterRouter, map: () => ({ url: '/' }) }); +v1Route({ method: 'put', path: '/saved-filters/:id', tag: 'Me', summary: 'Change a saved filter', access: 'staff', campusScope: OWN, params: idParams, body: loose, documented: { body: D.obj({ name: D.optStr, params: D.anyObj.optional(), isDefault: D.optBool }), response: savedFilter }, v1: savedFilterRouter, map: ctx => ({ url: `/${encodeURIComponent(ctx.params.id)}` }) }); +v1Route({ method: 'delete', path: '/saved-filters/:id', tag: 'Me', summary: 'Delete a saved filter', access: 'staff', campusScope: OWN, params: idParams, documented: { response: D.ok }, v1: savedFilterRouter, map: ctx => ({ url: `/${encodeURIComponent(ctx.params.id)}` }) }); +v1Route({ method: 'get', path: '/dashboard/today', tag: 'Dashboard', summary: 'Today at a glance', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], documented: { response: D.obj({ events: z.array(D.obj({ id: D.str, title: D.str, startsAt: D.date, endsAt: D.date, sessionLabel: D.optStr, places: D.num, checkedIn: D.num })).describe('Today\'s events with places and check-ins'), money: D.obj({ today: D.rand, todayCount: D.num, week: D.rand }).nullish(), pending: z.array(D.obj({ key: D.str, label: D.str, count: D.num, href: D.str, tone: D.optStr })).describe('What\'s waiting for you') }) }, v1: dashboardRouter, map: ctx => ({ url: `/today${qs(ctx.req)}` }) }); +v1Route({ method: 'get', path: '/dashboard/search', tag: 'Dashboard', summary: 'Search people, registrations and events', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('q'), documented: { response: D.obj({ results: z.array(D.obj({ type: D.str.describe('event, payment, person, registration'), id: D.str, title: D.str, subtitle: D.optStr, href: D.optStr })) }) }, v1: dashboardRouter, map: ctx => ({ url: `/search${qs(ctx.req)}` }) }); +v1Route({ method: 'get', path: '/stats/staff', tag: 'Dashboard', summary: 'Staff dashboard numbers', access: 'staff', campusScope: SCOPE_LIST, middleware: [cs.scopeList], documented: { response: D.obj({ scanStats, recentScans: z.array(D.anyObj) }) }, v1: stats.getStaffDashboardStats }); +v1Route({ method: 'get', path: '/stats/supervisor', tag: 'Dashboard', summary: 'Supervisor dashboard numbers', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], documented: { response: D.obj({ scanStats, recentScans: z.array(D.anyObj), paymentStats: D.anyObj, activeEventsCount: D.num }) }, v1: stats.getSupervisorDashboardStats }); +v1Route({ method: 'get', path: '/stats/admin', tag: 'Dashboard', summary: 'Admin dashboard numbers', access: 'admin', documented: { response: D.obj({ scanStats, recentScans: z.array(D.anyObj), paymentStats: D.anyObj, activeEventsCount: D.num }) }, v1: stats.getAdminDashboardStats }); +v1Route({ method: 'get', path: '/stats/overview', tag: 'Dashboard', summary: 'Overview numbers', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('from', 'to', 'campus'), documented: { response: D.obj({ funnel: D.anyObj.nullish(), activeEvents: D.num, registrations: monthly, ticketsSold: monthly, revenue: monthly, donations: monthly, trend: z.array(D.obj({ date: D.str, revenue: D.rand })), topEvents: z.array(D.obj({ eventId: D.str, title: D.str, revenue: D.rand, registrations: D.num, ticketsSold: D.num })) }) }, v1: stats.getOverviewStats }); const trackLimiter = rateLimit({ windowMs: 60 * 1000, max: 60, standardHeaders: true, legacyHeaders: false }); -v1Route({ method: 'post', path: '/analytics/track', tag: 'Dashboard', summary: 'Record a step on the way to registering', access: 'public', middleware: [trackLimiter], body: loose, v1: analytics.trackStage }); -v1Route({ method: 'get', path: '/analytics/funnel', tag: 'Dashboard', summary: 'How many get from viewing to paying', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventId', 'from', 'to'), v1: analytics.getFunnel }); -v1Route({ method: 'post', path: '/reports/pdf', tag: 'Reports', summary: 'A report as a PDF', description: 'The report\'s rows and columns in the body.', access: 'user', body: loose, file: { contentType: 'application/pdf' }, v1: reports.generatePdf }); -v1Route({ method: 'post', path: '/reports/excel', tag: 'Reports', summary: 'A report as an Excel file', access: 'user', body: loose, file: { contentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }, v1: reports.generateExcel }); -v1Route({ method: 'post', path: '/reports/email', tag: 'Reports', summary: 'Email a report as a PDF', access: 'user', body: loose, v1: reports.emailPdf }); -v1Route({ method: 'post', path: '/reports/whatsapp', tag: 'Reports', summary: 'WhatsApp a report as a PDF', access: 'user', body: loose, v1: reports.whatsappPdf }); +v1Route({ method: 'post', path: '/analytics/track', tag: 'Dashboard', summary: 'Record a step on the way to registering', access: 'public', middleware: [trackLimiter], body: loose, documented: { body: D.obj({ sessionId: D.str.describe('The browser\'s analytics id'), eventId: D.str, stage: z.enum(['view', 'start', 'submit', 'paid']), source: D.optStr.describe('Where they came from') }), response: z.null().describe('Always 204, no content') }, v1: analytics.trackStage }); +v1Route({ method: 'get', path: '/analytics/funnel', tag: 'Dashboard', summary: 'How many get from viewing to paying', access: 'supervisor', campusScope: SCOPE_LIST, middleware: [cs.scopeList], query: filters('eventIds', 'eventId', 'from', 'to'), documented: { response: D.obj({ perEvent: z.array(D.anyObj).describe('The same for each event') }).describe('Counts per stage (view, start, submit, paid), sources and devices, and per ticket') }, v1: analytics.getFunnel }); +v1Route({ method: 'post', path: '/reports/pdf', tag: 'Reports', summary: 'A report as a PDF', description: 'The report\'s rows and columns in the body.', access: 'user', body: loose, file: { contentType: 'application/pdf' }, documented: { body: reportBody }, v1: reports.generatePdf }); +v1Route({ method: 'post', path: '/reports/excel', tag: 'Reports', summary: 'A report as an Excel file', access: 'user', body: loose, file: { contentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }, documented: { body: reportBody }, v1: reports.generateExcel }); +v1Route({ method: 'post', path: '/reports/email', tag: 'Reports', summary: 'Email a report as a PDF', access: 'user', body: loose, documented: { body: reportBody.extend({ subject: D.optStr, body: D.optStr.describe('Text of the email') }), response: D.message }, v1: reports.emailPdf }); +v1Route({ method: 'post', path: '/reports/whatsapp', tag: 'Reports', summary: 'WhatsApp a report as a PDF', access: 'user', body: loose, documented: { body: reportBody.extend({ caption: D.optStr }), response: D.message }, v1: reports.whatsappPdf }); diff --git a/apps/events/backend/src/v2/resources/registrationsManage.ts b/apps/events/backend/src/v2/resources/registrationsManage.ts index cf9fd44..6f731f8 100644 --- a/apps/events/backend/src/v2/resources/registrationsManage.ts +++ b/apps/events/backend/src/v2/resources/registrationsManage.ts @@ -1,4 +1,5 @@ import { z } from 'zod'; +import * as D from '../docs'; import type { Request } from 'express'; import { defineRoute, type ApiUser } from '../route'; import { pageOf, single } from '../paging'; @@ -207,6 +208,16 @@ export const bulk = defineRoute({ access: 'supervisor', campusScope: 'scopeBody(registrationIds, deny orphans)', middleware: [campusScope.scopeBody([['registrationIds', 'registration']], { orphan: 'deny' })], body: z.looseObject({ action: z.enum(['markPaid', 'cancel', 'moveOption', 'allocate', 'message']), registrationIds: z.array(id).min(1).max(500) }), response: single(z.looseObject({})), + documented: { + body: D.obj({ + action: z.enum(['markPaid', 'cancel', 'moveOption', 'allocate', 'message']), registrationIds: z.array(id).min(1).max(500), + method: D.optStr.describe('markPaid: cash, eft, card or other'), paidAt: D.optDate.describe('markPaid'), + fromOptionId: D.optStr.describe('moveOption'), toOptionId: D.optStr.describe('moveOption'), + setId: D.optStr.describe('allocate'), groupId: D.optStr.describe('allocate'), + channel: z.enum(['email', 'whatsapp']).optional().describe('message'), subject: D.optStr.describe('message (email)'), text: D.optStr.describe('message'), + }), + response: D.obj({ action: D.str, done: D.num, skipped: D.num, failed: D.num, results: z.array(D.obj({ id: D.str, ok: D.bool, skipped: D.optBool, message: D.optStr })) }), + }, async handler({ body, req }) { const { runBulk } = require('../../utils/bulkRegistrations') as { runBulk(req: unknown, body: object): Promise }; return { data: plain(await runBulk(req, body)) }; diff --git a/apps/events/backend/src/v2/resources/seriesDeals.ts b/apps/events/backend/src/v2/resources/seriesDeals.ts index 75387fd..7f639a2 100644 --- a/apps/events/backend/src/v2/resources/seriesDeals.ts +++ b/apps/events/backend/src/v2/resources/seriesDeals.ts @@ -1,4 +1,5 @@ import { z } from 'zod'; +import * as D from '../docs'; import type { Request } from 'express'; import { defineRoute, type ApiUser } from '../route'; import { single } from '../paging'; @@ -74,6 +75,7 @@ export const compareSeries = defineRoute({ method: 'get', path: '/series/:id/compare', tag: 'Series', summary: 'Year on year', description: 'Registrations, tickets, income and attendance for each event in the series that you may see, oldest first.', access: 'supervisor', campusScope: 'scopeList (eventWhere in compareSeries)', params: idParams, response: single(z.looseObject({})), + documented: { response: D.obj({ series: D.anyObj, events: z.array(D.obj({ eventId: D.str, title: D.str, startDate: D.date, endDate: D.date, campus: D.anyObj.nullish(), isActive: D.bool, sessions: D.optNum, registrations: D.num, tickets: D.num, income: D.rand, checkedIn: D.num, attendanceRate: D.optNum.describe('%'), change: D.obj({ registrations: D.optNum.describe('% change from the year before'), tickets: D.optNum.describe('% change from the year before'), income: D.optNum.describe('% change from the year before'), checkedIn: D.optNum.describe('% change from the year before') }).nullable() })) }) }, async handler({ params, req }) { return { data: plain(await series.compareSeries(params.id, await ctxOf(req))) }; }, }); @@ -137,6 +139,7 @@ export const buyPass = defineRoute({ description: 'Registers you at every event on it, then answers with a checkout to pay (or issues the tickets when it\'s free).', access: 'user', status: 201, params: idParams, body: z.object({ quantity: z.number().int().min(1).max(50).default(1), provider: z.string().max(40).optional() }), + documented: { response: D.obj({ purchaseId: D.str, total: D.rand, paid: D.bool.describe('Free: the tickets are issued straight away'), redirectUrl: D.optStr.describe('Where to send them to pay'), provider: D.optStr, message: D.optStr }) }, response: single(z.looseObject({})), async handler({ params, body, user }) { return { data: plain(await series.buyPass(params.id, user!.id, body)) }; }, }); @@ -144,6 +147,7 @@ export const buyPass = defineRoute({ export const payPass = defineRoute({ method: 'post', path: '/season-pass-purchases/:id/checkout', tag: 'Series', summary: 'Pay what\'s owed on a pass', access: 'user', params: idParams, body: z.object({ provider: z.string().max(40).optional() }), response: single(z.looseObject({})), + documented: { response: D.obj({ redirectUrl: D.optStr, provider: D.optStr, message: D.optStr }) }, async handler({ params, body, user }) { return { data: plain(await series.payPassPurchase(params.id, user!.id, body)) }; }, }); diff --git a/apps/events/backend/src/v2/route.ts b/apps/events/backend/src/v2/route.ts index 568a6a3..5682cb0 100644 --- a/apps/events/backend/src/v2/route.ts +++ b/apps/events/backend/src/v2/route.ts @@ -57,6 +57,13 @@ export type RouteDef

, Infer, Infer>) => Promise> | z.input; }; @@ -89,6 +96,15 @@ export function defineRoute

(schema: S, value: unknown): Infer => (schema ? schema.parse(value) : undefined) as Infer; +/** Outside production: says when a documented-only body or answer doesn't fit its documentation. */ +function warnUndocumented(def: AnyRoute, what: string, schema: Schema, value: unknown) { + if (process.env.NODE_ENV === 'production') return; + const checked = schema.safeParse(value); + if (!checked.success) { + console.warn(`[api/v2] ${def.method.toUpperCase()} ${def.path}: ${what} doesn't match its documented schema`, JSON.stringify(checked.error.issues.slice(0, 5))); + } +} + /** Adds every defined route to the router. */ export function mount(router: Router, list: AnyRoute[] = routes): void { for (const def of list) { @@ -102,7 +118,9 @@ export function mount(router: Router, list: AnyRoute[] = routes): void { req, res, }; + if (def.documented?.body) warnUndocumented(def, 'request body', def.documented.body, req.body ?? {}); const result = await def.handler(ctx); + if (def.documented?.response) warnUndocumented(def, 'answer', def.documented.response, (result as { data?: unknown })?.data); const checked = def.response.safeParse(result); if (!checked.success) { console.error(`[api/v2] ${def.method.toUpperCase()} ${def.path}: response doesn't match its schema`, checked.error.issues); diff --git a/apps/events/backend/src/v2/viaV1.ts b/apps/events/backend/src/v2/viaV1.ts index 60b1cf1..3ac10de 100644 --- a/apps/events/backend/src/v2/viaV1.ts +++ b/apps/events/backend/src/v2/viaV1.ts @@ -152,6 +152,8 @@ type V1RouteDef = { query?: z.ZodType; body?: z.ZodType; response?: z.ZodType; + /** The body and the answer's `data`, for the docs only (see RouteDef.documented). */ + documented?: { body?: z.ZodType; response?: z.ZodType }; status?: number; file?: { contentType: string }; upload?: { field: string; description: string }; diff --git a/apps/events/backend/tests/v2Docs.test.ts b/apps/events/backend/tests/v2Docs.test.ts new file mode 100644 index 0000000..92af90b --- /dev/null +++ b/apps/events/backend/tests/v2Docs.test.ts @@ -0,0 +1,109 @@ +import express from 'express'; +import request from 'supertest'; +import { z } from 'zod'; + +// 1.52.1: the API document describes every route. Routes answered by a v1 handler carry +// `documented` shapes — in the document, never enforced, and logged outside production when the +// real body or answer doesn't fit them. + +jest.mock('../src/middleware/authMiddleware', () => ({ + protect: (_req: unknown, _res: unknown, next: () => void) => next(), + optionalAuth: (_req: unknown, _res: unknown, next: () => void) => next(), + admin: (_req: unknown, _res: unknown, next: () => void) => next(), + staff: (_req: unknown, _res: unknown, next: () => void) => next(), + supervisor: (_req: unknown, _res: unknown, next: () => void) => next(), + loginLimiter: (_req: unknown, _res: unknown, next: () => void) => next(), +})); + +import { defineRoute, mount } from '../src/v2/route'; +import { buildOpenApi } from '../src/v2/openapi'; +import { errorHandler } from '../src/v2/errors'; + +const documented = defineRoute({ + method: 'post', path: '/docs-test/things', tag: 'Test', summary: 'Make a thing', access: 'public', + body: z.looseObject({}), + response: z.object({ data: z.unknown() }), + documented: { body: z.object({ name: z.string() }), response: z.object({ id: z.string(), name: z.string() }) }, + handler: ({ req }) => ({ data: (req.body as { name?: unknown }).name === 'odd' ? { id: 1 } : { id: 't1', name: String((req.body as { name?: unknown }).name) } }), +}); +const action = defineRoute({ + method: 'post', path: '/docs-test/things/:id/poke', tag: 'Test', summary: 'Poke a thing', access: 'public', + params: z.object({ id: z.string() }), query: z.looseObject({ from: z.string().optional() }), body: z.looseObject({}), response: z.object({ data: z.unknown() }), + handler: () => ({ data: null }), +}); + +const app = express(); +app.use(express.json()); +const router = express.Router(); +mount(router, [documented, action]); +router.use(errorHandler); +app.use('/api/v2', router); + +describe('documented shapes', () => { + const doc = buildOpenApi({ version: 'test', list: [documented, action] }) as any; + const op = doc.paths['/docs-test/things'].post; + + test('are what the document shows, in place of the generic body and answer', () => { + expect(op.requestBody.required).toBe(true); + expect(op.requestBody.content['application/json'].schema.properties.name).toEqual({ type: 'string' }); + expect(op.responses['200'].content['application/json'].schema.properties.data.properties).toEqual({ id: { type: 'string' }, name: { type: 'string' } }); + }); + + test('an action with no input says it needs no body; parameters get their common description', () => { + const poke = doc.paths['/docs-test/things/{id}/poke'].post; + expect(poke.requestBody).toMatchObject({ required: true, description: expect.stringContaining('No body needed') }); + expect(poke.parameters).toEqual(expect.arrayContaining([ + expect.objectContaining({ name: 'id', in: 'path', description: 'The id' }), + expect.objectContaining({ name: 'from', in: 'query', description: expect.stringContaining('On or after') }), + ])); + }); + + test('are never enforced: a body or answer that doesn\'t fit still goes through, and is logged', async () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(() => undefined); + const fits = await request(app).post('/api/v2/docs-test/things').send({ name: 'Bob' }); + expect(fits.status).toBe(200); + expect(warn).not.toHaveBeenCalled(); + + const odd = await request(app).post('/api/v2/docs-test/things').send({ name: 'odd' }); + expect(odd.status).toBe(200); + expect(odd.body).toEqual({ data: { id: 1 } }); + const noName = await request(app).post('/api/v2/docs-test/things').send({}); + expect(noName.status).toBe(200); + expect(warn.mock.calls.map(c => c[0])).toEqual([ + expect.stringContaining('answer doesn\'t match its documented schema'), + expect.stringContaining('request body doesn\'t match its documented schema'), + ]); + warn.mockRestore(); + }); +}); + +describe('the whole API document', () => { + // eslint-disable-next-line @typescript-eslint/no-require-imports + require('../src/v2'); + const doc = buildOpenApi({ version: 'test' }) as any; + // (Leaving out this file's own test routes.) + const ops = Object.entries(doc.paths).filter(([path]) => !path.startsWith('/docs-test')).flatMap(([path, methods]) => Object.entries(methods).map(([method, op]) => ({ path, method, op }))); + const isBlank = (s: any) => !s || Object.keys(s).length === 0 || (s.type === 'object' && !s.properties && !s.additionalProperties && !s.description); + + test('every JSON answer says what\'s in it', () => { + const blank = ops.filter(({ op }) => { + const json = Object.entries(op.responses).find(([code]) => code.startsWith('2'))?.[1]?.content?.['application/json']; + if (!json) return false; + const data = json.schema?.properties?.data; + return isBlank(data) || (data?.type === 'array' && isBlank(data.items)); + }).map(({ method, path }) => `${method.toUpperCase()} ${path}`); + // A JSON file download (my data) is the one answer that's a file, not a shape. + expect(blank).toEqual(['GET /me/privacy/export']); + }); + + test('every body that takes something says what, and every parameter is described', () => { + const undescribed = ops.flatMap(({ method, path, op }) => op.parameters.filter((p: any) => !p.description).map((p: any) => `${method} ${path} ${p.in}:${p.name}`)); + expect(undescribed).toEqual([]); + const bodies = ops.filter(({ op }) => op.requestBody?.content?.['application/json']); + for (const { op } of bodies) { + const schema = op.requestBody.content['application/json'].schema; + const takesSomething = (!!schema.properties && Object.keys(schema.properties).length > 0) || !!schema.additionalProperties?.type || !!schema.description; + if (!takesSomething) expect(op.requestBody.description).toMatch(/No body needed/); + } + }); +}); diff --git a/apps/events/docs/HANDOVER.md b/apps/events/docs/HANDOVER.md index 9a5118f..e4d2df7 100644 --- a/apps/events/docs/HANDOVER.md +++ b/apps/events/docs/HANDOVER.md @@ -1,6 +1,6 @@ # Handover — where things stand and how to carry on -Last updated: 2026-11-02, after **1.52.0** (and Hub 1.5.0). The plan itself is in +Last updated: 2026-11-02, after **1.52.1** (and Hub 1.5.0). The plan itself is in [ROADMAP-v2.md](./ROADMAP-v2.md) (decisions table at the end); the previous round of features is in [FEATURES-ROUND-1.md](./FEATURES-ROUND-1.md). @@ -14,6 +14,7 @@ encrypted settings unreadable or break existing installs. | Version | What | |---------|------| +| 1.52.1 | **API documentation complete:** every v2 route documents its body, answer and parameters — the ~300 answered by v1 handlers through `documented` shapes (`src/v2/docs.ts`), shown but not enforced, logged outside production when they don't fit; empty bodies say "No body needed". Test `tests/v2Docs.test.ts` | | 1.52.0 | **Urgent fix + Corrections:** required attendee forms no longer leave paid door/manual registrations without tickets — popup with "Fill in later" (`Registration.formWaivedAt`, `POST /api/v2/registrations/{id}/form-later`); one form per person on picked sessions; forms with no questions don't hold tickets; kiosk asks for the forms the server says are missing. Admin **Corrections** page (`src/services/corrections.ts`, `/api/v2/corrections/…`): issue missing tickets, pay later (`ticketsReleasedAt`), make it free (`complimentaryDiscount`), check in after the event. Migration `20261102120000_corrections`. e2e `e2e/corrections.spec.ts` | | 1.51.17 | **Security:** forgot-password and sign-in don't reveal whether an account exists (same answer, status and timing); forgot-password rate-limited | | 1.51.16 | **Incoming webhooks and message links on v2** — `src/v2/links.ts` (`/api/v2/webhooks/…`, one-click unsubscribe, 308s for old links); provider URLs and email links point at v2 | @@ -499,6 +500,16 @@ Languages (Afrikaans, §10) and Wallet passes (§7) are removed from scope (2026 - Body and query schemas are loose (`z.looseObject`) and v1 gets the request as sent, so v2 refuses nothing v1 accepted. Give a `query` schema for filters the frontend passes — the typed `apiV2` only allows declared ones. +- **Document every v1Route (1.52.1):** `documented: { body?, response? }` with the shapes from + `src/v2/docs.ts` (`D.obj`, `D.payment`, `D.message`…) — the body it reads and the `data` it answers. + They go in the OpenAPI document but are **not enforced** (the handler still gets what was sent and + its answer goes out as it is), so a mistake can't break a screen. Outside production a body or + answer that doesn't fit is logged as `[api/v2] … doesn't match its documented schema` — grep the + e2e output for it after changing a handler. `tests/v2Docs.test.ts` fails if a JSON answer is + undocumented or a parameter has no description (common query names are described once in + `QUERY_HELP`, path ones in `PATH_HELP`). An action that takes no input keeps `body: loose`; the + document says "No body needed". Because the frontend's types come from the document, a documented + shape that's wrong usually shows up as a frontend type error too. - Moving these handlers into TS services (as 1.51.1 – 1.51.10 did) is a later clean-up; the v2 API doesn't change when it happens. - Frontend conversions are scripted from `SUCCESSORS` and the OpenAPI document (scratch tool, not diff --git a/apps/events/frontend/package-lock.json b/apps/events/frontend/package-lock.json index 8df7543..3849399 100644 --- a/apps/events/frontend/package-lock.json +++ b/apps/events/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "hope-events-frontend", - "version": "1.52.0", + "version": "1.52.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hope-events-frontend", - "version": "1.52.0", + "version": "1.52.1", "dependencies": { "@dnd-kit/core": "^6.3.1", "@hookform/resolvers": "^5.2.1", diff --git a/apps/events/frontend/package.json b/apps/events/frontend/package.json index 8c55e07..ce23b1b 100644 --- a/apps/events/frontend/package.json +++ b/apps/events/frontend/package.json @@ -1,6 +1,6 @@ { "name": "hope-events-frontend", - "version": "1.52.0", + "version": "1.52.1", "private": true, "scripts": { "dev": "next dev", diff --git a/apps/events/frontend/src/app/dashboard/staff/kids/page.tsx b/apps/events/frontend/src/app/dashboard/staff/kids/page.tsx index 97f9f41..22c43b6 100644 --- a/apps/events/frontend/src/app/dashboard/staff/kids/page.tsx +++ b/apps/events/frontend/src/app/dashboard/staff/kids/page.tsx @@ -312,7 +312,7 @@ export default function KidsDeskPage() { const r = await (apiV2Data("post", "/events/{id}/kids/check-out", { params: { id: eventId }, authToken: token, - body: { code: lookup.code, checkInIds: ids, collectedBy, sessionId: sessionId || undefined }, + body: { code: lookup.code ?? "", checkInIds: ids, collectedBy, sessionId: sessionId || undefined }, }) as Promise<{ checkedOut: { name: string }[] }>); setMsg({ type: "ok", text: `Collected: ${r.checkedOut.map(c => c.name).join(", ")}.` }); setLookup(null); diff --git a/apps/events/frontend/src/components/admin/privacy/BreachesPanel.tsx b/apps/events/frontend/src/components/admin/privacy/BreachesPanel.tsx index 18d5d02..e23b3fa 100644 --- a/apps/events/frontend/src/components/admin/privacy/BreachesPanel.tsx +++ b/apps/events/frontend/src/components/admin/privacy/BreachesPanel.tsx @@ -101,7 +101,8 @@ export function BreachesPanel({ token }: { token: string }) { setBusy(true); setError(null); try { - if (id === "new") await apiV2Data("post", "/privacy/breaches", { authToken: token, body }); + // A new breach always comes from the full form (save below), so the required fields are there. + if (id === "new") await apiV2Data("post", "/privacy/breaches", { authToken: token, body: body as { title: string; description: string; dataAffected: string; discoveredAt: string } }); else await apiV2Data("put", "/privacy/breaches/{id}", { params: { id: id }, authToken: token, body }); setEditing(null); await load(); diff --git a/apps/events/frontend/src/components/shared/TransferTicketModal.tsx b/apps/events/frontend/src/components/shared/TransferTicketModal.tsx index 3e490b4..b4d1e2b 100644 --- a/apps/events/frontend/src/components/shared/TransferTicketModal.tsx +++ b/apps/events/frontend/src/components/shared/TransferTicketModal.tsx @@ -48,7 +48,7 @@ export function TransferTicketModal({ ticket, event, token, onClose, onDone }: { setBusy(true); setError(null); try { - const body: Record = { name: f.name, email: f.email, phone: f.phone, ...(f.gender ? { gender: f.gender } : {}) }; + const body: { name: string; [field: string]: string } = { name: f.name, email: f.email, phone: f.phone, ...(f.gender ? { gender: f.gender } : {}) }; if (youth) Object.assign(body, { dateOfBirth: f.dateOfBirth, parentName: f.parentName, parentEmail: f.parentEmail, parentPhone: f.parentPhone }); const res = await (apiV2Data("post", "/tickets/{id}/transfer", { params: { id: ticket.id }, authToken: token, body }) as Promise<{ message: string }>); onDone(res.message); diff --git a/apps/events/frontend/src/lib/api-v2/openapi.json b/apps/events/frontend/src/lib/api-v2/openapi.json index 108c72d..c8228bd 100644 --- a/apps/events/frontend/src/lib/api-v2/openapi.json +++ b/apps/events/frontend/src/lib/api-v2/openapi.json @@ -1820,7 +1820,25 @@ "properties": { "data": { "type": "object", - "properties": {}, + "properties": { + "sets": { + "type": "number", + "description": "Allocation sets copied" + }, + "groups": { + "type": "number", + "description": "Groups copied" + }, + "costs": { + "type": "number", + "description": "Costs copied (admins)" + } + }, + "required": [ + "sets", + "groups", + "costs" + ], "additionalProperties": {} } }, @@ -4342,6 +4360,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -4352,6 +4371,7 @@ "name": "attachmentId", "in": "path", "required": true, + "description": "The attachment's id", "schema": { "type": "string", "minLength": 1, @@ -4629,6 +4649,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "minLength": 1, @@ -6817,6 +6838,7 @@ "name": "slug", "in": "path", "required": true, + "description": "The short name in the address", "schema": { "type": "string", "minLength": 1, @@ -7002,7 +7024,134 @@ "properties": { "data": { "type": "object", - "properties": {}, + "properties": { + "series": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "events": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "campus": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": "boolean" + }, + "sessions": { + "type": [ + "number", + "null" + ] + }, + "registrations": { + "type": "number" + }, + "tickets": { + "type": "number" + }, + "income": { + "type": "number", + "description": "Rand" + }, + "checkedIn": { + "type": "number" + }, + "attendanceRate": { + "description": "%", + "type": [ + "number", + "null" + ] + }, + "change": { + "anyOf": [ + { + "type": "object", + "properties": { + "registrations": { + "description": "% change from the year before", + "type": [ + "number", + "null" + ] + }, + "tickets": { + "description": "% change from the year before", + "type": [ + "number", + "null" + ] + }, + "income": { + "description": "% change from the year before", + "type": [ + "number", + "null" + ] + }, + "checkedIn": { + "description": "% change from the year before", + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "eventId", + "title", + "startDate", + "endDate", + "isActive", + "registrations", + "tickets", + "income", + "checkedIn", + "change" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "series", + "events" + ], "additionalProperties": {} } }, @@ -7249,6 +7398,7 @@ "name": "seriesId", "in": "query", "required": false, + "description": "Only this event series", "schema": { "type": "string", "minLength": 1, @@ -7978,7 +8128,43 @@ "properties": { "data": { "type": "object", - "properties": {}, + "properties": { + "purchaseId": { + "type": "string" + }, + "total": { + "type": "number", + "description": "Rand" + }, + "paid": { + "type": "boolean", + "description": "Free: the tickets are issued straight away" + }, + "redirectUrl": { + "description": "Where to send them to pay", + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "purchaseId", + "total", + "paid" + ], "additionalProperties": {} } }, @@ -8075,7 +8261,26 @@ "properties": { "data": { "type": "object", - "properties": {}, + "properties": { + "redirectUrl": { + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } }, @@ -9656,6 +9861,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 40 @@ -9665,6 +9871,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 40 @@ -10815,6 +11022,7 @@ "name": "slug", "in": "path", "required": true, + "description": "The short name in the address", "schema": { "type": "string", "minLength": 1, @@ -11404,6 +11612,7 @@ "name": "registrants", "in": "query", "required": false, + "description": "`true`: also people registered for its events in the last 12 months", "schema": { "default": "false", "type": "string", @@ -11942,6 +12151,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "default": 1, "type": "integer", @@ -11965,6 +12175,7 @@ "name": "unpaid", "in": "query", "required": false, + "description": "`true`: only ones with money still owed", "schema": { "default": "false", "type": "string", @@ -11978,6 +12189,7 @@ "name": "userId", "in": "query", "required": false, + "description": "Only this person", "schema": { "type": "string", "minLength": 1, @@ -13366,6 +13578,7 @@ "name": "past", "in": "query", "required": false, + "description": "`true`: include ones that are over too", "schema": { "default": "false", "type": "string", @@ -14170,6 +14383,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -14180,6 +14394,7 @@ "name": "attendeeId", "in": "path", "required": true, + "description": "The named attendee's id", "schema": { "type": "string", "minLength": 1, @@ -14747,6 +14962,7 @@ "name": "search", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 200 @@ -15337,6 +15553,75 @@ "minLength": 1, "maxLength": 64 } + }, + "method": { + "description": "markPaid: cash, eft, card or other", + "type": [ + "string", + "null" + ] + }, + "paidAt": { + "description": "markPaid", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "fromOptionId": { + "description": "moveOption", + "type": [ + "string", + "null" + ] + }, + "toOptionId": { + "description": "moveOption", + "type": [ + "string", + "null" + ] + }, + "setId": { + "description": "allocate", + "type": [ + "string", + "null" + ] + }, + "groupId": { + "description": "allocate", + "type": [ + "string", + "null" + ] + }, + "channel": { + "description": "message", + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + "subject": { + "description": "message (email)", + "type": [ + "string", + "null" + ] + }, + "text": { + "description": "message", + "type": [ + "string", + "null" + ] } }, "required": [ @@ -15358,7 +15643,58 @@ "properties": { "data": { "type": "object", - "properties": {}, + "properties": { + "action": { + "type": "string" + }, + "done": { + "type": "number" + }, + "skipped": { + "type": "number" + }, + "failed": { + "type": "number" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "ok": { + "type": "boolean" + }, + "skipped": { + "type": [ + "boolean", + "null" + ] + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "ok" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "action", + "done", + "skipped", + "failed", + "results" + ], "additionalProperties": {} } }, @@ -15420,7 +15756,40 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "providers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "yoco, payfast" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": {} + } + }, + "minimumAmount": { + "type": "number", + "description": "Smallest online payment" + } + }, + "required": [ + "providers", + "minimumAmount" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15455,7 +15824,55 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "providers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "configured": { + "type": "boolean", + "description": "Its keys are set up" + }, + "capabilities": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What the provider can do, e.g. look payments up" + } + }, + "required": [ + "id", + "label", + "enabled", + "configured", + "capabilities" + ], + "additionalProperties": {} + } + }, + "minimumAmount": { + "type": "number", + "description": "Rand" + } + }, + "required": [ + "providers", + "minimumAmount" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15506,7 +15923,32 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "providers": { + "minItems": 1, + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "id", + "enabled" + ], + "additionalProperties": {} + }, + "description": "Every provider, in the order to offer them" + } + }, + "required": [ + "providers" + ], "additionalProperties": {} } } @@ -15520,7 +15962,54 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "providers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "configured": { + "type": "boolean", + "description": "Its keys are set up" + }, + "capabilities": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What the provider can do, e.g. look payments up" + } + }, + "required": [ + "id", + "label", + "enabled", + "configured", + "capabilities" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "message", + "providers" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15585,7 +16074,81 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkouts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "providerLabel": { + "type": "string" + }, + "canCheck": { + "type": "boolean", + "description": "The provider can be asked whether it was paid" + }, + "amount": { + "type": "number", + "description": "Rand" + }, + "description": { + "type": "string" + }, + "type": { + "description": "registration, donation, sponsorship, season_pass…", + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "payer": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "provider", + "providerLabel", + "canCheck", + "amount", + "description", + "createdAt" + ], + "additionalProperties": {} + } + }, + "days": { + "type": "number", + "description": "How far back it looks" + } + }, + "required": [ + "checkouts", + "days" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15638,7 +16201,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "ids": { + "description": "Checkouts to ask about (default: every open one), at most 200", + "type": "array", + "items": { + "type": "string" + } + } + }, "additionalProperties": {} } } @@ -15652,7 +16223,32 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "recorded": { + "type": "number", + "description": "Payments found and recorded" + }, + "message": { + "type": "string" + } + }, + "required": [ + "results", + "recorded", + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15713,6 +16309,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -15722,6 +16319,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -15731,6 +16329,7 @@ "name": "userId", "in": "query", "required": false, + "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 @@ -15740,6 +16339,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -15749,6 +16349,7 @@ "name": "donations", "in": "query", "required": false, + "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 @@ -15758,6 +16359,7 @@ "name": "method", "in": "query", "required": false, + "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 @@ -15767,6 +16369,7 @@ "name": "kind", "in": "query", "required": false, + "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 @@ -15776,6 +16379,7 @@ "name": "startDate", "in": "query", "required": false, + "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -15785,6 +16389,7 @@ "name": "endDate", "in": "query", "required": false, + "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -15799,7 +16404,29 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "totalToday": { + "type": "number", + "description": "Rand" + }, + "totalWeek": { + "type": "number", + "description": "Rand" + }, + "totalMonth": { + "type": "number", + "description": "Rand" + } + }, + "required": [ + "totalToday", + "totalWeek", + "totalMonth" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -15860,6 +16487,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -15869,6 +16497,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -15878,6 +16507,7 @@ "name": "userId", "in": "query", "required": false, + "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 @@ -15887,6 +16517,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -15896,6 +16527,7 @@ "name": "donations", "in": "query", "required": false, + "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 @@ -15905,6 +16537,7 @@ "name": "method", "in": "query", "required": false, + "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 @@ -15914,6 +16547,7 @@ "name": "kind", "in": "query", "required": false, + "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 @@ -15923,6 +16557,7 @@ "name": "startDate", "in": "query", "required": false, + "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -15932,6 +16567,7 @@ "name": "endDate", "in": "query", "required": false, + "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -15946,7 +16582,365 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "pages": { + "type": "number" + } + }, + "required": [ + "data", + "total", + "page", + "limit", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16009,27 +17003,16 @@ "type": "object", "properties": { "registrationId": { - "anyOf": [ - { - "type": "string", - "minLength": 1, - "maxLength": 64 - }, - { - "type": "null" - } + "type": [ + "string", + "null" ] }, "eventId": { - "anyOf": [ - { - "type": "string", - "minLength": 1, - "maxLength": 64 - }, - { - "type": "null" - } + "description": "A donation: the event", + "type": [ + "string", + "null" ] }, "amount": { @@ -16040,11 +17023,37 @@ }, "method": { "type": "string", - "maxLength": 20 + "description": "cash, card, eft or other" + }, + "isDonation": { + "type": [ + "boolean", + "null" + ] + }, + "paidAt": { + "description": "Backdate it", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "userId": { + "description": "A donation: who gave it", + "type": [ + "string", + "null" + ] } }, "required": [ - "amount" + "amount", + "method" ], "additionalProperties": {} } @@ -16059,7 +17068,592 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "generatedTickets": { + "description": "Tickets issued because this paid it in full", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + }, + "formsNeeded": { + "description": "Attendee forms still holding the tickets back (1.52.0)", + "type": [ + "number", + "null" + ] + }, + "donationSplit": { + "description": "What was paid over the balance, kept as a donation", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16124,16 +17718,43 @@ "type": "object", "properties": { "paymentId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "description": "The payment refunded (or registrationId)", + "type": [ + "string", + "null" + ] }, "registrationId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "amount": { + "description": "Positive; stored as a negative payment", + "type": [ + "number", + "string" + ] + }, + "method": { + "type": "string" + }, + "reason": { + "type": [ + "string", + "null" + ] } }, + "required": [ + "userId", + "amount", + "method" + ], "additionalProperties": {} } } @@ -16147,7 +17768,192 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16213,13 +18019,17 @@ "properties": { "paymentId": { "type": "string", - "minLength": 1, - "maxLength": 64 + "description": "The donation" }, "registrationId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" + }, + "amount": { + "description": "Default: as much as both allow", + "type": [ + "number", + "string" + ] } }, "required": [ @@ -16239,7 +18049,216 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "updatedRegistration": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + "generatedTickets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + } + }, + "additionalProperties": {} + } }, "required": [ "data" @@ -16325,7 +18344,161 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "updatedRegistration": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + "donationId": { + "type": "string" + } + }, + "required": [ + "message", + "updatedRegistration", + "donationId" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16390,15 +18563,37 @@ "type": "object", "properties": { "eventId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" }, "amount": { "type": [ "number", "string" ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "successUrl": { + "type": [ + "string", + "null" + ] + }, + "cancelUrl": { + "type": [ + "string", + "null" + ] + }, + "failureUrl": { + "type": [ + "string", + "null" + ] } }, "required": [ @@ -16418,7 +18613,103 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "redirectUrl": { + "description": "Where to send the person to pay (null when the provider takes a form)", + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "form": { + "description": "A form to post (PayFast)", + "anyOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "fields": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "action", + "fields" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "amount": { + "type": "number", + "description": "Rand" + }, + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + } + }, + "required": [ + "amount", + "event" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16469,6 +18760,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -16478,6 +18770,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -16487,6 +18780,7 @@ "name": "userId", "in": "query", "required": false, + "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 @@ -16496,6 +18790,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -16505,6 +18800,7 @@ "name": "donations", "in": "query", "required": false, + "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 @@ -16514,6 +18810,7 @@ "name": "method", "in": "query", "required": false, + "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 @@ -16523,6 +18820,7 @@ "name": "kind", "in": "query", "required": false, + "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 @@ -16532,6 +18830,7 @@ "name": "startDate", "in": "query", "required": false, + "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -16541,6 +18840,7 @@ "name": "endDate", "in": "query", "required": false, + "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 @@ -16555,7 +18855,365 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "pages": { + "type": "number" + } + }, + "required": [ + "data", + "total", + "page", + "limit", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16622,7 +19280,337 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "userId", + "eventId", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16716,7 +19704,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -16797,7 +19796,188 @@ "type": "array", "items": { "type": "object", - "properties": {}, + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], "additionalProperties": {} } } @@ -16881,6 +20061,36 @@ "number", "string" ] + }, + "donationAmount": { + "type": [ + "number", + "string" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "successUrl": { + "type": [ + "string", + "null" + ] + }, + "cancelUrl": { + "type": [ + "string", + "null" + ] + }, + "failureUrl": { + "type": [ + "string", + "null" + ] } }, "additionalProperties": {} @@ -16896,7 +20106,78 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "redirectUrl": { + "description": "Where to send the person to pay (null when the provider takes a form)", + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "form": { + "description": "A form to post (PayFast)", + "anyOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "fields": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "action", + "fields" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "priceUpdated": { + "type": [ + "boolean", + "null" + ] + }, + "newTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + } }, "required": [ "data" @@ -16981,7 +20262,23 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "redirectUrl": { + "type": "string", + "description": "The link to send" + }, + "channel": { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + } + }, + "required": [ + "redirectUrl", + "channel" + ], "additionalProperties": {} } } @@ -16995,7 +20292,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "sent": { + "type": "boolean", + "const": true + }, + "channel": { + "type": "string" + } + }, + "required": [ + "sent", + "channel" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17082,7 +20395,195 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -17164,7 +20665,88 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "open", + "paid" + ] + }, + "amount": { + "type": "number", + "description": "Rand" + }, + "description": { + "type": "string" + }, + "provider": { + "description": "The provider already chosen, if any", + "type": [ + "string", + "null" + ] + }, + "providers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "yoco, payfast" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": {} + } + }, + "cancelUrl": { + "type": [ + "string", + "null" + ] + }, + "redirectUrl": { + "type": [ + "string", + "null" + ] + }, + "form": { + "description": "A signed form to post (PayFast)", + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "status", + "amount", + "description", + "providers" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17241,7 +20823,36 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "provider": { + "type": "string" + }, + "redirectUrl": { + "type": [ + "string", + "null" + ] + }, + "form": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "provider" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17292,6 +20903,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -17301,6 +20913,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -17310,6 +20923,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -17324,7 +20938,71 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "action": { + "description": "close, quick_close, reopen", + "type": [ + "string", + "null" + ] + }, + "notes": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "performedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -17401,7 +21079,99 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "paymentsByMethod": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "Income per method" + }, + "totalRevenue": { + "type": "number", + "description": "Rand" + }, + "costs": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "totalCosts": { + "type": "number", + "description": "Rand" + }, + "expectedCashByMethod": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "reconciled": { + "description": "The last close, line by line", + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "netProfit": { + "type": "number", + "description": "Rand" + }, + "totalDonations": { + "type": "number", + "description": "Rand" + }, + "unallocatedDonationsTotal": { + "type": "number", + "description": "Rand" + }, + "discountsTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "salesByOption": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "event", + "paymentsByMethod", + "totalRevenue", + "costs", + "totalCosts", + "expectedCashByMethod", + "netProfit", + "totalDonations", + "unallocatedDonationsTotal" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17488,7 +21258,47 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Per person: who, cash recorded, cash counted" + }, + "cashActualTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "cashDenominations": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "rows" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17559,6 +21369,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -17569,6 +21380,7 @@ "name": "userId", "in": "path", "required": true, + "description": "The person's id", "schema": { "type": "string", "minLength": 1, @@ -17582,7 +21394,37 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "denominations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "The note or coin, in rand" + }, + "count": { + "type": "number" + } + }, + "required": [ + "value", + "count" + ], + "additionalProperties": {} + } + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "denominations" + ], "additionalProperties": {} } } @@ -17596,7 +21438,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The saved count" + } }, "required": [ "data" @@ -17681,7 +21528,112 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "lines": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "cash, card, eft…" + }, + "bankAmount": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "onHandAmount": { + "description": "Cash only", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "pendingAmount": { + "description": "Not cash", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "pendingReference": { + "type": [ + "string", + "null" + ] + }, + "writeOffs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "amount": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "category" + ], + "additionalProperties": {} + } + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "method" + ], + "additionalProperties": {} + } + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "lines" + ], "additionalProperties": {} } } @@ -17695,7 +21647,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17780,7 +21743,110 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "lines": { + "description": "Per payment method: in the bank, on hand, pending, write-offs (leave out for a quick close)", + "type": "array", + "items": { + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "cash, card, eft…" + }, + "bankAmount": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "onHandAmount": { + "description": "Cash only", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "pendingAmount": { + "description": "Not cash", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "pendingReference": { + "type": [ + "string", + "null" + ] + }, + "writeOffs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "amount": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "category" + ], + "additionalProperties": {} + } + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "method" + ], + "additionalProperties": {} + } + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -17794,7 +21860,68 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "action": { + "description": "close, quick_close, reopen", + "type": [ + "string", + "null" + ] + }, + "notes": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "performedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17879,7 +22006,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "notes": { + "description": "Why", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -17893,7 +22028,68 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "action": { + "description": "close, quick_close, reopen", + "type": [ + "string", + "null" + ] + }, + "notes": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "performedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -17978,7 +22174,38 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "outcome": { + "type": "string", + "enum": [ + "received", + "written_off" + ] + }, + "amount": { + "type": [ + "number", + "string" + ] + }, + "category": { + "description": "A write-off: what it was for", + "type": [ + "string", + "null" + ] + }, + "notes": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "outcome", + "amount" + ], "additionalProperties": {} } } @@ -17992,7 +22219,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The settlement recorded" + } }, "required": [ "data" @@ -18063,6 +22295,7 @@ "name": "provider", "in": "query", "required": false, + "description": "yoco or payfast", "schema": { "type": "string", "maxLength": 4000 @@ -18077,7 +22310,122 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "providerLabel": { + "type": "string" + }, + "externalId": { + "type": "string", + "description": "The provider's id" + }, + "amount": { + "description": "Cents", + "type": [ + "number", + "null" + ] + }, + "currency": { + "type": [ + "string", + "null" + ] + }, + "createdDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "methodType": { + "type": [ + "string", + "null" + ] + }, + "reconciled": { + "type": "boolean" + }, + "ignored": { + "type": "boolean" + }, + "paymentId": { + "type": [ + "string", + "null" + ] + }, + "note": { + "description": "Why it needs a look", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "provider", + "providerLabel", + "externalId", + "reconciled", + "ignored" + ], + "additionalProperties": {} + } + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "success", + "data" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18142,7 +22490,122 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "providerLabel": { + "type": "string" + }, + "externalId": { + "type": "string", + "description": "The provider's id" + }, + "amount": { + "description": "Cents", + "type": [ + "number", + "null" + ] + }, + "currency": { + "type": [ + "string", + "null" + ] + }, + "createdDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "methodType": { + "type": [ + "string", + "null" + ] + }, + "reconciled": { + "type": "boolean" + }, + "ignored": { + "type": "boolean" + }, + "paymentId": { + "type": [ + "string", + "null" + ] + }, + "note": { + "description": "Why it needs a look", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "provider", + "providerLabel", + "externalId", + "reconciled", + "ignored" + ], + "additionalProperties": {} + } + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "success", + "data" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18207,7 +22670,27 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "As a donation to this event instead", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -18221,7 +22704,375 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object", + "properties": { + "transaction": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "providerLabel": { + "type": "string" + }, + "externalId": { + "type": "string", + "description": "The provider's id" + }, + "amount": { + "description": "Cents", + "type": [ + "number", + "null" + ] + }, + "currency": { + "type": [ + "string", + "null" + ] + }, + "createdDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "methodType": { + "type": [ + "string", + "null" + ] + }, + "reconciled": { + "type": "boolean" + }, + "ignored": { + "type": "boolean" + }, + "paymentId": { + "type": [ + "string", + "null" + ] + }, + "note": { + "description": "Why it needs a look", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "provider", + "providerLabel", + "externalId", + "reconciled", + "ignored" + ], + "additionalProperties": {} + }, + "payment": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "number", + "description": "Rand; a refund is negative" + }, + "method": { + "type": "string", + "description": "cash, card, eft, other — or the wallet type for an online payment" + }, + "provider": { + "description": "yoco or payfast for an online payment", + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "recordedById": { + "type": [ + "string", + "null" + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "isDonation": { + "type": "boolean" + }, + "isSponsorship": { + "type": [ + "boolean", + "null" + ] + }, + "originalPaymentId": { + "description": "A refund: the payment it refunds; a donation leg: the donation", + "type": [ + "string", + "null" + ] + }, + "externalId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "recordedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "amount", + "method", + "userId", + "isDonation", + "createdAt" + ], + "additionalProperties": {} + }, + "generatedTickets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "transaction", + "payment" + ], + "additionalProperties": {} + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "success", + "data" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18302,6 +23153,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -18320,7 +23172,119 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "providerLabel": { + "type": "string" + }, + "externalId": { + "type": "string", + "description": "The provider's id" + }, + "amount": { + "description": "Cents", + "type": [ + "number", + "null" + ] + }, + "currency": { + "type": [ + "string", + "null" + ] + }, + "createdDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "methodType": { + "type": [ + "string", + "null" + ] + }, + "reconciled": { + "type": "boolean" + }, + "ignored": { + "type": "boolean" + }, + "paymentId": { + "type": [ + "string", + "null" + ] + }, + "note": { + "description": "Why it needs a look", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "provider", + "providerLabel", + "externalId", + "reconciled", + "ignored" + ], + "additionalProperties": {} + }, + "message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "success", + "data" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18396,13 +23360,54 @@ "type": "object", "properties": { "eventId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" + }, + "eventOptionId": { + "type": "string" + }, + "variantId": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "description": "Per-session tickets: the session", + "type": [ + "string", + "null" + ] + }, + "quantity": { + "type": [ + "number", + "string" + ] + }, + "guestName": { + "description": "Not signed in", + "type": [ + "string", + "null" + ] + }, + "guestEmail": { + "type": [ + "string", + "null" + ] + }, + "guestPhone": { + "type": [ + "string", + "null" + ] } }, "required": [ - "eventId" + "eventId", + "eventOptionId", + "quantity" ], "additionalProperties": {} } @@ -18417,7 +23422,115 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "eventOptionId": { + "type": "string" + }, + "variantId": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "position": { + "type": "number", + "description": "Place in the queue" + }, + "status": { + "type": "string", + "description": "waiting, offered, claimed, expired, removed, left" + }, + "offeredQuantity": { + "type": [ + "number", + "null" + ] + }, + "offeredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "offerExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "claimedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "ahead": { + "type": "number", + "description": "People ahead" + }, + "message": { + "type": "string" + } + }, + "required": [ + "id", + "eventId", + "eventOptionId", + "userId", + "quantity", + "position", + "status", + "createdAt", + "ahead", + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18462,7 +23575,109 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "eventOptionId": { + "type": "string" + }, + "variantId": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "position": { + "type": "number", + "description": "Place in the queue" + }, + "status": { + "type": "string", + "description": "waiting, offered, claimed, expired, removed, left" + }, + "offeredQuantity": { + "type": [ + "number", + "null" + ] + }, + "offeredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "offerExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "claimedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "eventId", + "eventOptionId", + "userId", + "quantity", + "position", + "status", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -18498,6 +23713,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -18513,7 +23729,112 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "eventTitle": { + "type": [ + "string", + "null" + ] + }, + "eventStart": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "eventOptionId": { + "type": "string" + }, + "optionName": { + "type": "string" + }, + "variantId": { + "type": [ + "string", + "null" + ] + }, + "variantName": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "sessionName": { + "type": [ + "string", + "null" + ] + }, + "sessionStart": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lineName": { + "type": "string" + }, + "quantity": { + "description": "Places offered", + "type": [ + "number", + "null" + ] + }, + "requested": { + "type": "number" + }, + "expiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "eventOptionId", + "optionName", + "lineName", + "requested" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18575,6 +23896,7 @@ "name": "all", "in": "query", "required": false, + "description": "`true`/`1`: include everything, not just the current ones", "schema": { "type": "string", "maxLength": 4000 @@ -18589,7 +23911,143 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "eventOptionId": { + "type": "string" + }, + "variantId": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "userId": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "position": { + "type": "number", + "description": "Place in the queue" + }, + "status": { + "type": "string", + "description": "waiting, offered, claimed, expired, removed, left" + }, + "offeredQuantity": { + "type": [ + "number", + "null" + ] + }, + "offeredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "offerExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "claimedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "eventOptionId", + "userId", + "quantity", + "position", + "status", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -18674,7 +24132,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "quantity": { + "description": "Places to offer (default: all they asked for)", + "type": [ + "number", + "string" + ] + } + }, "additionalProperties": {} } } @@ -18688,7 +24154,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18773,7 +24250,18 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "direction": { + "type": "string", + "enum": [ + "up", + "down" + ] + } + }, + "required": [ + "direction" + ], "additionalProperties": {} } } @@ -18787,7 +24275,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18868,6 +24367,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -18886,7 +24386,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -18973,7 +24484,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19045,7 +24567,54 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "open": { + "type": [ + "boolean", + "null" + ] + }, + "spotPrice": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "showProgress": { + "type": [ + "boolean", + "null" + ] + }, + "goalSpots": { + "type": [ + "number", + "null" + ] + }, + "spotsFunded": { + "type": [ + "number", + "null" + ] + }, + "sponsors": {} + }, + "required": [ + "enabled" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19112,7 +24681,30 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "spotPrice": { + "type": "number", + "description": "Rand" + }, + "goalSpots": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "eventId", + "spotPrice" + ], + "additionalProperties": {}, + "description": "Plus the pool: given, used and places funded" + } }, "required": [ "data" @@ -19188,9 +24780,63 @@ "type": "object", "properties": { "eventId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" + }, + "spots": { + "description": "Places to fund (or amount)", + "type": [ + "number", + "string" + ] + }, + "amount": { + "type": [ + "number", + "string" + ] + }, + "anonymous": { + "type": [ + "boolean", + "null" + ] + }, + "sponsorName": { + "type": [ + "string", + "null" + ] + }, + "message": { + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Not signed in", + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] } }, "required": [ @@ -19209,7 +24855,68 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkoutId": { + "type": [ + "string", + "null" + ] + }, + "redirectUrl": { + "description": "Where to send the person to pay (null when the provider takes a form)", + "type": [ + "string", + "null" + ] + }, + "provider": { + "type": [ + "string", + "null" + ] + }, + "form": { + "description": "A form to post (PayFast)", + "anyOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string" + }, + "fields": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "action", + "fields" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "amount": { + "type": "number", + "description": "Rand" + } + }, + "required": [ + "amount" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19266,7 +24973,83 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "counts": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "number" + }, + "description": "Status → how many" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The young person" + }, + "status": { + "type": "string", + "description": "not_requested, pending, given, declined" + }, + "parentName": { + "type": [ + "string", + "null" + ] + }, + "parentEmail": { + "type": [ + "string", + "null" + ] + }, + "parentPhone": { + "type": [ + "string", + "null" + ] + }, + "request": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name", + "status" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "event", + "counts", + "rows" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19353,7 +25136,129 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "parentName": { + "type": [ + "string", + "null" + ] + }, + "parentPhone": { + "type": [ + "string", + "null" + ] + }, + "parentEmail": { + "type": [ + "string", + "null" + ] + }, + "medical": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "emergency": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "photoConsent": { + "type": [ + "boolean", + "null" + ] + }, + "purged": { + "type": "boolean", + "description": "Medical details removed after the event" + } + }, + "required": [ + "name", + "purged" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "event", + "rows" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19434,6 +25339,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -19452,7 +25358,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "sent": { + "type": "number" + }, + "pending": { + "type": "number" + } + }, + "required": [ + "message", + "sent", + "pending" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19533,6 +25458,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -19551,7 +25477,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "created": { + "type": "number" + } + }, + "required": [ + "message", + "created" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19632,6 +25573,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -19650,7 +25592,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19706,6 +25659,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -19721,7 +25675,108 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "superseded": { + "type": "boolean" + }, + "expired": { + "type": "boolean" + }, + "respondedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "attendeeName": { + "type": "string" + }, + "parentName": { + "type": [ + "string", + "null" + ] + }, + "consentText": { + "type": "string" + }, + "textVersion": { + "type": [ + "number", + "null" + ] + }, + "event": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "title", + "startDate", + "endDate" + ], + "additionalProperties": {} + }, + "collect": { + "type": "object", + "properties": { + "medical": { + "type": "boolean" + }, + "emergency": { + "type": "boolean" + }, + "photo": { + "type": "boolean" + } + }, + "required": [ + "medical", + "emergency", + "photo" + ], + "additionalProperties": {}, + "description": "What the form asks for" + } + }, + "required": [ + "status", + "superseded", + "expired", + "attendeeName", + "consentText", + "event", + "collect" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19765,6 +25820,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -19778,7 +25834,85 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "decision": { + "type": "string", + "enum": [ + "give", + "decline" + ] + }, + "signedName": { + "type": "string" + }, + "isGuardian": { + "type": "boolean", + "description": "Must be true" + }, + "medical": { + "type": "object", + "properties": { + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medication": { + "type": [ + "string", + "null" + ] + }, + "conditions": { + "type": [ + "string", + "null" + ] + }, + "medicalAid": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {} + }, + "emergency": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name", + "phone" + ], + "additionalProperties": {} + }, + "photoConsent": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "decision", + "signedName", + "isGuardian" + ], "additionalProperties": {} } } @@ -19792,7 +25926,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "given", + "declined" + ] + } + }, + "required": [ + "message", + "status" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19843,6 +25996,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -19852,6 +26006,7 @@ "name": "registrationId", "in": "query", "required": false, + "description": "Only this registration", "schema": { "type": "string", "maxLength": 4000 @@ -19861,6 +26016,7 @@ "name": "userId", "in": "query", "required": false, + "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 @@ -19870,6 +26026,7 @@ "name": "cursor", "in": "query", "required": false, + "description": "Where the last page ended (its `nextCursor`)", "schema": { "type": "string", "maxLength": 4000 @@ -19884,7 +26041,71 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "registrationId": { + "type": "string" + }, + "attendeeId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fieldId": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "fieldId", + "value" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "registrationId", + "createdAt" + ], + "additionalProperties": {} + } + }, + "nextCursor": { + "description": "Pass as `cursor` for the next page", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "items" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -19945,6 +26166,7 @@ "name": "eventIds", "in": "query", "required": false, + "description": "These events (comma-separated ids)", "schema": { "type": "string", "maxLength": 4000 @@ -19959,7 +26181,70 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "anonymous": { + "type": "boolean" + }, + "sentAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "invited": { + "type": "number" + }, + "responses": { + "type": "number" + }, + "responseRate": { + "description": "%", + "type": [ + "number", + "null" + ] + }, + "questions": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Each question with its answers summarised" + } + }, + "required": [ + "eventId", + "title", + "startDate", + "anonymous", + "invited", + "responses", + "questions" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -20015,6 +26300,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -20030,7 +26316,87 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "name": { + "type": "string" + }, + "intro": { + "type": [ + "string", + "null" + ] + }, + "anonymous": { + "type": "boolean" + }, + "responded": { + "type": "boolean" + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "description": "rating, multiple_choice, text, yes_no…" + }, + "label": { + "type": "string" + }, + "isRequired": { + "type": [ + "boolean", + "null" + ] + }, + "helpText": { + "type": [ + "string", + "null" + ] + }, + "options": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "label" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "event", + "name", + "anonymous", + "responded", + "fields" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20074,6 +26440,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -20087,7 +26454,19 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "answers": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Field id → answer" + } + }, + "required": [ + "answers" + ], "additionalProperties": {} } } @@ -20101,7 +26480,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20168,7 +26558,125 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sendAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "sentAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "audience": { + "type": "string", + "description": "checked_in or everyone" + }, + "anonymous": { + "type": "boolean" + }, + "intro": { + "type": [ + "string", + "null" + ] + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "description": "rating, multiple_choice, text, yes_no…" + }, + "label": { + "type": "string" + }, + "isRequired": { + "type": [ + "boolean", + "null" + ] + }, + "helpText": { + "type": [ + "string", + "null" + ] + }, + "options": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "label" + ], + "additionalProperties": {} + } + }, + "invited": { + "type": [ + "number", + "null" + ] + }, + "responses": { + "description": "Answers per question" + } + }, + "required": [ + "id", + "eventId", + "audience", + "anonymous", + "fields" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ], + "description": "null when the event has no feedback form" + } }, "required": [ "data" @@ -20251,7 +26759,89 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "sendAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "audience": { + "description": "checked_in or everyone", + "type": [ + "string", + "null" + ] + }, + "anonymous": { + "type": [ + "boolean", + "null" + ] + }, + "intro": { + "type": [ + "string", + "null" + ] + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "description": "rating, multiple_choice, text, yes_no…" + }, + "label": { + "type": "string" + }, + "isRequired": { + "type": [ + "boolean", + "null" + ] + }, + "helpText": { + "type": [ + "string", + "null" + ] + }, + "options": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "label" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "fields" + ], "additionalProperties": {} } } @@ -20265,7 +26855,125 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sendAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "sentAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "audience": { + "type": "string", + "description": "checked_in or everyone" + }, + "anonymous": { + "type": "boolean" + }, + "intro": { + "type": [ + "string", + "null" + ] + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "description": "rating, multiple_choice, text, yes_no…" + }, + "label": { + "type": "string" + }, + "isRequired": { + "type": [ + "boolean", + "null" + ] + }, + "helpText": { + "type": [ + "string", + "null" + ] + }, + "options": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "label" + ], + "additionalProperties": {} + } + }, + "invited": { + "type": [ + "number", + "null" + ] + }, + "responses": { + "description": "Answers per question" + } + }, + "required": [ + "id", + "eventId", + "audience", + "anonymous", + "fields" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ], + "description": "null when the event has no feedback form" + } }, "required": [ "data" @@ -20350,7 +27058,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20431,6 +27150,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -20449,7 +27169,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "invited": { + "type": "number" + }, + "message": { + "type": "string" + } + }, + "required": [ + "invited", + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20524,7 +27259,470 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -20600,7 +27798,25 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "ticketIds": { + "description": "The tickets sent", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20651,6 +27867,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -20660,6 +27877,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -20674,7 +27892,96 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "scannedBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "ticket": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "event": { + "type": "object", + "properties": { + "title": { + "type": "string" + } + }, + "required": [ + "title" + ], + "additionalProperties": {} + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "event" + ], + "additionalProperties": {} + } + }, + "required": [ + "id", + "scannedAt", + "quantityRedeemed", + "ticket" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -20735,6 +28042,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -20749,7 +28057,50 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "totalToday": { + "type": "number" + }, + "myToday": { + "type": "number" + }, + "lastHour": { + "type": "number" + }, + "byStaff": { + "type": "array", + "items": { + "type": "object", + "properties": { + "scannedById": { + "type": "string" + }, + "name": { + "type": "string" + }, + "count": { + "type": "number" + } + }, + "required": [ + "scannedById", + "name", + "count" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "totalToday", + "myToday", + "lastHour", + "byStaff" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20812,7 +28163,46 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "registrationId": { + "type": [ + "string", + "null" + ] + }, + "ticketIds": { + "description": "Or registrationId", + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string", + "enum": [ + "email", + "whatsapp", + "both" + ], + "description": "How to send it" + }, + "overrideEmail": { + "description": "Send here instead", + "type": [ + "string", + "null" + ] + }, + "overridePhone": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "channel" + ], "additionalProperties": {} } } @@ -20826,7 +28216,25 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "ticketIds": { + "description": "The tickets sent", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20912,7 +28320,483 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "tickets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "message", + "tickets" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -20975,7 +28859,18 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "ticketIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + } + }, + "required": [ + "ticketIds" + ], "additionalProperties": {} } } @@ -20989,7 +28884,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21050,6 +28956,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -21059,6 +28966,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -21068,6 +28976,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -21082,7 +28991,495 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "pages": { + "type": "number" + } + }, + "required": [ + "data", + "total", + "page", + "limit", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21143,6 +29540,7 @@ "name": "qrCode", "in": "path", "required": true, + "description": "What the ticket's QR code holds", "schema": { "type": "string", "minLength": 1, @@ -21158,7 +29556,467 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21245,7 +30103,470 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -21311,6 +30632,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -21326,7 +30648,132 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "pending, accepted, declined, cancelled, expired" + }, + "toName": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "fromName": { + "type": "string" + }, + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + "option": { + "type": "string" + } + }, + "required": [ + "status", + "toName", + "expiresAt", + "fromName", + "event", + "option" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21372,6 +30819,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -21381,6 +30829,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -21399,7 +30848,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "ticketId": { + "type": "string" + } + }, + "required": [ + "message", + "ticketId" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21445,6 +30909,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -21454,6 +30919,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -21472,7 +30938,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21539,7 +31016,467 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string", + "description": "What the QR code holds" + }, + "quantity": { + "type": "number", + "description": "People on the ticket" + }, + "isUsed": { + "type": "boolean" + }, + "eventId": { + "type": "string" + }, + "userId": { + "type": "string", + "description": "The payer" + }, + "registrationOptionId": { + "type": "string" + }, + "attendeeId": { + "description": "A named ticket: the person it's for", + "type": [ + "string", + "null" + ] + }, + "holderUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "usages": { + "description": "Check-ins", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "scannedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "quantityRedeemed": { + "type": "number" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "manual": { + "description": "Ticked present by hand", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "scannedAt", + "quantityRedeemed" + ], + "additionalProperties": {} + } + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "user": { + "description": "The payer", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "attendee": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registrationOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "eventOption": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "variant": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "registration": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "confirmed", + "partial_paid", + "paid", + "cancelled" + ] + }, + "discountTotal": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "totalDueComputed": { + "description": "What it costs now, after discounts", + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "qrCode", + "quantity", + "isUsed", + "eventId", + "userId", + "registrationOptionId", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21614,7 +31551,64 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string", + "description": "Who it goes to" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "description": "Email or phone needed", + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "description": "Youth events", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "parentName": { + "type": [ + "string", + "null" + ] + }, + "parentEmail": { + "type": [ + "string", + "null" + ] + }, + "parentPhone": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -21628,7 +31622,27 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "requestId": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "message", + "requestId", + "expiresAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21703,7 +31717,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -21780,7 +31805,42 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "ticketId": { + "type": "string" + }, + "fromUserId": { + "type": [ + "string", + "null" + ] + }, + "toUserId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "ticketId", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -21841,6 +31901,7 @@ "name": "eventId", "in": "query", "required": true, + "description": "Only this event", "schema": { "type": "string", "minLength": 1, @@ -21856,7 +31917,114 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sectionId": { + "type": [ + "string", + "null" + ] + }, + "sectionName": { + "type": [ + "string", + "null" + ] + }, + "deviceId": { + "type": "string" + }, + "deviceName": { + "type": [ + "string", + "null" + ] + }, + "user": { + "description": "Who holds it", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "lockedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "snapshotAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastSyncAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "releasedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "deviceId", + "lockedAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -21919,13 +32087,28 @@ "type": "object", "properties": { "eventId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" + }, + "sectionId": { + "description": "Just this section (default: the whole event)", + "type": [ + "string", + "null" + ] + }, + "deviceId": { + "type": "string" + }, + "deviceName": { + "type": [ + "string", + "null" + ] } }, "required": [ - "eventId" + "eventId", + "deviceId" ], "additionalProperties": {} } @@ -21940,7 +32123,111 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sectionId": { + "type": [ + "string", + "null" + ] + }, + "sectionName": { + "type": [ + "string", + "null" + ] + }, + "deviceId": { + "type": "string" + }, + "deviceName": { + "type": [ + "string", + "null" + ] + }, + "user": { + "description": "Who holds it", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "lockedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "snapshotAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastSyncAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "releasedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "deviceId", + "lockedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22001,6 +32288,7 @@ "name": "eventId", "in": "query", "required": true, + "description": "Only this event", "schema": { "type": "string", "minLength": 1, @@ -22011,6 +32299,7 @@ "name": "unreviewed", "in": "query", "required": false, + "description": "`true`: only the ones not reviewed yet", "schema": { "type": "string", "maxLength": 10 @@ -22025,7 +32314,156 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "accepted": { + "type": [ + "number", + "null" + ] + }, + "duplicates": { + "type": [ + "number", + "null" + ] + }, + "conflicts": {}, + "reviewedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "scanLock": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sectionId": { + "type": [ + "string", + "null" + ] + }, + "sectionName": { + "type": [ + "string", + "null" + ] + }, + "deviceId": { + "type": "string" + }, + "deviceName": { + "type": [ + "string", + "null" + ] + }, + "user": { + "description": "Who holds it", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "lockedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "snapshotAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastSyncAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "releasedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "deviceId", + "lockedAt" + ], + "additionalProperties": {} + } + }, + "required": [ + "id", + "createdAt", + "scanLock" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -22096,6 +32534,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -22114,7 +32553,27 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "reviewedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "reviewedById": { + "type": "string" + } + }, + "required": [ + "id", + "reviewedAt", + "reviewedById" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22196,6 +32655,7 @@ "name": "deviceId", "in": "query", "required": false, + "description": "This device's id (offline scanning)", "schema": { "type": "string", "maxLength": 4000 @@ -22210,7 +32670,203 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "lock": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sectionId": { + "type": [ + "string", + "null" + ] + }, + "sectionName": { + "type": [ + "string", + "null" + ] + }, + "deviceId": { + "type": "string" + }, + "deviceName": { + "type": [ + "string", + "null" + ] + }, + "user": { + "description": "Who holds it", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "lockedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "snapshotAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastSyncAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "releasedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "deviceId", + "lockedAt" + ], + "additionalProperties": {} + }, + "snapshotAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "session": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "noSessionToday": { + "type": "boolean" + }, + "tickets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "qrCode": { + "type": "string" + }, + "holder": { + "type": "string" + }, + "bookedBy": { + "type": "string" + }, + "option": { + "type": "string" + }, + "variant": { + "type": [ + "string", + "null" + ] + }, + "quantity": { + "type": "number" + }, + "remaining": { + "type": "number" + }, + "consentStatus": { + "type": "string" + } + }, + "required": [ + "id", + "qrCode", + "holder", + "bookedBy", + "option", + "quantity", + "remaining", + "consentStatus" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "lock", + "snapshotAt", + "session", + "noSessionToday", + "tickets" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22295,7 +32951,59 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "deviceId": { + "type": "string" + }, + "scans": { + "maxItems": 2000, + "type": "array", + "items": { + "type": "object", + "properties": { + "clientScanId": { + "type": "string", + "description": "The device's id for the scan (repeats are ignored)" + }, + "qrCode": { + "type": "string" + }, + "qty": { + "type": [ + "number", + "string" + ] + }, + "scannedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "clientScanId", + "qrCode" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "deviceId", + "scans" + ], "additionalProperties": {} } } @@ -22309,7 +33017,40 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "accepted": { + "type": "number" + }, + "duplicates": { + "type": "number" + }, + "conflicts": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Scans that clashed with online check-ins" + }, + "reportId": { + "type": "string" + }, + "released": { + "type": "boolean" + } + }, + "required": [ + "accepted", + "duplicates", + "conflicts", + "reportId", + "released" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22390,6 +33131,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -22408,7 +33150,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22512,7 +33265,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22578,6 +33342,7 @@ "name": "code", "in": "path", "required": true, + "description": "The code", "schema": { "type": "string", "minLength": 1, @@ -22593,7 +33358,58 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "valid": { + "type": "boolean" + }, + "revoked": { + "type": [ + "boolean", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "event": { + "type": [ + "string", + "null" + ] + }, + "completedOn": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "valid" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22648,7 +33464,88 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "code": { + "type": "string", + "description": "For checking it at /verify" + }, + "name": { + "type": "string" + }, + "issuedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "sessionsAttended": { + "type": [ + "number", + "null" + ] + }, + "totalSessions": { + "type": [ + "number", + "null" + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "code", + "name", + "issuedAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -22691,7 +33588,41 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "description": "Event title to show", + "type": [ + "string", + "null" + ] + }, + "config": { + "type": "object", + "properties": { + "template": { + "description": "classic, modern, elegant, simple", + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "body": { + "description": "{name} and {event} are filled in", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {} + } + }, "additionalProperties": {} } } @@ -22839,6 +33770,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -22857,7 +33789,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "const": true + } + }, + "required": [ + "ok" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -22944,7 +33888,274 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + }, + "certificatesEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "certificateConfig": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + "columns": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Session id, or `event`" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": {} + } + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ticketId": { + "type": "string" + }, + "bookedSessions": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + { + "type": "null" + } + ], + "description": "Picked/ticked sessions (null: all)" + }, + "sessionTickets": { + "anyOf": [ + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "bookedBy": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "option": { + "type": "string" + }, + "variant": { + "type": [ + "string", + "null" + ] + }, + "quantity": { + "type": "number" + }, + "checkIns": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "number" + }, + "description": "Session id (or `event`) → people checked in" + }, + "attended": { + "type": "number" + }, + "total": { + "type": "number" + }, + "completed": { + "type": "boolean", + "description": "Meets the certificate rule" + }, + "certificate": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "ticketId", + "bookedSessions", + "sessionTickets", + "name", + "bookedBy", + "email", + "phone", + "option", + "quantity", + "checkIns", + "attended", + "total", + "completed" + ], + "additionalProperties": {} + } + }, + "totals": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "number" + } + } + }, + "required": [ + "event", + "columns", + "rows", + "totals" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23027,7 +34238,23 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "ticketId": { + "type": "string" + }, + "sessionId": { + "type": "string", + "description": "A session id, or `event` on a single-date event" + }, + "present": { + "type": "boolean" + } + }, + "required": [ + "ticketId", + "sessionId", + "present" + ], "additionalProperties": {} } } @@ -23041,7 +34268,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "const": true + } + }, + "required": [ + "ok" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23123,6 +34362,7 @@ "name": "format", "in": "query", "required": false, + "description": "File type, e.g. `pdf` or `xlsx`", "schema": { "type": "string", "maxLength": 4000 @@ -23132,6 +34372,7 @@ "name": "sessionId", "in": "query", "required": false, + "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 @@ -23224,7 +34465,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "ticketId": { + "description": "Just this person (default: everyone who qualifies)", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -23238,7 +34487,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "issued": { + "type": "number" + } + }, + "required": [ + "issued" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23323,7 +34583,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "certificateId": { + "description": "Just this one (default: every one not sent yet)", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -23337,7 +34605,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "sent": { + "type": "number" + }, + "skipped": { + "type": "number" + } + }, + "required": [ + "sent", + "skipped" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23492,7 +34775,131 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "medicalShown": { + "type": "boolean" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "setName": { + "type": "string" + }, + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endDate": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + }, + "members": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attendeeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "groupId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "name", + "setName", + "event", + "members" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "medicalShown", + "groups" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23559,7 +34966,211 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "sets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "showOnTicket": { + "type": "boolean" + }, + "order": { + "type": "number" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "setId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "leaderUserId": { + "type": [ + "string", + "null" + ] + }, + "minAge": { + "type": [ + "number", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "null" + ] + }, + "ratio": { + "type": [ + "number", + "null" + ] + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "setId", + "name", + "order" + ], + "additionalProperties": {} + } + }, + "assignments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attendeeId": { + "type": "string" + }, + "groupId": { + "type": "string" + } + }, + "required": [ + "attendeeId", + "groupId" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "eventId", + "name", + "showOnTicket", + "order", + "groups", + "assignments" + ], + "additionalProperties": {} + } + }, + "attendees": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "registrationId": { + "type": "string" + }, + "bookedBy": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "registrationId", + "bookedBy" + ], + "additionalProperties": {} + } + }, + "leaders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + } + }, + "unnamedPlaces": { + "type": "number", + "description": "Places with no name yet" + } + }, + "required": [ + "event", + "sets", + "attendees", + "leaders", + "unnamedPlaces" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23634,13 +35245,22 @@ "type": "object", "properties": { "eventId": { + "type": "string" + }, + "name": { "type": "string", - "minLength": 1, - "maxLength": 64 + "description": "e.g. Cabins, Buses" + }, + "showOnTicket": { + "type": [ + "boolean", + "null" + ] } }, "required": [ - "eventId" + "eventId", + "name" ], "additionalProperties": {} } @@ -23655,7 +35275,34 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "showOnTicket": { + "type": "boolean" + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "eventId", + "name", + "showOnTicket", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23730,7 +35377,20 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "showOnTicket": { + "type": [ + "boolean", + "null" + ] + } + }, "additionalProperties": {} } } @@ -23744,7 +35404,34 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "showOnTicket": { + "type": "boolean" + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "eventId", + "name", + "showOnTicket", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23829,7 +35516,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -23911,6 +35609,7 @@ "name": "medical", "in": "query", "required": false, + "description": "`true`: include medical notes (supervisors; logged)", "schema": { "type": "string", "maxLength": 4000 @@ -23925,7 +35624,117 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "set": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + }, + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "leader": { + "type": [ + "string", + "null" + ] + }, + "members": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attendeeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "groupId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "name", + "members" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "set", + "event", + "groups" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24010,7 +35819,65 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "capacity": { + "type": [ + "number", + "string", + "null" + ] + }, + "gender": { + "anyOf": [ + { + "type": "string", + "enum": [ + "male", + "female", + "mixed" + ] + }, + { + "type": "null" + } + ] + }, + "leaderUserId": { + "description": "A staff member", + "type": [ + "string", + "null" + ] + }, + "minAge": { + "type": [ + "number", + "string", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "string", + "null" + ] + }, + "ratio": { + "description": "Children per leader", + "type": [ + "number", + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -24024,7 +35891,66 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "setId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "leaderUserId": { + "type": [ + "string", + "null" + ] + }, + "minAge": { + "type": [ + "number", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "null" + ] + }, + "ratio": { + "type": [ + "number", + "null" + ] + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "setId", + "name", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24109,7 +36035,21 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "attendeeId": { + "type": "string" + }, + "groupId": { + "description": "null takes them out", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "attendeeId" + ], "additionalProperties": {} } } @@ -24123,7 +36063,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24208,7 +36159,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24293,7 +36255,16 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "mode": { + "description": "Keep each booking together, or spread them", + "type": "string", + "enum": [ + "together", + "split" + ] + } + }, "additionalProperties": {} } } @@ -24307,7 +36278,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "placed": { + "type": "number" + }, + "unplaced": { + "type": "number" + }, + "message": { + "type": "string" + } + }, + "required": [ + "placed", + "unplaced", + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24392,7 +36382,65 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "capacity": { + "type": [ + "number", + "string", + "null" + ] + }, + "gender": { + "anyOf": [ + { + "type": "string", + "enum": [ + "male", + "female", + "mixed" + ] + }, + { + "type": "null" + } + ] + }, + "leaderUserId": { + "description": "A staff member", + "type": [ + "string", + "null" + ] + }, + "minAge": { + "type": [ + "number", + "string", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "string", + "null" + ] + }, + "ratio": { + "description": "Children per leader", + "type": [ + "number", + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -24406,7 +36454,66 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "setId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "leaderUserId": { + "type": [ + "string", + "null" + ] + }, + "minAge": { + "type": [ + "number", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "null" + ] + }, + "ratio": { + "type": [ + "number", + "null" + ] + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "setId", + "name", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -24491,7 +36598,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -25927,7 +38045,220 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "family": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "qrToken": { + "description": "The family QR code (shown at the desk)", + "type": [ + "string", + "null" + ] + }, + "codes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Collection codes for children checked in now" + }, + "pages": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Recent \"come to the room\" messages" + } + }, + "required": [ + "family", + "codes", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -25968,7 +38299,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -25982,7 +38320,220 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "family": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "qrToken": { + "description": "The family QR code (shown at the desk)", + "type": [ + "string", + "null" + ] + }, + "codes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Collection codes for children checked in now" + }, + "pages": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Recent \"come to the room\" messages" + } + }, + "required": [ + "family", + "codes", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26033,7 +38584,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -26047,7 +38605,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26100,7 +38828,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What happened: left, or the family was deleted as the last parent" + } }, "required": [ "data" @@ -26143,7 +38876,57 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "description": "male or female (anything else: not given)", + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medicalNotes": { + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "description": "Kept encrypted, like the medical notes", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "firstName" + ], "additionalProperties": {} } } @@ -26157,7 +38940,92 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26222,7 +39090,54 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "description": "male or female (anything else: not given)", + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medicalNotes": { + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "description": "Kept encrypted, like the medical notes", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -26236,7 +39151,92 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26311,7 +39311,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26374,7 +39385,26 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -26388,7 +39418,34 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26453,7 +39510,26 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -26467,7 +39543,34 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26542,7 +39645,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26607,7 +39721,110 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + }, + "kidsCheckIn": { + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {} + } + } }, "required": [ "data" @@ -26662,7 +39879,104 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {} + } + } }, "required": [ "data" @@ -26729,7 +40043,101 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "scheduleType": { + "type": [ + "string", + "null" + ] + }, + "kidsCheckIn": { + "type": "boolean" + }, + "kidsOptionId": { + "type": [ + "string", + "null" + ] + }, + "kidsRoomSetId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "title", + "kidsCheckIn" + ], + "additionalProperties": {} + }, + "options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + } + }, + "sets": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Allocation sets that can be the rooms" + } + }, + "required": [ + "event", + "options", + "sets" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -26812,8 +40220,30 @@ "application/json": { "schema": { "type": "object", - "properties": {}, - "additionalProperties": {} + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + }, + "optionId": { + "description": "The kids ticket (`new` makes a free one; null: none)", + "type": [ + "string", + "null" + ] + }, + "roomSetId": { + "description": "The allocation set used as rooms", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Only what changes" } } } @@ -26826,7 +40256,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The saved set-up, as GET answers" + } }, "required": [ "data" @@ -26908,6 +40343,7 @@ "name": "sessionId", "in": "query", "required": false, + "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 @@ -26917,6 +40353,7 @@ "name": "log", "in": "query", "required": false, + "description": "`1` also writes it to the access log (a list with personal details)", "schema": { "type": "string", "maxLength": 4000 @@ -26931,7 +40368,110 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "occasion": { + "type": "string", + "description": "The day or session it's for" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "sessionLabel": { + "type": [ + "string", + "null" + ] + }, + "rooms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "minAge": { + "type": [ + "number", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "null" + ] + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "ratio": { + "type": [ + "number", + "null" + ] + }, + "order": { + "type": [ + "number", + "null" + ] + }, + "leaderNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "leaderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + } + }, + "checkIns": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Children checked in, with room and code" + } + }, + "required": [ + "event", + "occasion", + "rooms", + "checkIns" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27013,6 +40553,7 @@ "name": "q", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -27022,6 +40563,7 @@ "name": "sessionId", "in": "query", "required": false, + "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 @@ -27036,7 +40578,180 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -27119,7 +40834,101 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "parent": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "description": "Email or phone needed: the collection code is sent there", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + "children": { + "maxItems": 12, + "type": "array", + "items": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "description": "male or female (anything else: not given)", + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medicalNotes": { + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "description": "Kept encrypted, like the medical notes", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "firstName" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "parent" + ], "additionalProperties": {} } } @@ -27133,7 +40942,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27204,6 +41183,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27214,6 +41194,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -27229,7 +41210,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27300,6 +41451,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27310,6 +41462,7 @@ "name": "familyId", "in": "path", "required": true, + "description": "The family's id", "schema": { "type": "string", "minLength": 1, @@ -27325,7 +41478,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27396,6 +41719,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27406,6 +41730,7 @@ "name": "familyId", "in": "path", "required": true, + "description": "The family's id", "schema": { "type": "string", "minLength": 1, @@ -27419,7 +41744,27 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "description": "Email or phone needed: the collection code is sent there", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -27433,7 +41778,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27504,6 +42019,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27514,6 +42030,7 @@ "name": "familyId", "in": "path", "required": true, + "description": "The family's id", "schema": { "type": "string", "minLength": 1, @@ -27527,7 +42044,57 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "description": "male or female (anything else: not given)", + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medicalNotes": { + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "description": "Kept encrypted, like the medical notes", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "firstName" + ], "additionalProperties": {} } } @@ -27541,7 +42108,92 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27612,6 +42264,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27622,6 +42275,7 @@ "name": "familyId", "in": "path", "required": true, + "description": "The family's id", "schema": { "type": "string", "minLength": 1, @@ -27632,6 +42286,7 @@ "name": "childId", "in": "path", "required": true, + "description": "The child's id", "schema": { "type": "string", "minLength": 1, @@ -27645,7 +42300,54 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "gender": { + "description": "male or female (anything else: not given)", + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "medicalNotes": { + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "description": "Kept encrypted, like the medical notes", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -27659,7 +42361,92 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27730,6 +42517,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -27740,6 +42528,7 @@ "name": "familyId", "in": "path", "required": true, + "description": "The family's id", "schema": { "type": "string", "minLength": 1, @@ -27753,7 +42542,26 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -27767,7 +42575,177 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27852,7 +42830,50 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "familyId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "childId": { + "type": "string" + }, + "roomId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "childId" + ], + "additionalProperties": {} + }, + "description": "Who, and into which room (default: by age)" + }, + "sendToAdultId": { + "description": "Send the code to this adult too", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "familyId", + "children" + ], "additionalProperties": {} } } @@ -27866,7 +42887,91 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The collection code" + }, + "qr": { + "type": "string" + }, + "occasion": { + "type": "string" + }, + "family": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + }, + "checkIns": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "room": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "already": { + "type": "boolean" + }, + "sticker": { + "description": "Write this on the sticker", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "firstName", + "already" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "code", + "qr", + "occasion", + "family", + "checkIns" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -27951,7 +43056,40 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "code": { + "type": "string" + }, + "checkInIds": { + "description": "Just these children (default: all on the code)", + "type": "array", + "items": { + "type": "string" + } + }, + "collectedBy": { + "description": "Who collected them", + "type": [ + "string", + "null" + ] + }, + "roomId": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "code" + ], "additionalProperties": {} } } @@ -27965,7 +43103,40 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkedOut": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "room": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "checkedOut" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28036,6 +43207,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -28046,6 +43218,7 @@ "name": "code", "in": "path", "required": true, + "description": "The code", "schema": { "type": "string", "minLength": 1, @@ -28056,6 +43229,7 @@ "name": "sessionId", "in": "query", "required": false, + "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 @@ -28070,7 +43244,83 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "found": { + "type": "boolean" + }, + "family": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "room": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "checkedOutAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "collectedBy": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "code", + "found", + "children" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28155,7 +43405,27 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "roomId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "on": { + "description": "false: off duty", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "roomId" + ], "additionalProperties": {} } } @@ -28169,7 +43439,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "roomId": { + "type": "string" + }, + "on": { + "type": "boolean" + } + }, + "required": [ + "roomId", + "on" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28251,6 +43536,7 @@ "name": "deviceId", "in": "query", "required": false, + "description": "This device's id (offline scanning)", "schema": { "type": "string", "maxLength": 4000 @@ -28260,6 +43546,7 @@ "name": "sessionId", "in": "query", "required": false, + "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 @@ -28274,7 +43561,300 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "occasion": { + "type": "string", + "description": "The day or session it's for" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "sessionLabel": { + "type": [ + "string", + "null" + ] + }, + "rooms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "minAge": { + "type": [ + "number", + "null" + ] + }, + "maxAge": { + "type": [ + "number", + "null" + ] + }, + "capacity": { + "type": [ + "number", + "null" + ] + }, + "ratio": { + "type": [ + "number", + "null" + ] + }, + "order": { + "type": [ + "number", + "null" + ] + }, + "leaderNames": { + "type": "array", + "items": { + "type": "string" + } + }, + "leaderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + } + }, + "checkIns": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Children checked in, with room and code" + }, + "families": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "userId", + "name" + ], + "additionalProperties": {} + } + }, + "children": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "dateOfBirth": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "age": { + "type": [ + "number", + "null" + ] + }, + "gender": { + "type": [ + "string", + "null" + ] + }, + "allergies": { + "type": [ + "string", + "null" + ] + }, + "hasMedical": { + "type": "boolean" + }, + "hasCustody": { + "type": "boolean", + "description": "There are custody notes" + }, + "medicalNotes": { + "description": "Only where notes may be shown", + "type": [ + "string", + "null" + ] + }, + "custodyNotes": { + "type": [ + "string", + "null" + ] + }, + "lastCheckInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "firstName", + "lastName", + "name", + "hasMedical", + "hasCustody" + ], + "additionalProperties": {} + } + }, + "adults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "relationship": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": {} + }, + "description": "Others who may collect the children" + } + }, + "required": [ + "id", + "name", + "parents", + "children", + "adults" + ], + "additionalProperties": {} + } + }, + "codes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Codes reserved for this device" + }, + "downloadedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "event", + "occasion", + "rooms", + "checkIns", + "families", + "codes", + "downloadedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28359,7 +43939,36 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "deviceId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "checkIns": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "checkOuts": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "deviceId" + ], "additionalProperties": {} } } @@ -28373,7 +43982,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "checkedIn": { + "type": "number" + }, + "checkedOut": { + "type": "number" + }, + "conflicts": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "checkedIn", + "checkedOut", + "conflicts" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28458,7 +44091,18 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "reason": { + "type": "string" + }, + "collectedBy": { + "type": "string" + } + }, + "required": [ + "reason", + "collectedBy" + ], "additionalProperties": {} } } @@ -28472,7 +44116,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "checkedOutAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "checkedOutAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28557,7 +44217,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "message": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -28571,7 +44238,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "sent": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Channels used" + }, + "text": { + "type": "string" + } + }, + "required": [ + "sent", + "text" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28656,7 +44342,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "roomId": { + "type": "string" + } + }, + "required": [ + "roomId" + ], "additionalProperties": {} } } @@ -28670,7 +44363,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "roomId": { + "type": "string" + } + }, + "required": [ + "id", + "roomId" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28751,6 +44459,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -28769,7 +44478,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "resolved": { + "type": "number" + } + }, + "required": [ + "resolved" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28844,7 +44564,148 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "slots": { + "type": "array", + "items": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "role": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "shift": { + "type": "object", + "properties": { + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "text": { + "type": "string" + }, + "hours": { + "type": "number" + } + }, + "required": [ + "startsAt", + "endsAt", + "text", + "hours" + ], + "additionalProperties": {} + }, + "checkedInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "canCheckIn": { + "type": "boolean" + }, + "past": { + "type": "boolean" + }, + "swapId": { + "type": [ + "string", + "null" + ] + }, + "hasTicket": { + "type": "boolean" + } + }, + "required": [ + "slotId", + "role", + "event", + "shift", + "canCheckIn", + "past", + "hasTicket" + ], + "additionalProperties": {} + } + }, + "cover": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Slots others want covered" + }, + "events": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "roles": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "startDate", + "endDate", + "roles" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "slots", + "cover", + "events" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28901,7 +44762,328 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "sessions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "label", + "startsAt", + "endsAt" + ], + "additionalProperties": {} + } + }, + "roles": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "sessionLabel": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "shift": { + "type": "object", + "properties": { + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "text": { + "type": "string" + }, + "hours": { + "type": "number" + } + }, + "required": [ + "startsAt", + "endsAt", + "text", + "hours" + ], + "additionalProperties": {} + }, + "kidsRoom": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "order": { + "type": "number" + }, + "past": { + "type": "boolean" + }, + "needed": { + "type": [ + "number", + "null" + ] + }, + "filled": { + "type": [ + "number", + "null" + ] + }, + "mine": { + "anyOf": [ + { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "checkedInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "swapId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "slotId" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ], + "description": "My place in it" + }, + "coverNeeded": { + "type": "array", + "items": { + "type": "object", + "properties": { + "swapId": { + "type": "string" + }, + "note": { + "type": "string" + } + }, + "required": [ + "swapId", + "note" + ], + "additionalProperties": {} + } + }, + "volunteers": { + "description": "Staff only", + "type": "array", + "items": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "assignedBy": { + "type": [ + "string", + "null" + ] + }, + "checkedInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkedInBy": { + "type": [ + "string", + "null" + ] + }, + "checkInMethod": { + "type": [ + "string", + "null" + ] + }, + "swapOpen": { + "type": "boolean" + }, + "hasTicket": { + "type": "boolean" + } + }, + "required": [ + "slotId", + "userId", + "name", + "swapOpen", + "hasTicket" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "eventId", + "name", + "description", + "shift", + "order", + "past", + "mine", + "coverNeeded" + ], + "additionalProperties": {} + } + }, + "totals": { + "type": "object", + "properties": { + "needed": { + "type": [ + "number", + "null" + ] + }, + "filled": { + "type": [ + "number", + "null" + ] + }, + "fillRate": { + "description": "%", + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + } + }, + "required": [ + "event", + "sessions", + "roles", + "totals" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -28974,7 +45156,71 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "description": "A multi-day event: the session", + "type": [ + "string", + "null" + ] + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "description": "Default: the event's or session's times", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "needed": { + "description": "How many people", + "type": [ + "number", + "string", + "null" + ] + }, + "kidsRoomId": { + "description": "Serving in a kids room: counts as a leader on duty", + "type": [ + "string", + "null" + ] + }, + "order": { + "type": [ + "number", + "string" + ] + } + }, + "required": [ + "name" + ], "additionalProperties": {} } } @@ -28988,7 +45234,76 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "needed": { + "type": [ + "number", + "null" + ] + }, + "kidsRoomId": { + "type": [ + "string", + "null" + ] + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "eventId", + "name", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29069,6 +45384,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -29087,7 +45403,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "ticket": { + "type": "boolean", + "description": "A free volunteer ticket was issued" + } + }, + "required": [ + "slotId", + "ticket" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29164,7 +45496,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29239,7 +45582,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "note": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -29253,7 +45603,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "swapId": { + "type": "string" + } + }, + "required": [ + "swapId" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29330,7 +45691,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "cancelled": { + "type": "boolean", + "const": true + } + }, + "required": [ + "cancelled" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29401,6 +45774,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -29419,7 +45793,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "role": { + "type": "string" + }, + "event": { + "type": "string" + } + }, + "required": [ + "slotId", + "role", + "event" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29482,7 +45875,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "qr": { + "type": "string", + "description": "What the QR code holds" + } + }, + "required": [ + "qr" + ], "additionalProperties": {} } } @@ -29496,7 +45897,60 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + "checkedIn": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "kidsRoom": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "role" + ], + "additionalProperties": {} + } + }, + "already": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "event", + "checkedIn", + "already" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29547,6 +46001,7 @@ "name": "all", "in": "query", "required": false, + "description": "`true`/`1`: include everything, not just the current ones", "schema": { "type": "string", "maxLength": 4000 @@ -29561,7 +46016,51 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "scheduleType": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "roles": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "startDate", + "endDate", + "roles" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -29622,6 +46121,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -29631,6 +46131,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -29640,6 +46141,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -29654,7 +46156,34 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "hours": { + "type": "number" + }, + "shifts": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "name", + "hours" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -29726,6 +46255,7 @@ "name": "log", "in": "query", "required": false, + "description": "`1` also writes it to the access log (a list with personal details)", "schema": { "type": "string", "maxLength": 4000 @@ -29740,7 +46270,328 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "sessions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "label", + "startsAt", + "endsAt" + ], + "additionalProperties": {} + } + }, + "roles": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "sessionLabel": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "shift": { + "type": "object", + "properties": { + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "text": { + "type": "string" + }, + "hours": { + "type": "number" + } + }, + "required": [ + "startsAt", + "endsAt", + "text", + "hours" + ], + "additionalProperties": {} + }, + "kidsRoom": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "order": { + "type": "number" + }, + "past": { + "type": "boolean" + }, + "needed": { + "type": [ + "number", + "null" + ] + }, + "filled": { + "type": [ + "number", + "null" + ] + }, + "mine": { + "anyOf": [ + { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "checkedInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "swapId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "slotId" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ], + "description": "My place in it" + }, + "coverNeeded": { + "type": "array", + "items": { + "type": "object", + "properties": { + "swapId": { + "type": "string" + }, + "note": { + "type": "string" + } + }, + "required": [ + "swapId", + "note" + ], + "additionalProperties": {} + } + }, + "volunteers": { + "description": "Staff only", + "type": "array", + "items": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "assignedBy": { + "type": [ + "string", + "null" + ] + }, + "checkedInAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "checkedInBy": { + "type": [ + "string", + "null" + ] + }, + "checkInMethod": { + "type": [ + "string", + "null" + ] + }, + "swapOpen": { + "type": "boolean" + }, + "hasTicket": { + "type": "boolean" + } + }, + "required": [ + "slotId", + "userId", + "name", + "swapOpen", + "hasTicket" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "eventId", + "name", + "description", + "shift", + "order", + "past", + "mine", + "coverNeeded" + ], + "additionalProperties": {} + } + }, + "totals": { + "type": "object", + "properties": { + "needed": { + "type": [ + "number", + "null" + ] + }, + "filled": { + "type": [ + "number", + "null" + ] + }, + "fillRate": { + "description": "%", + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + } + }, + "required": [ + "event", + "sessions", + "roles", + "totals" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29827,7 +46678,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "qr": { + "type": "string", + "description": "Put this in the QR code" + } + }, + "required": [ + "token", + "qr" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29914,7 +46781,84 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "volunteerOptionId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "title" + ], + "additionalProperties": {} + }, + "options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": {} + } + }, + "kidsRooms": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "event", + "options", + "kidsRooms" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -29997,7 +46941,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "optionId": { + "description": "The free volunteer ticket (null: none)", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -30011,7 +46963,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The saved set-up, as GET answers" + } }, "required": [ "data" @@ -30096,7 +47053,68 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "description": "A multi-day event: the session", + "type": [ + "string", + "null" + ] + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "description": "Default: the event's or session's times", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "needed": { + "description": "How many people", + "type": [ + "number", + "string", + "null" + ] + }, + "kidsRoomId": { + "description": "Serving in a kids room: counts as a leader on duty", + "type": [ + "string", + "null" + ] + }, + "order": { + "type": [ + "number", + "string" + ] + } + }, "additionalProperties": {} } } @@ -30110,7 +47128,76 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "sessionId": { + "type": [ + "string", + "null" + ] + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "needed": { + "type": [ + "number", + "null" + ] + }, + "kidsRoomId": { + "type": [ + "string", + "null" + ] + }, + "order": { + "type": "number" + } + }, + "required": [ + "id", + "eventId", + "name", + "order" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30195,7 +47282,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "volunteers": { + "type": "number", + "description": "People who were in it (told by message)" + } + }, + "required": [ + "message", + "volunteers" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30280,7 +47383,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userId": { + "type": "string" + } + }, + "required": [ + "userId" + ], "additionalProperties": {} } } @@ -30294,7 +47404,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "ticket": { + "type": "boolean", + "description": "A free volunteer ticket was issued" + } + }, + "required": [ + "slotId", + "ticket" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30379,7 +47505,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "undo": { + "type": [ + "boolean", + "null" + ] + } + }, "additionalProperties": {} } } @@ -30393,7 +47526,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "slotId": { + "type": "string" + }, + "changed": { + "type": "boolean" + } + }, + "required": [ + "slotId", + "changed" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30474,6 +47622,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -30492,7 +47641,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30560,7 +47720,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "challengeId": { + "type": "string" + } + }, + "required": [ + "challengeId" + ], "additionalProperties": {} } } @@ -30574,7 +47741,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "challengeId": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + "destination": { + "type": "string", + "description": "Where the code went, partly hidden" + } + }, + "required": [ + "challengeId", + "method", + "destination" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30634,7 +47825,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30672,7 +47874,19 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "token": { + "type": "string", + "description": "From the link" + }, + "password": { + "type": "string" + } + }, + "required": [ + "token", + "password" + ], "additionalProperties": {} } } @@ -30686,7 +47900,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30724,7 +47949,26 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "token": { + "type": "string", + "description": "From the link" + }, + "password": { + "type": "string", + "description": "At least 8 characters" + }, + "acceptTerms": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "token", + "password" + ], "additionalProperties": {} } } @@ -30738,7 +47982,41 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "role": { + "type": "string" + }, + "token": { + "type": "string", + "description": "A new sign-in token" + } + }, + "required": [ + "id", + "name", + "email", + "role", + "token" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30777,6 +48055,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -30795,7 +48074,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "token": { + "type": "string", + "description": "A new token for this device (the old one stops working)" + } + }, + "required": [ + "message", + "token" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30848,7 +48143,21 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "password": { + "type": "string" + }, + "deleteData": { + "description": "Also ask for my personal information to be deleted", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "password" + ], "additionalProperties": {} } } @@ -30862,7 +48171,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -30917,7 +48237,37 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "description": "login, password_changed, two_factor_enabled…" + }, + "device": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "type", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -30960,7 +48310,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], "additionalProperties": {} } } @@ -30974,7 +48331,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "const": true + } + }, + "required": [ + "ok" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31027,7 +48396,22 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "method": { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + "password": { + "type": "string" + } + }, + "required": [ + "method", + "password" + ], "additionalProperties": {} } } @@ -31041,7 +48425,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "challengeId": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + "destination": { + "type": "string", + "description": "Where the code went, partly hidden" + } + }, + "required": [ + "challengeId", + "method", + "destination" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31094,7 +48502,18 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "challengeId": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "challengeId", + "code" + ], "additionalProperties": {} } } @@ -31108,7 +48527,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "twoFactorEnabled": { + "type": "boolean", + "const": true + }, + "twoFactorMethod": { + "type": "string" + } + }, + "required": [ + "twoFactorEnabled", + "twoFactorMethod" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31161,7 +48596,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ], "additionalProperties": {} } } @@ -31175,7 +48617,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "twoFactorEnabled": { + "type": "boolean", + "const": false + }, + "twoFactorMethod": { + "type": "null" + } + }, + "required": [ + "twoFactorEnabled", + "twoFactorMethod" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31226,6 +48684,7 @@ "name": "email", "in": "query", "required": false, + "description": "An email address", "schema": { "type": "string", "maxLength": 4000 @@ -31235,6 +48694,7 @@ "name": "phone", "in": "query", "required": false, + "description": "A phone number", "schema": { "type": "string", "maxLength": 4000 @@ -31244,6 +48704,7 @@ "name": "phoneNumber", "in": "query", "required": false, + "description": "A phone number", "schema": { "type": "string", "maxLength": 4000 @@ -31258,7 +48719,71 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "exists": { + "type": "boolean" + }, + "hasEmail": { + "type": [ + "boolean", + "null" + ] + }, + "hasPhone": { + "type": [ + "boolean", + "null" + ] + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + }, + "notificationPreference": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "exists" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31319,6 +48844,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -31328,6 +48854,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -31337,6 +48864,7 @@ "name": "search", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -31346,6 +48874,7 @@ "name": "role", "in": "query", "required": false, + "description": "admin, supervisor, staff or user", "schema": { "type": "string", "maxLength": 4000 @@ -31355,6 +48884,7 @@ "name": "isActive", "in": "query", "required": false, + "description": "`true` or `false`", "schema": { "type": "string", "maxLength": 4000 @@ -31364,6 +48894,7 @@ "name": "campus", "in": "query", "required": false, + "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 @@ -31378,7 +48909,108 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + }, + "role": { + "type": "string", + "enum": [ + "admin", + "supervisor", + "staff", + "user" + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "notificationPreference": { + "anyOf": [ + { + "type": "string", + "enum": [ + "email", + "whatsapp", + "both" + ] + }, + { + "type": "null" + } + ] + }, + "homeCampusId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "name", + "email", + "role" + ], + "additionalProperties": {} + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "pages": { + "type": "number" + } + }, + "required": [ + "data", + "total", + "page", + "limit", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31455,7 +49087,87 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + }, + "role": { + "type": "string", + "enum": [ + "admin", + "supervisor", + "staff", + "user" + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "notificationPreference": { + "anyOf": [ + { + "type": "string", + "enum": [ + "email", + "whatsapp", + "both" + ] + }, + { + "type": "null" + } + ] + }, + "homeCampusId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "scopedCampusIds": { + "description": "Campuses they're limited to", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "name", + "email", + "role" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31538,7 +49250,67 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + }, + "role": { + "description": "admin, supervisor, staff or user", + "type": [ + "string", + "null" + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "password": { + "description": "Set a new password", + "type": [ + "string", + "null" + ] + }, + "notificationPreference": { + "description": "email, whatsapp or both", + "type": [ + "string", + "null" + ] + }, + "twoFactorEnabled": { + "description": "Only to turn it off", + "type": [ + "boolean", + "null" + ] + }, + "scopedCampusIds": { + "description": "Limit staff to these campuses (empty: all)", + "type": "array", + "items": { + "type": "string" + } + } + }, "additionalProperties": {} } } @@ -31552,7 +49324,80 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phoneNumber": { + "type": [ + "string", + "null" + ] + }, + "role": { + "type": "string", + "enum": [ + "admin", + "supervisor", + "staff", + "user" + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "notificationPreference": { + "anyOf": [ + { + "type": "string", + "enum": [ + "email", + "whatsapp", + "both" + ] + }, + { + "type": "null" + } + ] + }, + "homeCampusId": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "name", + "email", + "role" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31637,7 +49482,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31718,6 +49574,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -31736,7 +49593,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31817,6 +49685,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -31835,7 +49704,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -31901,6 +49781,7 @@ "name": "campus", "in": "query", "required": false, + "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 @@ -31910,6 +49791,7 @@ "name": "series", "in": "query", "required": false, + "description": "Event series slug", "schema": { "type": "string", "maxLength": 4000 @@ -31924,7 +49806,159 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + }, + "eventOptions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": "number", + "description": "Rand" + }, + "isMainTicket": { + "type": "boolean" + }, + "stockLimit": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "id", + "name", + "price", + "isMainTicket" + ], + "additionalProperties": {} + } + }, + "isSoldOut": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "id", + "title", + "startDate", + "endDate" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -31969,7 +50003,110 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "startDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endDate": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "location": { + "type": [ + "string", + "null" + ] + }, + "price": { + "anyOf": [ + { + "type": "number", + "description": "Rand" + }, + { + "type": "null" + } + ] + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + }, + "isHidden": { + "type": [ + "boolean", + "null" + ] + }, + "imageUrl": { + "type": [ + "string", + "null" + ] + }, + "campusId": { + "type": [ + "string", + "null" + ] + }, + "scheduleType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "single", + "sessions" + ] + }, + { + "type": "null" + } + ] + }, + "cashupStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "title", + "startDate", + "endDate" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -32034,7 +50171,118 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "subject": { + "type": [ + "string", + "null" + ] + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "description": "subject and html or text, unless template is tickets", + "type": [ + "string", + "null" + ] + }, + "template": { + "description": "tickets: send everyone their tickets; the reminders fill in a standard message", + "type": "string", + "enum": [ + "custom", + "tickets", + "payment_reminder", + "event_reminder" + ] + }, + "filter": { + "type": "object", + "properties": { + "status": { + "description": "any, paid, unpaid, checked_in, not_checked_in…", + "type": [ + "string", + "null" + ] + }, + "attendeeIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "registrationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "allocationGroupId": { + "description": "People in one room or group", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "audience": { + "description": "Sponsors of the event instead", + "type": "string", + "enum": [ + "sponsors" + ] + } + }, + "additionalProperties": {} + }, + "dryRun": { + "description": "Only say who it would reach", + "type": [ + "boolean", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "update", + "news" + ], + "description": "update: about something they booked (always sent). news: needs their news consent" + }, + "promoEventId": { + "description": "Promote another event (news)", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -32048,7 +50296,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32133,7 +50438,125 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "subject": { + "type": [ + "string", + "null" + ] + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "description": "subject and html or text, unless template is tickets", + "type": [ + "string", + "null" + ] + }, + "template": { + "description": "tickets: send everyone their tickets; the reminders fill in a standard message", + "type": "string", + "enum": [ + "custom", + "tickets", + "payment_reminder", + "event_reminder" + ] + }, + "filter": { + "type": "object", + "properties": { + "status": { + "description": "any, paid, unpaid, checked_in, not_checked_in…", + "type": [ + "string", + "null" + ] + }, + "attendeeIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "registrationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "allocationGroupId": { + "description": "People in one room or group", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "audience": { + "description": "Sponsors of the event instead", + "type": "string", + "enum": [ + "sponsors" + ] + } + }, + "additionalProperties": {} + }, + "dryRun": { + "description": "Only say who it would reach", + "type": [ + "boolean", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "update", + "news" + ], + "description": "update: about something they booked (always sent). news: needs their news consent" + }, + "promoEventId": { + "description": "Promote another event (news)", + "type": [ + "string", + "null" + ] + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "scheduledAt" + ], "additionalProperties": {} } } @@ -32147,7 +50570,24 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "job": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "message", + "job" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32232,7 +50672,103 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "message": { + "description": "Required unless template is tickets", + "type": [ + "string", + "null" + ] + }, + "template": { + "type": "string", + "enum": [ + "custom", + "tickets", + "payment_reminder", + "event_reminder" + ] + }, + "filter": { + "type": "object", + "properties": { + "status": { + "description": "any, paid, unpaid, checked_in, not_checked_in…", + "type": [ + "string", + "null" + ] + }, + "attendeeIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "registrationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "allocationGroupId": { + "description": "People in one room or group", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "audience": { + "description": "Sponsors of the event instead", + "type": "string", + "enum": [ + "sponsors" + ] + } + }, + "additionalProperties": {} + }, + "dryRun": { + "type": [ + "boolean", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "update", + "news" + ], + "description": "update: about something they booked (always sent). news: needs their news consent" + }, + "promoEventId": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -32246,7 +50782,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32331,7 +50924,110 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "message": { + "description": "Required unless template is tickets", + "type": [ + "string", + "null" + ] + }, + "template": { + "type": "string", + "enum": [ + "custom", + "tickets", + "payment_reminder", + "event_reminder" + ] + }, + "filter": { + "type": "object", + "properties": { + "status": { + "description": "any, paid, unpaid, checked_in, not_checked_in…", + "type": [ + "string", + "null" + ] + }, + "attendeeIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "registrationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids" + }, + "allocationGroupId": { + "description": "People in one room or group", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "audience": { + "description": "Sponsors of the event instead", + "type": "string", + "enum": [ + "sponsors" + ] + } + }, + "additionalProperties": {} + }, + "dryRun": { + "type": [ + "boolean", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "update", + "news" + ], + "description": "update: about something they booked (always sent). news: needs their news consent" + }, + "promoEventId": { + "type": [ + "string", + "null" + ] + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "scheduledAt" + ], "additionalProperties": {} } } @@ -32345,7 +51041,24 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "job": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "message", + "job" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32418,7 +51131,37 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "emails": { + "description": "Typed-in addresses, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + } + }, "additionalProperties": {} } } @@ -32432,7 +51175,82 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32495,7 +51313,55 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "emails": { + "description": "Typed-in addresses, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + }, + "subject": { + "type": "string" + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "subject" + ], "additionalProperties": {} } } @@ -32509,7 +51375,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32572,7 +51495,60 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "emails": { + "description": "Typed-in addresses, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + }, + "subject": { + "type": "string" + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": [ + "string", + "null" + ] + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "subject", + "scheduledAt" + ], "additionalProperties": {} } } @@ -32586,7 +51562,24 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "job": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "message", + "job" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32649,7 +51642,37 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "phones": { + "description": "Typed-in numbers, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + } + }, "additionalProperties": {} } } @@ -32663,7 +51686,82 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + }, + "event": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32726,7 +51824,43 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "phones": { + "description": "Typed-in numbers, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], "additionalProperties": {} } } @@ -32740,7 +51874,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventId": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": [ + "string", + "null" + ] + }, + "matched": { + "type": "number" + }, + "skipped": { + "description": "Left out: no news consent", + "type": [ + "number", + "null" + ] + }, + "recipients": { + "description": "The first 20", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "queued": { + "type": [ + "number", + "null" + ] + }, + "template": { + "type": [ + "string", + "null" + ] + }, + "sent": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "matched" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32803,7 +51994,48 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "userIds": { + "description": "Chosen accounts", + "type": "array", + "items": { + "type": "string" + } + }, + "phones": { + "description": "Typed-in numbers, separated by commas or new lines", + "type": [ + "string", + "null" + ] + }, + "eventId": { + "description": "Everyone registered for this event", + "type": [ + "string", + "null" + ] + }, + "kind": { + "description": "Default news", + "type": "string", + "enum": [ + "update", + "news" + ] + }, + "message": { + "type": "string" + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "message", + "scheduledAt" + ], "additionalProperties": {} } } @@ -32817,7 +52049,24 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "job": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "message", + "job" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32878,6 +52127,7 @@ "name": "status", "in": "query", "required": false, + "description": "Only this status", "schema": { "type": "string", "maxLength": 4000 @@ -32887,6 +52137,7 @@ "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -32896,6 +52147,7 @@ "name": "channel", "in": "query", "required": false, + "description": "email or whatsapp", "schema": { "type": "string", "maxLength": 4000 @@ -32910,7 +52162,126 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "kind": { + "type": "string", + "description": "broadcast or attendees" + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "broadcast": { + "type": "boolean" + }, + "channel": { + "anyOf": [ + { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + { + "type": "string" + } + ] + }, + "recipient": { + "type": [ + "string", + "null" + ] + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "status": { + "type": "string", + "description": "queued, sent, failed, cancelled" + }, + "attempts": { + "type": "number" + }, + "sentAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "subject": { + "type": "string" + }, + "html": { + "type": "string" + }, + "text": { + "type": "string" + }, + "message": { + "type": "string" + }, + "hasHtml": { + "type": "boolean" + }, + "hasText": { + "type": "boolean" + } + }, + "required": [ + "id", + "kind", + "broadcast", + "channel", + "scheduledAt", + "createdAt", + "status", + "attempts", + "subject", + "html", + "text", + "message", + "hasHtml", + "hasText" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "jobs" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -32985,7 +52356,44 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "scheduledAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "subject": { + "type": [ + "string", + "null" + ] + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": [ + "string", + "null" + ] + }, + "message": { + "description": "WhatsApp", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -32999,7 +52407,127 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "job": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "kind": { + "type": "string", + "description": "broadcast or attendees" + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "broadcast": { + "type": "boolean" + }, + "channel": { + "anyOf": [ + { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + }, + { + "type": "string" + } + ] + }, + "recipient": { + "type": [ + "string", + "null" + ] + }, + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "status": { + "type": "string", + "description": "queued, sent, failed, cancelled" + }, + "attempts": { + "type": "number" + }, + "sentAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "subject": { + "type": "string" + }, + "html": { + "type": "string" + }, + "text": { + "type": "string" + }, + "message": { + "type": "string" + }, + "hasHtml": { + "type": "boolean" + }, + "hasText": { + "type": "boolean" + } + }, + "required": [ + "id", + "kind", + "broadcast", + "channel", + "scheduledAt", + "createdAt", + "status", + "attempts", + "subject", + "html", + "text", + "message", + "hasHtml", + "hasText" + ], + "additionalProperties": {} + } + }, + "required": [ + "message", + "job" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33084,7 +52612,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33159,13 +52698,57 @@ "type": "object", "properties": { "eventId": { - "type": "string", - "minLength": 1, - "maxLength": 64 + "type": "string" + }, + "jobs": { + "minItems": 1, + "type": "array", + "items": { + "type": "object", + "properties": { + "scheduledAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "subject": { + "type": "string" + }, + "html": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": [ + "string", + "null" + ] + }, + "audience": { + "type": "string", + "enum": [ + "sponsors" + ] + }, + "promoEventId": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "scheduledAt", + "subject" + ], + "additionalProperties": {} + } } }, "required": [ - "eventId" + "eventId", + "jobs" ], "additionalProperties": {} } @@ -33180,7 +52763,27 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "message", + "jobs" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33245,7 +52848,40 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "tokenMasked": { + "type": "string" + }, + "instanceId": { + "type": "string" + }, + "hasToken": { + "type": "boolean" + }, + "hasInstance": { + "type": "boolean" + }, + "configured": { + "type": "boolean" + }, + "webhookUrl": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "tokenMasked", + "instanceId", + "hasToken", + "hasInstance", + "configured" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33296,7 +52932,20 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "token": { + "type": [ + "string", + "null" + ] + }, + "instanceId": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -33310,7 +52959,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33373,7 +53033,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -33387,7 +53054,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {}, + "description": "Plus what the WhatsApp service answered" + } }, "required": [ "data" @@ -33450,7 +53129,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {}, + "description": "Plus what the WhatsApp service answered" + } }, "required": [ "data" @@ -33505,7 +53196,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's status answer" + } }, "required": [ "data" @@ -33560,7 +53256,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's answer, with the QR code image" + } }, "required": [ "data" @@ -33613,7 +53314,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "phoneNumber": { + "type": "string" + } + }, + "required": [ + "phoneNumber" + ], "additionalProperties": {} } } @@ -33627,7 +53335,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's answer" + } }, "required": [ "data" @@ -33686,6 +53399,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -33704,7 +53418,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's answer" + } }, "required": [ "data" @@ -33763,6 +53482,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -33781,7 +53501,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's answer" + } }, "required": [ "data" @@ -33840,6 +53565,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -33858,7 +53584,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The WhatsApp service's answer" + } }, "required": [ "data" @@ -33918,7 +53649,45 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string", + "description": "info, warning, success, error" + }, + "liveFrom": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "liveTill": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "message", + "type" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -33949,8 +53718,39 @@ "application/json": { "schema": { "type": "object", - "properties": {}, - "additionalProperties": {} + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string", + "description": "info, warning, success, error" + }, + "liveFrom": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "liveTill": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": {}, + "description": "An empty message takes the banner down" } } } @@ -33963,7 +53763,45 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string", + "description": "info, warning, success, error" + }, + "liveFrom": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "liveTill": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "message", + "type" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34024,6 +53862,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -34038,7 +53877,46 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "page": { + "type": "string", + "description": "The list page it belongs to" + }, + "name": { + "type": "string" + }, + "params": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The filters" + }, + "isDefault": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "page", + "name", + "params", + "isDefault", + "updatedAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -34099,7 +53977,30 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "page": { + "type": "string" + }, + "name": { + "type": "string" + }, + "params": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "isDefault": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "page", + "name", + "params" + ], "additionalProperties": {} } } @@ -34113,7 +54014,43 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "page": { + "type": "string", + "description": "The list page it belongs to" + }, + "name": { + "type": "string" + }, + "params": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The filters" + }, + "isDefault": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "page", + "name", + "params", + "isDefault", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34188,7 +54125,25 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "params": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "isDefault": { + "type": [ + "boolean", + "null" + ] + } + }, "additionalProperties": {} } } @@ -34202,7 +54157,43 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "page": { + "type": "string", + "description": "The list page it belongs to" + }, + "name": { + "type": "string" + }, + "params": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The filters" + }, + "isDefault": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "page", + "name", + "params", + "isDefault", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34287,7 +54278,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "const": true + } + }, + "required": [ + "ok" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34362,7 +54365,123 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "startsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "endsAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "sessionLabel": { + "type": [ + "string", + "null" + ] + }, + "places": { + "type": "number" + }, + "checkedIn": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "startsAt", + "endsAt", + "places", + "checkedIn" + ], + "additionalProperties": {} + }, + "description": "Today's events with places and check-ins" + }, + "money": { + "anyOf": [ + { + "type": "object", + "properties": { + "today": { + "type": "number", + "description": "Rand" + }, + "todayCount": { + "type": "number" + }, + "week": { + "type": "number", + "description": "Rand" + } + }, + "required": [ + "today", + "todayCount", + "week" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "pending": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "count": { + "type": "number" + }, + "href": { + "type": "string" + }, + "tone": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "key", + "label", + "count", + "href" + ], + "additionalProperties": {} + }, + "description": "What's waiting for you" + } + }, + "required": [ + "events", + "pending" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34413,6 +54532,7 @@ "name": "q", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -34427,7 +54547,51 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "event, payment, person, registration" + }, + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "subtitle": { + "type": [ + "string", + "null" + ] + }, + "href": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type", + "id", + "title" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "results" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34492,7 +54656,47 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "scanStats": { + "type": "object", + "properties": { + "totalToday": { + "type": "number" + }, + "myToday": { + "type": "number" + }, + "lastHour": { + "type": "number" + }, + "byStaff": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "additionalProperties": {} + }, + "recentScans": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "scanStats", + "recentScans" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34547,7 +54751,57 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "scanStats": { + "type": "object", + "properties": { + "totalToday": { + "type": "number" + }, + "myToday": { + "type": "number" + }, + "lastHour": { + "type": "number" + }, + "byStaff": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "additionalProperties": {} + }, + "recentScans": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "paymentStats": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "activeEventsCount": { + "type": "number" + } + }, + "required": [ + "scanStats", + "recentScans", + "paymentStats", + "activeEventsCount" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34602,7 +54856,57 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "scanStats": { + "type": "object", + "properties": { + "totalToday": { + "type": "number" + }, + "myToday": { + "type": "number" + }, + "lastHour": { + "type": "number" + }, + "byStaff": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "additionalProperties": {} + }, + "recentScans": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "paymentStats": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "activeEventsCount": { + "type": "number" + } + }, + "required": [ + "scanStats", + "recentScans", + "paymentStats", + "activeEventsCount" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34653,6 +54957,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -34662,6 +54967,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -34671,6 +54977,7 @@ "name": "campus", "in": "query", "required": false, + "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 @@ -34685,7 +54992,176 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "funnel": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "activeEvents": { + "type": "number" + }, + "registrations": { + "type": "object", + "properties": { + "thisMonth": { + "type": "number" + }, + "lastMonth": { + "type": "number" + }, + "pctChange": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "thisMonth", + "lastMonth" + ], + "additionalProperties": {} + }, + "ticketsSold": { + "type": "object", + "properties": { + "thisMonth": { + "type": "number" + }, + "lastMonth": { + "type": "number" + }, + "pctChange": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "thisMonth", + "lastMonth" + ], + "additionalProperties": {} + }, + "revenue": { + "type": "object", + "properties": { + "thisMonth": { + "type": "number" + }, + "lastMonth": { + "type": "number" + }, + "pctChange": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "thisMonth", + "lastMonth" + ], + "additionalProperties": {} + }, + "donations": { + "type": "object", + "properties": { + "thisMonth": { + "type": "number" + }, + "lastMonth": { + "type": "number" + }, + "pctChange": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "thisMonth", + "lastMonth" + ], + "additionalProperties": {} + }, + "trend": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "revenue": { + "type": "number", + "description": "Rand" + } + }, + "required": [ + "date", + "revenue" + ], + "additionalProperties": {} + } + }, + "topEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "title": { + "type": "string" + }, + "revenue": { + "type": "number", + "description": "Rand" + }, + "registrations": { + "type": "number" + }, + "ticketsSold": { + "type": "number" + } + }, + "required": [ + "eventId", + "title", + "revenue", + "registrations", + "ticketsSold" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "activeEvents", + "registrations", + "ticketsSold", + "revenue", + "donations", + "trend", + "topEvents" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -34743,7 +55219,36 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "sessionId": { + "type": "string", + "description": "The browser's analytics id" + }, + "eventId": { + "type": "string" + }, + "stage": { + "type": "string", + "enum": [ + "view", + "start", + "submit", + "paid" + ] + }, + "source": { + "description": "Where they came from", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "sessionId", + "eventId", + "stage" + ], "additionalProperties": {} } } @@ -34757,7 +55262,10 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "null", + "description": "Always 204, no content" + } }, "required": [ "data" @@ -34794,10 +55302,21 @@ } ], "parameters": [ + { + "name": "eventIds", + "in": "query", + "required": false, + "description": "These events (comma-separated ids)", + "schema": { + "type": "string", + "maxLength": 4000 + } + }, { "name": "eventId", "in": "query", "required": false, + "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 @@ -34807,6 +55326,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -34816,6 +55336,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -34830,7 +55351,25 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "perEvent": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "The same for each event" + } + }, + "required": [ + "perEvent" + ], + "additionalProperties": {}, + "description": "Counts per stage (view, start, submit, paid), sources and devices, and per ticket" + } }, "required": [ "data" @@ -34893,7 +55432,111 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "subtitle": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "table", + "layered" + ] + }, + "table": { + "description": "kind table", + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + }, + "required": [ + "columns", + "rows" + ], + "additionalProperties": {} + }, + "layered": { + "description": "kind layered: titled sections, each with its rows", + "type": "object", + "properties": { + "header": { + "type": [ + "string", + "null" + ] + }, + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "sections" + ], + "additionalProperties": {} + }, + "orientation": { + "type": "string", + "enum": [ + "portrait", + "landscape" + ] + }, + "stats": { + "description": "Figures shown above the table", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "chart": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "extraTables": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "title", + "kind" + ], "additionalProperties": {} } } @@ -34953,7 +55596,111 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "subtitle": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "table", + "layered" + ] + }, + "table": { + "description": "kind table", + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + }, + "required": [ + "columns", + "rows" + ], + "additionalProperties": {} + }, + "layered": { + "description": "kind layered: titled sections, each with its rows", + "type": "object", + "properties": { + "header": { + "type": [ + "string", + "null" + ] + }, + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "sections" + ], + "additionalProperties": {} + }, + "orientation": { + "type": "string", + "enum": [ + "portrait", + "landscape" + ] + }, + "stats": { + "description": "Figures shown above the table", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "chart": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "extraTables": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "title", + "kind" + ], "additionalProperties": {} } } @@ -35013,7 +55760,124 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "subtitle": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "table", + "layered" + ] + }, + "table": { + "description": "kind table", + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + }, + "required": [ + "columns", + "rows" + ], + "additionalProperties": {} + }, + "layered": { + "description": "kind layered: titled sections, each with its rows", + "type": "object", + "properties": { + "header": { + "type": [ + "string", + "null" + ] + }, + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "sections" + ], + "additionalProperties": {} + }, + "orientation": { + "type": "string", + "enum": [ + "portrait", + "landscape" + ] + }, + "stats": { + "description": "Figures shown above the table", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "chart": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "extraTables": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "subject": { + "type": [ + "string", + "null" + ] + }, + "body": { + "description": "Text of the email", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "title", + "kind" + ], "additionalProperties": {} } } @@ -35027,7 +55891,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35080,7 +55955,117 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "subtitle": { + "type": [ + "string", + "null" + ] + }, + "kind": { + "type": "string", + "enum": [ + "table", + "layered" + ] + }, + "table": { + "description": "kind table", + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + }, + "required": [ + "columns", + "rows" + ], + "additionalProperties": {} + }, + "layered": { + "description": "kind layered: titled sections, each with its rows", + "type": "object", + "properties": { + "header": { + "type": [ + "string", + "null" + ] + }, + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "sections" + ], + "additionalProperties": {} + }, + "orientation": { + "type": "string", + "enum": [ + "portrait", + "landscape" + ] + }, + "stats": { + "description": "Figures shown above the table", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "chart": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "note": { + "type": [ + "string", + "null" + ] + }, + "extraTables": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "caption": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "title", + "kind" + ], "additionalProperties": {} } } @@ -35094,7 +56079,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35149,7 +56145,149 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "news": { + "type": "object", + "properties": { + "email": { + "type": "boolean" + }, + "whatsapp": { + "type": "boolean" + } + }, + "required": [ + "email", + "whatsapp" + ], + "additionalProperties": {} + }, + "newsAskedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "canWhatsApp": { + "type": "boolean" + }, + "notificationPreference": { + "type": [ + "string", + "null" + ] + }, + "history": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Every change to my news consent" + }, + "requests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "access", + "correction", + "deletion" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed", + "rejected", + "cancelled" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "details": { + "type": [ + "string", + "null" + ] + }, + "response": { + "type": [ + "string", + "null" + ] + }, + "dueAt": { + "description": "30 days after it was made", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "closedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "type", + "status", + "createdAt" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "news", + "canWhatsApp", + "history", + "requests" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35192,7 +56330,27 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "email": { + "type": [ + "boolean", + "null" + ] + }, + "whatsapp": { + "type": [ + "boolean", + "null" + ] + }, + "source": { + "description": "Where it was changed, for the consent log", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -35206,7 +56364,42 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "news": { + "type": "object", + "properties": { + "email": { + "type": "boolean" + }, + "whatsapp": { + "type": "boolean" + } + }, + "required": [ + "email", + "whatsapp" + ], + "additionalProperties": {} + }, + "newsAskedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "news" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35257,6 +56450,7 @@ "name": "format", "in": "query", "required": false, + "description": "File type, e.g. `pdf` or `xlsx`", "schema": { "type": "string", "maxLength": 4000 @@ -35317,7 +56511,32 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "type": { + "type": "string", + "enum": [ + "correction", + "deletion" + ] + }, + "details": { + "description": "A correction: what to change", + "type": [ + "string", + "null" + ] + }, + "password": { + "description": "A deletion: closes the account too", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type" + ], "additionalProperties": {} } } @@ -35331,7 +56550,102 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "request": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "access", + "correction", + "deletion" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed", + "rejected", + "cancelled" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "details": { + "type": [ + "string", + "null" + ] + }, + "response": { + "type": [ + "string", + "null" + ] + }, + "dueAt": { + "description": "30 days after it was made", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "closedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "type", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + "message": { + "type": "string" + } + }, + "required": [ + "request", + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35380,6 +56694,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -35398,7 +56713,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "version": { + "type": "number", + "description": "The version accepted" + } + }, + "required": [ + "version" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35444,6 +56771,7 @@ "name": "version", "in": "query", "required": false, + "description": "A version number (default: the current one)", "schema": { "type": "string", "maxLength": 4000 @@ -35458,7 +56786,74 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "version": { + "type": "number", + "description": "0: the built-in text" + }, + "builtIn": { + "type": [ + "boolean", + "null" + ] + }, + "current": { + "type": [ + "boolean", + "null" + ] + }, + "publishedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "effectiveDate": { + "type": [ + "string", + "null" + ] + }, + "changeSummary": { + "type": [ + "string", + "null" + ] + }, + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Rendered sections" + }, + "versions": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Every published version" + } + }, + "required": [ + "version", + "sections", + "versions" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35494,6 +56889,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -35509,7 +56905,58 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "account", + "address" + ] + }, + "email": { + "description": "Partly hidden", + "type": [ + "string", + "null" + ] + }, + "hasPhone": { + "type": [ + "boolean", + "null" + ] + }, + "news": { + "type": "object", + "properties": { + "email": { + "type": "boolean" + }, + "whatsapp": { + "type": "boolean" + } + }, + "required": [ + "email", + "whatsapp" + ], + "additionalProperties": {} + }, + "address": { + "description": "kind address: the email or phone, partly hidden", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "kind" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35553,6 +57000,7 @@ "name": "token", "in": "path", "required": true, + "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, @@ -35566,7 +57014,19 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "channels": { + "description": "Default: the link's channel", + "type": "array", + "items": { + "type": "string", + "enum": [ + "email", + "whatsapp" + ] + } + } + }, "additionalProperties": {} } } @@ -35580,7 +57040,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35631,6 +57102,7 @@ "name": "status", "in": "query", "required": false, + "description": "Only this status", "schema": { "type": "string", "maxLength": 4000 @@ -35640,6 +57112,7 @@ "name": "search", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -35649,6 +57122,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -35658,6 +57132,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -35672,7 +57147,136 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "requests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "access", + "correction", + "deletion" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed", + "rejected", + "cancelled" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "details": { + "type": [ + "string", + "null" + ] + }, + "response": { + "type": [ + "string", + "null" + ] + }, + "dueAt": { + "description": "30 days after it was made", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "closedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "overdue": { + "type": [ + "boolean", + "null" + ] + }, + "blockers": { + "description": "Upcoming registrations that stop a deletion", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "type", + "status", + "createdAt" + ], + "additionalProperties": {} + } + }, + "openCount": { + "type": "number" + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + }, + "pages": { + "type": "number" + } + }, + "required": [ + "requests", + "openCount", + "total", + "page", + "limit", + "pages" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35747,7 +57351,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "response": { + "description": "Emailed to them; needed for a correction", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -35761,7 +57373,111 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "request": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "access", + "correction", + "deletion" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed", + "rejected", + "cancelled" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "details": { + "type": [ + "string", + "null" + ] + }, + "response": { + "type": [ + "string", + "null" + ] + }, + "dueAt": { + "description": "30 days after it was made", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "closedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "type", + "status", + "createdAt" + ], + "additionalProperties": {} + }, + "anonymised": { + "description": "A deletion: what was removed", + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "request" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35846,7 +57562,22 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "response": { + "type": "string", + "description": "The reason, emailed to them" + }, + "cancelled": { + "description": "They withdrew it", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "response" + ], "additionalProperties": {} } } @@ -35860,7 +57591,98 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "request": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "access", + "correction", + "deletion" + ] + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed", + "rejected", + "cancelled" + ] + }, + "userId": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "details": { + "type": [ + "string", + "null" + ] + }, + "response": { + "type": [ + "string", + "null" + ] + }, + "dueAt": { + "description": "30 days after it was made", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "closedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "type", + "status", + "createdAt" + ], + "additionalProperties": {} + } + }, + "required": [ + "request" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35935,7 +57757,106 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string", + "description": "Text; {placeholders} are filled in" + } + }, + "required": [ + "title", + "body" + ], + "additionalProperties": {} + } + }, + "isDraft": { + "type": [ + "boolean", + "null" + ] + }, + "rendered": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "The sections with placeholders filled in" + }, + "placeholders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The placeholders the text can use" + }, + "versions": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Published versions" + }, + "builtIn": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string", + "description": "Text; {placeholders} are filled in" + } + }, + "required": [ + "title", + "body" + ], + "additionalProperties": {} + } + }, + "builtInUpdates": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Changes to the built-in text not reviewed yet" + } + }, + "required": [ + "sections", + "rendered", + "placeholders", + "versions", + "builtIn", + "builtInUpdates" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -35986,7 +57907,34 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string", + "description": "Text; {placeholders} are filled in" + } + }, + "required": [ + "title", + "body" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "sections" + ], "additionalProperties": {} } } @@ -36000,7 +57948,57 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string", + "description": "Text; {placeholders} are filled in" + } + }, + "required": [ + "title", + "body" + ], + "additionalProperties": {} + } + }, + "rendered": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "isDraft": { + "type": "boolean", + "const": true + }, + "savedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "sections", + "rendered", + "isDraft", + "savedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36063,7 +58061,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36116,7 +58125,44 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "sections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string", + "description": "Text; {placeholders} are filled in" + } + }, + "required": [ + "title", + "body" + ], + "additionalProperties": {} + } + }, + "changeSummary": { + "type": "string", + "description": "Shown to people asked to accept it" + }, + "requiresAcceptance": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "changeSummary" + ], "additionalProperties": {} } } @@ -36130,7 +58176,27 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "version": { + "type": "number" + }, + "publishedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "requiresAcceptance": { + "type": "boolean" + } + }, + "required": [ + "version", + "publishedAt", + "requiresAcceptance" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36189,6 +58255,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -36207,7 +58274,23 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "builtInUpdates": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "builtInUpdates" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36272,7 +58355,67 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What they do for the church" + }, + "dataShared": { + "type": [ + "string", + "null" + ] + }, + "location": { + "description": "Country the data is kept in", + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + }, + "active": { + "type": "boolean" + }, + "order": { + "type": "number" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "name", + "purpose", + "active", + "order", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -36323,7 +58466,50 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What they do for the church" + }, + "dataShared": { + "type": [ + "string", + "null" + ] + }, + "location": { + "description": "Country the data is kept in", + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + }, + "active": { + "type": [ + "boolean", + "null" + ] + }, + "order": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "name", + "purpose" + ], "additionalProperties": {} } } @@ -36337,7 +58523,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What they do for the church" + }, + "dataShared": { + "type": [ + "string", + "null" + ] + }, + "location": { + "description": "Country the data is kept in", + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + }, + "active": { + "type": "boolean" + }, + "order": { + "type": "number" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "name", + "purpose", + "active", + "order", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36412,7 +58655,46 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What they do for the church" + }, + "dataShared": { + "type": [ + "string", + "null" + ] + }, + "location": { + "description": "Country the data is kept in", + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + }, + "active": { + "type": [ + "boolean", + "null" + ] + }, + "order": { + "type": [ + "number", + "null" + ] + } + }, "additionalProperties": {} } } @@ -36426,7 +58708,64 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "purpose": { + "type": "string", + "description": "What they do for the church" + }, + "dataShared": { + "type": [ + "string", + "null" + ] + }, + "location": { + "description": "Country the data is kept in", + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + }, + "active": { + "type": "boolean" + }, + "order": { + "type": "number" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "name", + "purpose", + "active", + "order", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36511,7 +58850,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36582,6 +58932,7 @@ "name": "type", "in": "query", "required": false, + "description": "Which kind", "schema": { "type": "string", "maxLength": 4000 @@ -36591,6 +58942,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -36600,6 +58952,7 @@ "name": "q", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -36614,7 +58967,56 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "pageSize": { + "type": "number" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "at": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "total", + "pageSize", + "rows" + ], + "additionalProperties": {}, + "description": "`type` news: email, channel, granted, source, ip; notice: email, version, source, ip; parental: child, event, status, signedName" + } }, "required": [ "data" @@ -36675,6 +59077,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -36684,6 +59087,7 @@ "name": "action", "in": "query", "required": false, + "description": "Only this action", "schema": { "type": "string", "maxLength": 4000 @@ -36693,6 +59097,7 @@ "name": "sensitive", "in": "query", "required": false, + "description": "`true`: only access to sensitive information", "schema": { "type": "string", "maxLength": 4000 @@ -36702,6 +59107,7 @@ "name": "actorId", "in": "query", "required": false, + "description": "Only things this person did", "schema": { "type": "string", "maxLength": 4000 @@ -36711,6 +59117,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -36720,6 +59127,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -36734,7 +59142,112 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "pageSize": { + "type": "number" + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "at": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "actor": { + "type": "string" + }, + "actorRole": { + "type": [ + "string", + "null" + ] + }, + "action": { + "type": "string" + }, + "what": { + "type": [ + "string", + "null" + ] + }, + "records": { + "type": [ + "number", + "null" + ] + }, + "eventId": { + "type": [ + "string", + "null" + ] + }, + "ip": { + "type": [ + "string", + "null" + ] + }, + "sensitive": { + "type": "boolean" + } + }, + "required": [ + "id", + "at", + "actor", + "action", + "sensitive" + ], + "additionalProperties": {} + } + }, + "actions": { + "type": "array", + "items": { + "type": "string" + } + }, + "actors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "total", + "pageSize", + "rows", + "actions", + "actors" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36799,7 +59312,67 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "score": { + "type": "number", + "description": "%" + }, + "passed": { + "type": "number" + }, + "total": { + "type": "number" + }, + "checks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "label": { + "type": "string" + }, + "ok": { + "type": "boolean" + }, + "detail": { + "type": [ + "string", + "null" + ] + }, + "href": { + "type": [ + "string", + "null" + ] + }, + "applies": { + "type": "boolean" + } + }, + "required": [ + "key", + "label", + "ok", + "applies" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "score", + "passed", + "total", + "checks" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36854,7 +59427,67 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "policies": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "Per kind of information: how long it is kept" + }, + "definitions": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "preview": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What the rules would remove now" + }, + "lastRun": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "related": { + "type": "object", + "properties": { + "medicalDays": { + "type": "number" + }, + "backupCount": { + "type": "number" + }, + "analyticsDays": { + "type": "number" + } + }, + "required": [ + "medicalDays", + "backupCount", + "analyticsDays" + ], + "additionalProperties": {} + } + }, + "required": [ + "policies", + "definitions", + "preview", + "related" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36905,7 +59538,17 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "policies": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "Per kind of information: { enabled, months }" + } + }, + "required": [ + "policies" + ], "additionalProperties": {} } } @@ -36919,7 +59562,67 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "policies": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "Per kind of information: how long it is kept" + }, + "definitions": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "preview": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What the rules would remove now" + }, + "lastRun": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "related": { + "type": "object", + "properties": { + "medicalDays": { + "type": "number" + }, + "backupCount": { + "type": "number" + }, + "analyticsDays": { + "type": "number" + } + }, + "required": [ + "medicalDays", + "backupCount", + "analyticsDays" + ], + "additionalProperties": {} + } + }, + "required": [ + "policies", + "definitions", + "preview", + "related" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -36978,6 +59681,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -36996,7 +59700,83 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "result": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What was removed or anonymised" + }, + "state": { + "type": "object", + "properties": { + "policies": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "Per kind of information: how long it is kept" + }, + "definitions": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "preview": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "What the rules would remove now" + }, + "lastRun": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "related": { + "type": "object", + "properties": { + "medicalDays": { + "type": "number" + }, + "backupCount": { + "type": "number" + }, + "analyticsDays": { + "type": "number" + } + }, + "required": [ + "medicalDays", + "backupCount", + "analyticsDays" + ], + "additionalProperties": {} + } + }, + "required": [ + "policies", + "definitions", + "preview", + "related" + ], + "additionalProperties": {} + } + }, + "required": [ + "result", + "state" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37061,7 +59841,142 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dataAffected": { + "type": "string" + }, + "peopleAffected": { + "type": [ + "number", + "string", + "null" + ] + }, + "whoAffected": { + "type": [ + "string", + "null" + ] + }, + "consequences": { + "type": [ + "string", + "null" + ] + }, + "actionsTaken": { + "type": [ + "string", + "null" + ] + }, + "adviceToPeople": { + "type": [ + "string", + "null" + ] + }, + "causedBy": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "discoveredAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "occurredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "regulatorNotifiedAt": { + "description": "When the Information Regulator was told", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "peopleNotifiedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "createdBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "title", + "description", + "dataAffected", + "status", + "discoveredAt", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -37112,7 +60027,105 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dataAffected": { + "type": "string" + }, + "peopleAffected": { + "type": [ + "number", + "string", + "null" + ] + }, + "whoAffected": { + "type": [ + "string", + "null" + ] + }, + "consequences": { + "type": [ + "string", + "null" + ] + }, + "actionsTaken": { + "type": [ + "string", + "null" + ] + }, + "adviceToPeople": { + "type": [ + "string", + "null" + ] + }, + "causedBy": { + "type": [ + "string", + "null" + ] + }, + "status": { + "description": "open or closed", + "type": [ + "string", + "null" + ] + }, + "discoveredAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "occurredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "regulatorNotifiedAt": { + "description": "When the Information Regulator was told", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "peopleNotifiedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "title", + "description", + "dataAffected", + "discoveredAt" + ], "additionalProperties": {} } } @@ -37126,7 +60139,139 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dataAffected": { + "type": "string" + }, + "peopleAffected": { + "type": [ + "number", + "string", + "null" + ] + }, + "whoAffected": { + "type": [ + "string", + "null" + ] + }, + "consequences": { + "type": [ + "string", + "null" + ] + }, + "actionsTaken": { + "type": [ + "string", + "null" + ] + }, + "adviceToPeople": { + "type": [ + "string", + "null" + ] + }, + "causedBy": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "discoveredAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "occurredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "regulatorNotifiedAt": { + "description": "When the Information Regulator was told", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "peopleNotifiedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "createdBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "title", + "description", + "dataAffected", + "status", + "discoveredAt", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37201,7 +60346,99 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dataAffected": { + "type": "string" + }, + "peopleAffected": { + "type": [ + "number", + "string", + "null" + ] + }, + "whoAffected": { + "type": [ + "string", + "null" + ] + }, + "consequences": { + "type": [ + "string", + "null" + ] + }, + "actionsTaken": { + "type": [ + "string", + "null" + ] + }, + "adviceToPeople": { + "type": [ + "string", + "null" + ] + }, + "causedBy": { + "type": [ + "string", + "null" + ] + }, + "status": { + "description": "open or closed", + "type": [ + "string", + "null" + ] + }, + "discoveredAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "occurredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "regulatorNotifiedAt": { + "description": "When the Information Regulator was told", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "peopleNotifiedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, "additionalProperties": {} } } @@ -37215,7 +60452,139 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dataAffected": { + "type": "string" + }, + "peopleAffected": { + "type": [ + "number", + "string", + "null" + ] + }, + "whoAffected": { + "type": [ + "string", + "null" + ] + }, + "consequences": { + "type": [ + "string", + "null" + ] + }, + "actionsTaken": { + "type": [ + "string", + "null" + ] + }, + "adviceToPeople": { + "type": [ + "string", + "null" + ] + }, + "causedBy": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "discoveredAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "occurredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "regulatorNotifiedAt": { + "description": "When the Information Regulator was told", + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "peopleNotifiedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "updatedAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "createdBy": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "title", + "description", + "dataAffected", + "status", + "discoveredAt", + "id", + "createdAt", + "updatedAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37286,6 +60655,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -37295,6 +60665,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -37304,6 +60675,7 @@ "name": "actorId", "in": "query", "required": false, + "description": "Only things this person did", "schema": { "type": "string", "maxLength": 4000 @@ -37313,6 +60685,7 @@ "name": "action", "in": "query", "required": false, + "description": "Only this action", "schema": { "type": "string", "maxLength": 4000 @@ -37322,6 +60695,7 @@ "name": "role", "in": "query", "required": false, + "description": "admin, supervisor, staff or user", "schema": { "type": "string", "maxLength": 4000 @@ -37331,6 +60705,7 @@ "name": "from", "in": "query", "required": false, + "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -37340,6 +60715,7 @@ "name": "to", "in": "query", "required": false, + "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 @@ -37349,6 +60725,7 @@ "name": "search", "in": "query", "required": false, + "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 @@ -37363,7 +60740,115 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "action": { + "type": "string" + }, + "actorRole": { + "type": [ + "string", + "null" + ] + }, + "targetType": { + "type": [ + "string", + "null" + ] + }, + "targetId": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "ip": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "actor": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "action", + "createdAt" + ], + "additionalProperties": {} + } + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "limit": { + "type": "number" + } + }, + "required": [ + "rows", + "total", + "page", + "limit" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37428,7 +60913,80 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "description": "on, off or timers" + }, + "timezone": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "cron": { + "type": [ + "string", + "null" + ] + }, + "enabled": { + "type": "boolean" + }, + "envFlag": { + "type": [ + "string", + "null" + ] + }, + "nextRun": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "recent": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Recent runs" + } + }, + "required": [ + "name", + "label", + "enabled", + "recent" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "mode", + "timezone", + "jobs" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37479,6 +61037,7 @@ "name": "name", "in": "path", "required": true, + "description": "The name", "schema": { "type": "string", "minLength": 1, @@ -37488,6 +61047,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -37506,7 +61066,27 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "queued": { + "type": "boolean" + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "output": { + "description": "When it ran straight away" + } + }, + "required": [ + "queued" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37577,6 +61157,7 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 @@ -37591,7 +61172,140 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "startedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "expiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "admin": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "target": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "requests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "path": { + "type": "string" + }, + "blocked": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "method", + "path", + "blocked", + "createdAt" + ], + "additionalProperties": {} + }, + "description": "What they did (up to 500)" + } + }, + "required": [ + "id", + "requests" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -37652,6 +61366,7 @@ "name": "userId", "in": "path", "required": true, + "description": "The person's id", "schema": { "type": "string", "minLength": 1, @@ -37665,7 +61380,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "reason": { + "type": "string", + "description": "Why — kept in the log" + } + }, + "required": [ + "reason" + ], "additionalProperties": {} } } @@ -37679,7 +61402,62 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "A read-only sign-in token" + }, + "session": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "target": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "email", + "role" + ], + "additionalProperties": {} + } + }, + "required": [ + "id", + "expiresAt", + "target" + ], + "additionalProperties": {} + } + }, + "required": [ + "token", + "session" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37754,7 +61532,52 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "target": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": {} + } + }, + "required": [ + "id", + "expiresAt", + "target" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + } }, "required": [ "data" @@ -37793,6 +61616,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -37811,7 +61635,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -37864,7 +61699,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ], "additionalProperties": {} } } @@ -37878,7 +61720,10 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "null", + "description": "Always 204, no content" + } }, "required": [ "data" @@ -37928,7 +61773,16 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + }, + "description": "Setting key → value: name, logo, colours, contact details, what's switched on" + } }, "required": [ "data" @@ -37955,12 +61809,16 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", - "properties": {}, - "additionalProperties": {} + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Setting key → new value" } } } @@ -37973,7 +61831,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38038,7 +61907,14 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Setting key → value; secrets masked" + } }, "required": [ "data" @@ -38091,8 +61967,46 @@ "application/json": { "schema": { "type": "object", - "properties": {}, - "additionalProperties": {} + "properties": { + "host": { + "type": [ + "string", + "null" + ] + }, + "port": { + "type": [ + "number", + "string" + ] + }, + "secure": { + "type": [ + "boolean", + "string" + ] + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "pass": { + "type": [ + "string", + "null" + ] + }, + "from": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Unsaved SMTP details to try (default: the saved ones)" } } } @@ -38105,7 +62019,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38165,7 +62090,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "needsSetup": { + "type": "boolean" + } + }, + "required": [ + "needsSetup" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38193,7 +62129,23 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "adminName": { + "type": "string" + }, + "adminEmail": { + "type": "string" + }, + "adminPassword": { + "type": "string", + "description": "At least 8 characters" + } + }, + "required": [ + "adminName", + "adminEmail", + "adminPassword" + ], "additionalProperties": {} } } @@ -38207,7 +62159,26 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "token", + "name", + "email" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38250,7 +62221,19 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "settings": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Setting key → value" + } + }, + "required": [ + "settings" + ], "additionalProperties": {} } } @@ -38264,7 +62247,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38329,7 +62323,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38382,7 +62583,14 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "licenceKey": { + "type": "string" + } + }, + "required": [ + "licenceKey" + ], "additionalProperties": {} } } @@ -38396,7 +62604,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38455,6 +62870,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -38473,7 +62889,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38532,6 +63155,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -38550,7 +63174,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38609,6 +63440,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -38627,7 +63459,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38690,7 +63729,15 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "snooze": { + "description": "false: stop putting it off", + "type": [ + "boolean", + "null" + ] + } + }, "additionalProperties": {} } } @@ -38704,7 +63751,214 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "state": { + "type": "string", + "description": "active, grace, suspended, revoked, none…" + }, + "readOnly": { + "type": "boolean" + }, + "daysLeft": { + "type": [ + "number", + "null" + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceEndsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "licence": { + "anyOf": [ + { + "type": "object", + "properties": { + "customer": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "licenceExpiresAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "graceDays": { + "type": [ + "number", + "null" + ] + }, + "issuedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "validUntil": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "limits": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "required": [ + "limits" + ], + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "connected": { + "type": "boolean" + }, + "keyConfigured": { + "type": "boolean" + }, + "hubUrl": { + "type": [ + "string", + "null" + ] + }, + "lastHeartbeatAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string", + "description": "This site's version" + }, + "latestVersion": { + "type": [ + "string", + "null" + ] + }, + "updateAvailable": { + "type": "boolean" + }, + "urgentUpdate": { + "type": "boolean" + }, + "updateSnoozed": { + "type": [ + "boolean", + "null" + ] + }, + "releases": { + "description": "What's new in each version since this one", + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + }, + "updateRequest": { + "anyOf": [ + { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + { + "type": "null" + } + ] + }, + "notices": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + } + } + }, + "required": [ + "state", + "readOnly", + "connected", + "keyConfigured", + "version", + "updateAvailable", + "urgentUpdate" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38769,7 +64023,67 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "level": { + "type": "string", + "description": "info, warning, critical" + }, + "title": { + "type": "string" + }, + "message": { + "type": "string" + }, + "startsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "endsAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "updatedAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "level", + "title", + "message" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -38824,7 +64138,110 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "eventTypes": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": {} + }, + "description": "Every event type, with an example body" + }, + "keepDays": { + "type": "number", + "description": "How long deliveries are kept" + }, + "endpoints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Event types it gets" + }, + "isActive": { + "type": "boolean" + }, + "operatorId": { + "description": "Its entry in the operator register", + "type": [ + "string", + "null" + ] + }, + "lastSuccessAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastFailureAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "lastWeek": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "number" + }, + "description": "Status → deliveries in the last 7 days" + } + }, + "required": [ + "id", + "name", + "url", + "events", + "isActive", + "createdAt", + "lastWeek" + ], + "additionalProperties": {} + } + } + }, + "required": [ + "eventTypes", + "keepDays", + "endpoints" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38875,7 +64292,26 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "description": "https:// address" + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "url", + "events" + ], "additionalProperties": {} } } @@ -38889,7 +64325,77 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Event types it gets" + }, + "isActive": { + "type": "boolean" + }, + "operatorId": { + "description": "Its entry in the operator register", + "type": [ + "string", + "null" + ] + }, + "lastSuccessAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastFailureAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "secret": { + "type": "string", + "description": "For checking signatures — shown only now" + } + }, + "required": [ + "id", + "name", + "url", + "events", + "isActive", + "createdAt", + "secret" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -38960,6 +64466,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -38978,7 +64485,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "status": { + "description": "succeeded, failed, retrying…", + "type": [ + "string", + "null" + ] + }, + "statusCode": { + "type": [ + "number", + "null" + ] + }, + "error": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {} + } }, "required": [ "data" @@ -39063,7 +64594,32 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + }, + "isActive": { + "type": [ + "boolean", + "null" + ] + } + }, "additionalProperties": {} } } @@ -39077,7 +64633,72 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Event types it gets" + }, + "isActive": { + "type": "boolean" + }, + "operatorId": { + "description": "Its entry in the operator register", + "type": [ + "string", + "null" + ] + }, + "lastSuccessAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastFailureAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "id", + "name", + "url", + "events", + "isActive", + "createdAt" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39162,7 +64783,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "const": true + } + }, + "required": [ + "ok" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39243,6 +64876,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -39261,7 +64895,19 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Shown only now; the old one stops working" + } + }, + "required": [ + "secret" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39342,6 +64988,7 @@ ], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -39360,7 +65007,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "status": { + "description": "succeeded, failed, retrying…", + "type": [ + "string", + "null" + ] + }, + "statusCode": { + "type": [ + "number", + "null" + ] + }, + "error": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": {} + } }, "required": [ "data" @@ -39442,6 +65113,7 @@ "name": "page", "in": "query", "required": false, + "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 @@ -39451,6 +65123,27 @@ "name": "limit", "in": "query", "required": false, + "description": "How many per page", + "schema": { + "type": "string", + "maxLength": 4000 + } + }, + { + "name": "status", + "in": "query", + "required": false, + "description": "Only this status", + "schema": { + "type": "string", + "maxLength": 4000 + } + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "Older than (ISO date-time), for the next page", "schema": { "type": "string", "maxLength": 4000 @@ -39465,7 +65158,80 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "eventId": { + "type": "string" + }, + "type": { + "type": "string", + "description": "The event type" + }, + "payload": {}, + "status": { + "type": "string", + "description": "pending, sending, retrying, succeeded, failed" + }, + "attempts": { + "type": "number" + }, + "nextAttemptAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + }, + "lastStatusCode": { + "type": [ + "number", + "null" + ] + }, + "lastError": { + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + "deliveredAt": { + "anyOf": [ + { + "type": "string", + "description": "Date and time (ISO 8601)" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "eventId", + "type", + "payload", + "status", + "attempts", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -39540,7 +65306,31 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "number", + "description": "Bytes" + }, + "createdAt": { + "type": "string", + "description": "Date and time (ISO 8601)" + } + }, + "required": [ + "filename", + "size", + "createdAt" + ], + "additionalProperties": {} + } + } }, "required": [ "data" @@ -39589,6 +65379,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -39607,7 +65398,12 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": {}, + "additionalProperties": {}, + "description": "The backup made" + } }, "required": [ "data" @@ -39668,6 +65464,7 @@ "name": "filename", "in": "path", "required": true, + "description": "The file name", "schema": { "type": "string", "minLength": 1, @@ -39751,7 +65548,54 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "secretKeyMasked": { + "type": "string" + }, + "secretKeySource": { + "description": "settings or env", + "type": [ + "string", + "null" + ] + }, + "mode": { + "description": "test or live", + "type": [ + "string", + "null" + ] + }, + "webhookSecretMasked": { + "type": "string" + }, + "webhookSecretSource": { + "type": [ + "string", + "null" + ] + }, + "webhookId": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "configured": { + "type": "boolean" + } + }, + "required": [ + "secretKeyMasked", + "webhookSecretMasked", + "webhookId", + "webhookUrl", + "configured" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39802,7 +65646,22 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "secretKey": { + "description": "sk_test_… or sk_live_…", + "type": [ + "string", + "null" + ] + }, + "webhookSecret": { + "description": "whsec_…", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -39816,7 +65675,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39881,7 +65751,58 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "webhooks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string" + }, + "mode": { + "type": [ + "string", + "null" + ] + }, + "isActive": { + "type": "boolean" + }, + "pointsHere": { + "type": "boolean" + } + }, + "required": [ + "id", + "url", + "isActive", + "pointsHere" + ], + "additionalProperties": {} + } + }, + "defaultUrl": { + "type": "string" + } + }, + "required": [ + "webhooks", + "defaultUrl" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -39932,7 +65853,21 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "url": { + "description": "Default: this site's webhook address", + "type": [ + "string", + "null" + ] + } + }, "additionalProperties": {} } } @@ -39946,7 +65881,51 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "webhook": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string" + }, + "mode": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "url" + ], + "additionalProperties": {} + }, + "webhookSecretMasked": { + "type": "string" + } + }, + "required": [ + "message", + "webhook", + "webhookSecretMasked" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -40007,6 +65986,7 @@ "name": "id", "in": "path", "required": true, + "description": "The id", "schema": { "type": "string", "minLength": 1, @@ -40022,7 +66002,22 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "clearedSecret": { + "type": "boolean" + } + }, + "required": [ + "message", + "clearedSecret" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -40097,7 +66092,53 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "merchantId": { + "type": "string" + }, + "merchantKey": { + "type": "string" + }, + "passphraseMasked": { + "type": "string" + }, + "hasPassphrase": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": [ + "sandbox", + "live" + ] + }, + "notifyUrl": { + "type": "string" + }, + "notifyUrlProblem": { + "description": "Why PayFast couldn't reach it", + "type": [ + "string", + "null" + ] + }, + "configured": { + "type": "boolean" + } + }, + "required": [ + "merchantId", + "merchantKey", + "passphraseMasked", + "hasPassphrase", + "mode", + "notifyUrl", + "configured" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -40148,7 +66189,34 @@ "application/json": { "schema": { "type": "object", - "properties": {}, + "properties": { + "merchantId": { + "type": [ + "string", + "null" + ] + }, + "merchantKey": { + "type": [ + "string", + "null" + ] + }, + "passphrase": { + "description": "At most 32 characters", + "type": [ + "string", + "null" + ] + }, + "mode": { + "type": "string", + "enum": [ + "sandbox", + "live" + ] + } + }, "additionalProperties": {} } } @@ -40162,7 +66230,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" @@ -40221,6 +66300,7 @@ "parameters": [], "requestBody": { "required": true, + "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { @@ -40239,7 +66319,18 @@ "schema": { "type": "object", "properties": { - "data": {} + "data": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": {} + } }, "required": [ "data" diff --git a/apps/events/frontend/src/lib/api-v2/schema.d.ts b/apps/events/frontend/src/lib/api-v2/schema.d.ts index 83f3064..d5c96ae 100644 --- a/apps/events/frontend/src/lib/api-v2/schema.d.ts +++ b/apps/events/frontend/src/lib/api-v2/schema.d.ts @@ -7684,6 +7684,13 @@ export interface operations { content: { "application/json": { data: { + /** @description Allocation sets copied */ + sets: number; + /** @description Groups copied */ + groups: number; + /** @description Costs copied (admins) */ + costs: number; + } & { [key: string]: unknown; }; }; @@ -8740,7 +8747,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The attachment's id */ attachmentId: string; }; cookie?: never; @@ -8911,6 +8920,7 @@ export interface operations { getSections: { parameters: { query?: { + /** @description Only this event */ eventId?: string; }; header?: never; @@ -9942,6 +9952,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The short name in the address */ slug: string; }; cookie?: never; @@ -10025,6 +10036,44 @@ export interface operations { content: { "application/json": { data: { + series: { + [key: string]: unknown; + }; + events: ({ + eventId: string; + title: string; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + campus?: { + [key: string]: unknown; + } | null; + isActive: boolean; + sessions?: number | null; + registrations: number; + tickets: number; + /** @description Rand */ + income: number; + checkedIn: number; + /** @description % */ + attendanceRate?: number | null; + change: ({ + /** @description % change from the year before */ + registrations?: number | null; + /** @description % change from the year before */ + tickets?: number | null; + /** @description % change from the year before */ + income?: number | null; + /** @description % change from the year before */ + checkedIn?: number | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -10179,6 +10228,7 @@ export interface operations { "getSeason-passes": { parameters: { query?: { + /** @description Only this event series */ seriesId?: string; }; header?: never; @@ -10507,6 +10557,16 @@ export interface operations { content: { "application/json": { data: { + purchaseId: string; + /** @description Rand */ + total: number; + /** @description Free: the tickets are issued straight away */ + paid: boolean; + /** @description Where to send them to pay */ + redirectUrl?: string | null; + provider?: string | null; + message?: string | null; + } & { [key: string]: unknown; }; }; @@ -10567,6 +10627,10 @@ export interface operations { content: { "application/json": { data: { + redirectUrl?: string | null; + provider?: string | null; + message?: string | null; + } & { [key: string]: unknown; }; }; @@ -11184,7 +11248,9 @@ export interface operations { query?: { /** @description Comma-separated */ eventIds?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; }; header?: never; @@ -11653,6 +11719,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The short name in the address */ slug: string; }; cookie?: never; @@ -11965,6 +12032,7 @@ export interface operations { getCampusesIdAudience: { parameters: { query?: { + /** @description `true`: also people registered for its events in the last 12 months */ registrants?: "true" | "false"; }; header?: never; @@ -12039,10 +12107,13 @@ export interface operations { getRegistrations: { parameters: { query?: { + /** @description Page number, from 1 */ page?: number; /** @description At most 200 */ limit?: number; + /** @description `true`: only ones with money still owed */ unpaid?: "true" | "false"; + /** @description Only this person */ userId?: string; }; header?: never; @@ -12698,6 +12769,7 @@ export interface operations { getMeRegistrationsFull: { parameters: { query?: { + /** @description `true`: include ones that are over too */ past?: "true" | "false"; }; header?: never; @@ -13100,7 +13172,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The named attendee's id */ attendeeId: string; }; cookie?: never; @@ -13395,6 +13469,7 @@ export interface operations { getEventsIdRegistrations: { parameters: { query?: { + /** @description Text to search for */ search?: string; }; header?: never; @@ -13651,6 +13726,27 @@ export interface operations { /** @enum {string} */ action: "markPaid" | "cancel" | "moveOption" | "allocate" | "message"; registrationIds: string[]; + /** @description markPaid: cash, eft, card or other */ + method?: string | null; + /** @description markPaid */ + paidAt?: string | null; + /** @description moveOption */ + fromOptionId?: string | null; + /** @description moveOption */ + toOptionId?: string | null; + /** @description allocate */ + setId?: string | null; + /** @description allocate */ + groupId?: string | null; + /** + * @description message + * @enum {string} + */ + channel?: "email" | "whatsapp"; + /** @description message (email) */ + subject?: string | null; + /** @description message */ + text?: string | null; } & { [key: string]: unknown; }; @@ -13665,6 +13761,19 @@ export interface operations { content: { "application/json": { data: { + action: string; + done: number; + skipped: number; + failed: number; + results: ({ + id: string; + ok: boolean; + skipped?: boolean | null; + message?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -13715,7 +13824,19 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + providers: ({ + /** @description yoco, payfast */ + id: string; + label: string; + } & { + [key: string]: unknown; + })[]; + /** @description Smallest online payment */ + minimumAmount: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13737,7 +13858,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + providers: ({ + id: string; + label: string; + enabled: boolean; + /** @description Its keys are set up */ + configured: boolean; + /** @description What the provider can do, e.g. look payments up */ + capabilities: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + })[]; + /** @description Rand */ + minimumAmount: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13771,6 +13910,14 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Every provider, in the order to offer them */ + providers: ({ + id: string; + enabled: boolean; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -13783,7 +13930,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + providers: ({ + id: string; + label: string; + enabled: boolean; + /** @description Its keys are set up */ + configured: boolean; + /** @description What the provider can do, e.g. look payments up */ + capabilities: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13832,7 +13996,30 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkouts: ({ + id: string; + provider: string; + providerLabel: string; + /** @description The provider can be asked whether it was paid */ + canCheck: boolean; + /** @description Rand */ + amount: number; + description: string; + /** @description registration, donation, sponsorship, season_pass… */ + type?: string | null; + registrationId?: string | null; + payer?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + /** @description How far back it looks */ + days: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13866,6 +14053,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Checkouts to ask about (default: every open one), at most 200 */ + ids?: string[]; + } & { [key: string]: unknown; }; }; @@ -13878,7 +14068,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + results: { + [key: string]: unknown; + }[]; + /** @description Payments found and recorded */ + recorded: number; + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13914,14 +14113,23 @@ export interface operations { getPaymentsStats: { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Only this person */ userId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description `1`: only donations and the parts put towards registrations */ donations?: string; + /** @description Payment method: cash, card, eft, other */ method?: string; + /** @description payment or refund */ kind?: string; + /** @description On or after (ISO date) */ startDate?: string; + /** @description On or before (ISO date) */ endDate?: string; }; header?: never; @@ -13937,7 +14145,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Rand */ + totalToday: number; + /** @description Rand */ + totalWeek: number; + /** @description Rand */ + totalMonth: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -13973,14 +14190,23 @@ export interface operations { getPayments: { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Only this person */ userId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description `1`: only donations and the parts put towards registrations */ donations?: string; + /** @description Payment method: cash, card, eft, other */ method?: string; + /** @description payment or refund */ kind?: string; + /** @description On or after (ISO date) */ startDate?: string; + /** @description On or before (ISO date) */ endDate?: string; }; header?: never; @@ -13996,7 +14222,89 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + data: ({ + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + total: number; + page: number; + limit: number; + pages: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14040,9 +14348,16 @@ export interface operations { content: { "application/json": { registrationId?: string | null; + /** @description A donation: the event */ eventId?: string | null; amount: number | string; - method?: string; + /** @description cash, card, eft or other */ + method: string; + isDonation?: boolean | null; + /** @description Backdate it */ + paidAt?: string | null; + /** @description A donation: who gave it */ + userId?: string | null; } & { [key: string]: unknown; }; @@ -14056,7 +14371,149 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + /** @description Tickets issued because this paid it in full */ + generatedTickets?: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + /** @description Attendee forms still holding the tickets back (1.52.0) */ + formsNeeded?: number | null; + /** @description What was paid over the balance, kept as a donation */ + donationSplit?: { + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14099,8 +14556,14 @@ export interface operations { requestBody: { content: { "application/json": { - paymentId?: string; - registrationId?: string; + /** @description The payment refunded (or registrationId) */ + paymentId?: string | null; + registrationId?: string | null; + userId: string; + /** @description Positive; stored as a negative payment */ + amount: number | string; + method: string; + reason?: string | null; } & { [key: string]: unknown; }; @@ -14114,7 +14577,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14157,8 +14664,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description The donation */ paymentId: string; registrationId: string; + /** @description Default: as much as both allow */ + amount?: number | string; } & { [key: string]: unknown; }; @@ -14172,7 +14682,60 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message?: string | null; + updatedRegistration?: { + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; + generatedTickets?: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14229,7 +14792,42 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + updatedRegistration: { + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; + donationId: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14274,6 +14872,10 @@ export interface operations { "application/json": { eventId: string; amount: number | string; + provider?: string | null; + successUrl?: string | null; + cancelUrl?: string | null; + failureUrl?: string | null; } & { [key: string]: unknown; }; @@ -14287,7 +14889,33 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkoutId?: string | null; + /** @description Where to send the person to pay (null when the provider takes a form) */ + redirectUrl?: string | null; + provider?: string | null; + /** @description A form to post (PayFast) */ + form?: ({ + action: string; + fields: { + [key: string]: string; + }; + } & { + [key: string]: unknown; + }) | null; + /** @description Rand */ + amount: number; + event: { + id?: string; + title?: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14314,14 +14942,23 @@ export interface operations { getMePayments: { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Only this person */ userId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description `1`: only donations and the parts put towards registrations */ donations?: string; + /** @description Payment method: cash, card, eft, other */ method?: string; + /** @description payment or refund */ kind?: string; + /** @description On or after (ISO date) */ startDate?: string; + /** @description On or before (ISO date) */ endDate?: string; }; header?: never; @@ -14337,7 +14974,89 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + data: ({ + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + total: number; + page: number; + limit: number; + pages: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14380,7 +15099,81 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id: string; + userId: string; + eventId: string; + /** @enum {string} */ + status: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14440,7 +15233,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14492,9 +15289,51 @@ export interface operations { }; content: { "application/json": { - data: { + data: ({ + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { [key: string]: unknown; - }[]; + })[]; }; }; }; @@ -14541,6 +15380,11 @@ export interface operations { content: { "application/json": { amount?: number | string; + donationAmount?: number | string; + provider?: string | null; + successUrl?: string | null; + cancelUrl?: string | null; + failureUrl?: string | null; } & { [key: string]: unknown; }; @@ -14554,7 +15398,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkoutId?: string | null; + /** @description Where to send the person to pay (null when the provider takes a form) */ + redirectUrl?: string | null; + provider?: string | null; + /** @description A form to post (PayFast) */ + form?: ({ + action: string; + fields: { + [key: string]: string; + }; + } & { + [key: string]: unknown; + }) | null; + priceUpdated?: boolean | null; + newTotal?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14609,6 +15471,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description The link to send */ + redirectUrl: string; + /** @enum {string} */ + channel: "email" | "whatsapp"; + } & { [key: string]: unknown; }; }; @@ -14621,7 +15488,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + sent: true; + channel: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14682,7 +15555,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -14743,7 +15660,31 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @enum {string} */ + status: "open" | "paid"; + /** @description Rand */ + amount: number; + description: string; + /** @description The provider already chosen, if any */ + provider?: string | null; + providers: ({ + /** @description yoco, payfast */ + id: string; + label: string; + } & { + [key: string]: unknown; + })[]; + cancelUrl?: string | null; + redirectUrl?: string | null; + /** @description A signed form to post (PayFast) */ + form?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14794,7 +15735,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + provider: string; + redirectUrl?: string | null; + form?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14821,8 +15770,11 @@ export interface operations { getCashupsAudit: { parameters: { query?: { + /** @description Only this event */ eventId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; }; header?: never; @@ -14838,7 +15790,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + eventId: string; + /** @description close, quick_close, reopen */ + action?: string | null; + notes?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + performedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -14890,7 +15859,41 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + /** @description Income per method */ + paymentsByMethod: { + [key: string]: unknown; + }; + /** @description Rand */ + totalRevenue: number; + costs: { + [key: string]: unknown; + }[]; + /** @description Rand */ + totalCosts: number; + expectedCashByMethod: { + [key: string]: unknown; + }; + /** @description The last close, line by line */ + reconciled?: { + [key: string]: unknown; + } | null; + /** @description Rand */ + netProfit: number; + /** @description Rand */ + totalDonations: number; + /** @description Rand */ + unallocatedDonationsTotal: number; + discountsTotal?: number | null; + salesByOption?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14951,7 +15954,18 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Per person: who, cash recorded, cash counted */ + rows: { + [key: string]: unknown; + }[]; + cashActualTotal?: number | null; + cashDenominations?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -14998,7 +16012,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The person's id */ userId: string; }; cookie?: never; @@ -15006,6 +16022,15 @@ export interface operations { requestBody: { content: { "application/json": { + denominations: ({ + /** @description The note or coin, in rand */ + value: number; + count: number; + } & { + [key: string]: unknown; + })[]; + notes?: string | null; + } & { [key: string]: unknown; }; }; @@ -15018,7 +16043,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The saved count */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -15073,6 +16101,28 @@ export interface operations { requestBody: { content: { "application/json": { + lines: ({ + /** @description cash, card, eft… */ + method: string; + bankAmount?: number | null; + /** @description Cash only */ + onHandAmount?: number | null; + /** @description Not cash */ + pendingAmount?: number | null; + pendingReference?: string | null; + writeOffs?: ({ + category: string; + amount?: number | null; + reason?: string | null; + } & { + [key: string]: unknown; + })[]; + notes?: string | null; + } & { + [key: string]: unknown; + })[]; + notes?: string | null; + } & { [key: string]: unknown; }; }; @@ -15085,7 +16135,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15140,6 +16194,29 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Per payment method: in the bank, on hand, pending, write-offs (leave out for a quick close) */ + lines?: ({ + /** @description cash, card, eft… */ + method: string; + bankAmount?: number | null; + /** @description Cash only */ + onHandAmount?: number | null; + /** @description Not cash */ + pendingAmount?: number | null; + pendingReference?: string | null; + writeOffs?: ({ + category: string; + amount?: number | null; + reason?: string | null; + } & { + [key: string]: unknown; + })[]; + notes?: string | null; + } & { + [key: string]: unknown; + })[]; + notes?: string | null; + } & { [key: string]: unknown; }; }; @@ -15152,7 +16229,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + /** @description close, quick_close, reopen */ + action?: string | null; + notes?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + performedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15207,6 +16301,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Why */ + notes?: string | null; + } & { [key: string]: unknown; }; }; @@ -15219,7 +16316,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + /** @description close, quick_close, reopen */ + action?: string | null; + notes?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + performedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15274,6 +16388,13 @@ export interface operations { requestBody: { content: { "application/json": { + /** @enum {string} */ + outcome: "received" | "written_off"; + amount: number | string; + /** @description A write-off: what it was for */ + category?: string | null; + notes?: string | null; + } & { [key: string]: unknown; }; }; @@ -15286,7 +16407,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The settlement recorded */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -15331,6 +16455,7 @@ export interface operations { "getProvider-transactions": { parameters: { query?: { + /** @description yoco or payfast */ provider?: string; }; header?: never; @@ -15346,7 +16471,35 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + success: boolean; + data: ({ + id: string; + provider: string; + providerLabel: string; + /** @description The provider's id */ + externalId: string; + /** @description Cents */ + amount?: number | null; + currency?: string | null; + createdDate?: string | null; + checkoutId?: string | null; + methodType?: string | null; + reconciled: boolean; + ignored: boolean; + paymentId?: string | null; + /** @description Why it needs a look */ + note?: string | null; + metadata?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + })[]; + message?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15395,7 +16548,35 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + success: boolean; + data: ({ + id: string; + provider: string; + providerLabel: string; + /** @description The provider's id */ + externalId: string; + /** @description Cents */ + amount?: number | null; + currency?: string | null; + createdDate?: string | null; + checkoutId?: string | null; + methodType?: string | null; + reconciled: boolean; + ignored: boolean; + paymentId?: string | null; + /** @description Why it needs a look */ + note?: string | null; + metadata?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + })[]; + message?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15432,6 +16613,11 @@ export interface operations { requestBody: { content: { "application/json": { + registrationId?: string | null; + /** @description As a donation to this event instead */ + eventId?: string | null; + userId?: string | null; + } & { [key: string]: unknown; }; }; @@ -15444,7 +16630,103 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + success: boolean; + data: { + transaction: { + id: string; + provider: string; + providerLabel: string; + /** @description The provider's id */ + externalId: string; + /** @description Cents */ + amount?: number | null; + currency?: string | null; + createdDate?: string | null; + checkoutId?: string | null; + methodType?: string | null; + reconciled: boolean; + ignored: boolean; + paymentId?: string | null; + /** @description Why it needs a look */ + note?: string | null; + metadata?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; + payment: { + id: string; + /** @description Rand; a refund is negative */ + amount: number; + /** @description cash, card, eft, other — or the wallet type for an online payment */ + method: string; + /** @description yoco or payfast for an online payment */ + provider?: string | null; + userId: string; + recordedById?: string | null; + registrationId?: string | null; + eventId?: string | null; + isDonation: boolean; + isSponsorship?: boolean | null; + /** @description A refund: the payment it refunds; a donation leg: the donation */ + originalPaymentId?: string | null; + externalId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + recordedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; + generatedTickets?: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; + message?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15496,6 +16778,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -15511,7 +16794,35 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + success: boolean; + data: { + id: string; + provider: string; + providerLabel: string; + /** @description The provider's id */ + externalId: string; + /** @description Cents */ + amount?: number | null; + currency?: string | null; + createdDate?: string | null; + checkoutId?: string | null; + methodType?: string | null; + reconciled: boolean; + ignored: boolean; + paymentId?: string | null; + /** @description Why it needs a look */ + note?: string | null; + metadata?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; + message?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15564,6 +16875,15 @@ export interface operations { content: { "application/json": { eventId: string; + eventOptionId: string; + variantId?: string | null; + /** @description Per-session tickets: the session */ + sessionId?: string | null; + quantity: number | string; + /** @description Not signed in */ + guestName?: string | null; + guestEmail?: string | null; + guestPhone?: string | null; } & { [key: string]: unknown; }; @@ -15577,7 +16897,31 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + eventOptionId: string; + variantId?: string | null; + sessionId?: string | null; + userId: string; + quantity: number; + /** @description Place in the queue */ + position: number; + /** @description waiting, offered, claimed, expired, removed, left */ + status: string; + offeredQuantity?: number | null; + offeredAt?: string | null; + offerExpiresAt?: string | null; + claimedAt?: string | null; + registrationId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description People ahead */ + ahead: number; + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15608,7 +16952,28 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + eventId: string; + eventOptionId: string; + variantId?: string | null; + sessionId?: string | null; + userId: string; + quantity: number; + /** @description Place in the queue */ + position: number; + /** @description waiting, offered, claimed, expired, removed, left */ + status: string; + offeredQuantity?: number | null; + offeredAt?: string | null; + offerExpiresAt?: string | null; + claimedAt?: string | null; + registrationId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -15628,6 +16993,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -15641,7 +17007,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + eventTitle?: string | null; + eventStart?: string | null; + eventOptionId: string; + optionName: string; + variantId?: string | null; + variantName?: string | null; + sessionId?: string | null; + sessionName?: string | null; + sessionStart?: string | null; + lineName: string; + /** @description Places offered */ + quantity?: number | null; + requested: number; + expiresAt?: string | null; + name?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15668,6 +17053,7 @@ export interface operations { getEventsIdWaitlist: { parameters: { query?: { + /** @description `true`/`1`: include everything, not just the current ones */ all?: string; }; header?: never; @@ -15686,7 +17072,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + eventId: string; + eventOptionId: string; + variantId?: string | null; + sessionId?: string | null; + userId: string; + quantity: number; + /** @description Place in the queue */ + position: number; + /** @description waiting, offered, claimed, expired, removed, left */ + status: string; + offeredQuantity?: number | null; + offeredAt?: string | null; + offerExpiresAt?: string | null; + claimedAt?: string | null; + registrationId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -15741,6 +17156,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Places to offer (default: all they asked for) */ + quantity?: number | string; + } & { [key: string]: unknown; }; }; @@ -15753,7 +17171,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15808,6 +17230,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @enum {string} */ + direction: "up" | "down"; + } & { [key: string]: unknown; }; }; @@ -15820,7 +17245,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15872,6 +17301,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -15887,7 +17317,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -15948,7 +17382,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16000,7 +17438,17 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + enabled: boolean; + open?: boolean | null; + spotPrice?: number | null; + showProgress?: boolean | null; + goalSpots?: number | null; + spotsFunded?: number | null; + sponsors?: unknown; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16043,7 +17491,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Plus the pool: given, used and places funded */ + data: { + eventId: string; + /** @description Rand */ + spotPrice: number; + goalSpots?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16096,6 +17552,17 @@ export interface operations { content: { "application/json": { eventId: string; + /** @description Places to fund (or amount) */ + spots?: number | string; + amount?: number | string; + anonymous?: boolean | null; + sponsorName?: string | null; + message?: string | null; + /** @description Not signed in */ + name?: string | null; + email?: string | null; + phone?: string | null; + provider?: string | null; } & { [key: string]: unknown; }; @@ -16109,7 +17576,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkoutId?: string | null; + /** @description Where to send the person to pay (null when the provider takes a form) */ + redirectUrl?: string | null; + provider?: string | null; + /** @description A form to post (PayFast) */ + form?: ({ + action: string; + fields: { + [key: string]: string; + }; + } & { + [key: string]: unknown; + }) | null; + /** @description Rand */ + amount: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16143,7 +17628,31 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + /** @description Status → how many */ + counts: { + [key: string]: number; + }; + rows: ({ + /** @description The young person */ + name: string; + /** @description not_requested, pending, given, declined */ + status: string; + parentName?: string | null; + parentEmail?: string | null; + parentPhone?: string | null; + request?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16204,7 +17713,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + id?: string; + title?: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }; + rows: ({ + name: string; + dateOfBirth?: string | null; + parentName?: string | null; + parentPhone?: string | null; + parentEmail?: string | null; + medical?: { + [key: string]: unknown; + } | null; + emergency?: { + [key: string]: unknown; + } | null; + photoConsent?: boolean | null; + /** @description Medical details removed after the event */ + purged: boolean; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16256,6 +17794,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -16271,7 +17810,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + sent: number; + pending: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16323,6 +17868,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -16338,7 +17884,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + created: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16390,6 +17941,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -16405,7 +17957,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16443,6 +17999,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -16456,7 +18013,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + status: string; + superseded: boolean; + expired: boolean; + respondedAt?: string | null; + attendeeName: string; + parentName?: string | null; + consentText: string; + textVersion?: number | null; + event: { + title: string; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + location?: string | null; + } & { + [key: string]: unknown; + }; + /** @description What the form asks for */ + collect: { + medical: boolean; + emergency: boolean; + photo: boolean; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16485,6 +18071,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -16492,6 +18079,28 @@ export interface operations { requestBody: { content: { "application/json": { + /** @enum {string} */ + decision: "give" | "decline"; + signedName: string; + /** @description Must be true */ + isGuardian: boolean; + medical?: { + allergies?: string | null; + medication?: string | null; + conditions?: string | null; + medicalAid?: string | null; + } & { + [key: string]: unknown; + }; + emergency?: { + name: string; + phone: string; + relationship?: string | null; + } & { + [key: string]: unknown; + }; + photoConsent?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -16504,7 +18113,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @enum {string} */ + status: "given" | "declined"; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16531,9 +18146,13 @@ export interface operations { "getForm-responses": { parameters: { query?: { + /** @description Only this event */ eventId?: string; + /** @description Only this registration */ registrationId?: string; + /** @description Only this person */ userId?: string; + /** @description Where the last page ended (its `nextCursor`) */ cursor?: string; }; header?: never; @@ -16549,7 +18168,27 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + items: ({ + id: string; + registrationId: string; + attendeeId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + answers?: ({ + fieldId: string; + value: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + /** @description Pass as `cursor` for the next page */ + nextCursor?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16585,6 +18224,7 @@ export interface operations { getFeedbackSummary: { parameters: { query?: { + /** @description These events (comma-separated ids) */ eventIds?: string; }; header?: never; @@ -16600,7 +18240,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + eventId: string; + title: string; + /** @description Date and time (ISO 8601) */ + startDate: string; + anonymous: boolean; + sentAt?: string | null; + invited: number; + responses: number; + /** @description % */ + responseRate?: number | null; + /** @description Each question with its answers summarised */ + questions: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -16638,6 +18295,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -16651,7 +18309,28 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + name: string; + intro?: string | null; + anonymous: boolean; + responded: boolean; + fields: ({ + id?: string; + /** @description rating, multiple_choice, text, yes_no… */ + type: string; + label: string; + isRequired?: boolean | null; + helpText?: string | null; + options?: string[] | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16680,6 +18359,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -16687,6 +18367,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Field id → answer */ + answers: { + [key: string]: unknown; + }; + } & { [key: string]: unknown; }; }; @@ -16699,7 +18384,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16742,7 +18431,33 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description null when the event has no feedback form */ + data: ({ + id: string; + eventId: string; + sendAt?: string | null; + sentAt?: string | null; + /** @description checked_in or everyone */ + audience: string; + anonymous: boolean; + intro?: string | null; + fields: ({ + id?: string; + /** @description rating, multiple_choice, text, yes_no… */ + type: string; + label: string; + isRequired?: boolean | null; + helpText?: string | null; + options?: string[] | null; + } & { + [key: string]: unknown; + })[]; + invited?: number | null; + /** @description Answers per question */ + responses?: unknown; + } & { + [key: string]: unknown; + }) | null; }; }; }; @@ -16797,6 +18512,23 @@ export interface operations { requestBody: { content: { "application/json": { + sendAt?: string | null; + /** @description checked_in or everyone */ + audience?: string | null; + anonymous?: boolean | null; + intro?: string | null; + fields: ({ + id?: string; + /** @description rating, multiple_choice, text, yes_no… */ + type: string; + label: string; + isRequired?: boolean | null; + helpText?: string | null; + options?: string[] | null; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -16809,7 +18541,33 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description null when the event has no feedback form */ + data: ({ + id: string; + eventId: string; + sendAt?: string | null; + sentAt?: string | null; + /** @description checked_in or everyone */ + audience: string; + anonymous: boolean; + intro?: string | null; + fields: ({ + id?: string; + /** @description rating, multiple_choice, text, yes_no… */ + type: string; + label: string; + isRequired?: boolean | null; + helpText?: string | null; + options?: string[] | null; + } & { + [key: string]: unknown; + })[]; + invited?: number | null; + /** @description Answers per question */ + responses?: unknown; + } & { + [key: string]: unknown; + }) | null; }; }; }; @@ -16870,7 +18628,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16922,6 +18684,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -16937,7 +18700,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + invited: number; + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -16995,7 +18763,121 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -17036,7 +18918,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description The tickets sent */ + ticketIds?: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17063,7 +18951,9 @@ export interface operations { getTicketsScansRecent: { parameters: { query?: { + /** @description Only this event */ eventId?: string; + /** @description How many per page */ limit?: string; }; header?: never; @@ -17079,7 +18969,34 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + scannedBy?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + ticket: { + id: string; + event: { + title: string; + } & { + [key: string]: unknown; + }; + registrationOption?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -17115,6 +19032,7 @@ export interface operations { getTicketsScansStats: { parameters: { query?: { + /** @description Only this event */ eventId?: string; }; header?: never; @@ -17130,7 +19048,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + totalToday: number; + myToday: number; + lastHour: number; + byStaff: ({ + scannedById: string; + name: string; + count: number; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17173,6 +19104,18 @@ export interface operations { requestBody: { content: { "application/json": { + registrationId?: string | null; + /** @description Or registrationId */ + ticketIds?: string[]; + /** + * @description How to send it + * @enum {string} + */ + channel: "email" | "whatsapp" | "both"; + /** @description Send here instead */ + overrideEmail?: string | null; + overridePhone?: string | null; + } & { [key: string]: unknown; }; }; @@ -17185,7 +19128,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description The tickets sent */ + ticketIds?: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17242,7 +19191,126 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + tickets: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17285,6 +19353,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Ids */ + ticketIds: string[]; + } & { [key: string]: unknown; }; }; @@ -17297,7 +19368,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17333,8 +19408,11 @@ export interface operations { getTickets: { parameters: { query?: { + /** @description Only this event */ eventId?: string; + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; }; header?: never; @@ -17350,7 +19428,129 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + data: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + total: number; + page: number; + limit: number; + pages: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17388,6 +19588,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description What the ticket's QR code holds */ qrCode: string; }; cookie?: never; @@ -17401,7 +19602,121 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17462,7 +19777,121 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -17509,6 +19938,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -17522,7 +19952,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description pending, accepted, declined, cancelled, expired */ + status: string; + toName: string; + /** @description Date and time (ISO 8601) */ + expiresAt: string; + fromName: string; + event: { + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }; + option: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17551,10 +20010,12 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -17570,7 +20031,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + ticketId: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17599,10 +20065,12 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -17618,7 +20086,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17661,7 +20133,121 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description What the QR code holds */ + qrCode: string; + /** @description People on the ticket */ + quantity: number; + isUsed: boolean; + eventId: string; + /** @description The payer */ + userId: string; + registrationOptionId: string; + /** @description A named ticket: the person it's for */ + attendeeId?: string | null; + holderUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Check-ins */ + usages?: ({ + id?: string; + /** @description Date and time (ISO 8601) */ + scannedAt: string; + quantityRedeemed: number; + sessionId?: string | null; + /** @description Ticked present by hand */ + manual?: boolean | null; + } & { + [key: string]: unknown; + })[]; + event?: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + }) | null; + /** @description The payer */ + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + attendee?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registrationOption?: ({ + eventOption?: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + }) | null; + variant?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + registration?: ({ + id?: string; + userId?: string; + eventId?: string; + /** @enum {string} */ + status?: "pending" | "confirmed" | "partial_paid" | "paid" | "cancelled"; + discountTotal?: number | null; + /** @description What it costs now, after discounts */ + totalDueComputed?: number | null; + /** @description Date and time (ISO 8601) */ + createdAt?: string; + user?: ({ + id?: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + } & { + [key: string]: unknown; + }) | null; + event?: ({ + id: string; + title: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17707,6 +20293,18 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Who it goes to */ + name: string; + email?: string | null; + /** @description Email or phone needed */ + phone?: string | null; + /** @description Youth events */ + dateOfBirth?: string | null; + gender?: string | null; + parentName?: string | null; + parentEmail?: string | null; + parentPhone?: string | null; + } & { [key: string]: unknown; }; }; @@ -17719,7 +20317,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + requestId: string; + /** @description Date and time (ISO 8601) */ + expiresAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17771,7 +20376,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17823,7 +20432,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + ticketId: string; + fromUserId?: string | null; + toUserId?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -17859,6 +20477,7 @@ export interface operations { "getScan-locks": { parameters: { query: { + /** @description Only this event */ eventId: string; }; header?: never; @@ -17874,7 +20493,29 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + eventId: string; + sectionId?: string | null; + sectionName?: string | null; + deviceId: string; + deviceName?: string | null; + /** @description Who holds it */ + user?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + /** @description Date and time (ISO 8601) */ + lockedAt: string; + snapshotAt?: string | null; + lastSyncAt?: string | null; + releasedAt?: string | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -17918,6 +20559,10 @@ export interface operations { content: { "application/json": { eventId: string; + /** @description Just this section (default: the whole event) */ + sectionId?: string | null; + deviceId: string; + deviceName?: string | null; } & { [key: string]: unknown; }; @@ -17931,7 +20576,29 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + sectionId?: string | null; + sectionName?: string | null; + deviceId: string; + deviceName?: string | null; + /** @description Who holds it */ + user?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + /** @description Date and time (ISO 8601) */ + lockedAt: string; + snapshotAt?: string | null; + lastSyncAt?: string | null; + releasedAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -17967,7 +20634,9 @@ export interface operations { "getScan-locksReports": { parameters: { query: { + /** @description Only this event */ eventId: string; + /** @description `true`: only the ones not reviewed yet */ unreviewed?: string; }; header?: never; @@ -17983,7 +20652,40 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + accepted?: number | null; + duplicates?: number | null; + conflicts?: unknown; + reviewedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + scanLock: { + id: string; + eventId: string; + sectionId?: string | null; + sectionName?: string | null; + deviceId: string; + deviceName?: string | null; + /** @description Who holds it */ + user?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + /** @description Date and time (ISO 8601) */ + lockedAt: string; + snapshotAt?: string | null; + lastSyncAt?: string | null; + releasedAt?: string | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -18026,6 +20728,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -18041,7 +20744,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description Date and time (ISO 8601) */ + reviewedAt: string; + reviewedById: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18086,6 +20796,7 @@ export interface operations { "getScan-locksIdSnapshot": { parameters: { query?: { + /** @description This device's id (offline scanning) */ deviceId?: string; }; header?: never; @@ -18104,7 +20815,55 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + lock: { + id: string; + eventId: string; + sectionId?: string | null; + sectionName?: string | null; + deviceId: string; + deviceName?: string | null; + /** @description Who holds it */ + user?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + /** @description Date and time (ISO 8601) */ + lockedAt: string; + snapshotAt?: string | null; + lastSyncAt?: string | null; + releasedAt?: string | null; + } & { + [key: string]: unknown; + }; + /** @description Date and time (ISO 8601) */ + snapshotAt: string; + session: ({ + id: string; + label: string; + } & { + [key: string]: unknown; + }) | null; + noSessionToday: boolean; + tickets: ({ + id: string; + qrCode: string; + holder: string; + bookedBy: string; + option: string; + variant?: string | null; + quantity: number; + remaining: number; + consentStatus: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18159,6 +20918,18 @@ export interface operations { requestBody: { content: { "application/json": { + deviceId: string; + scans: ({ + /** @description The device's id for the scan (repeats are ignored) */ + clientScanId: string; + qrCode: string; + qty?: number | string; + scannedAt?: string | null; + sessionId?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -18171,7 +20942,18 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + accepted: number; + duplicates: number; + /** @description Scans that clashed with online check-ins */ + conflicts: { + [key: string]: unknown; + }[]; + reportId: string; + released: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18223,6 +21005,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -18238,7 +21021,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18307,7 +21094,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18354,6 +21145,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The code */ code: string; }; cookie?: never; @@ -18367,7 +21159,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + valid: boolean; + revoked?: boolean | null; + name?: string | null; + event?: string | null; + completedOn?: string | null; + issuedAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18407,7 +21208,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description For checking it at /verify */ + code: string; + name: string; + /** @description Date and time (ISO 8601) */ + issuedAt: string; + sessionsAttended?: number | null; + totalSessions?: number | null; + event?: ({ + id?: string; + title?: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -18432,6 +21252,18 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Event title to show */ + title?: string | null; + config?: { + /** @description classic, modern, elegant, simple */ + template?: string | null; + title?: string | null; + /** @description {name} and {event} are filled in */ + body?: string | null; + } & { + [key: string]: unknown; + }; + } & { [key: string]: unknown; }; }; @@ -18535,6 +21367,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -18550,7 +21383,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + ok: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18611,7 +21449,71 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + certificatesEnabled?: boolean | null; + certificateConfig?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; + columns: ({ + /** @description Session id, or `event` */ + id: string; + label: string; + } & { + [key: string]: unknown; + })[]; + rows: ({ + ticketId: string; + /** @description Picked/ticked sessions (null: all) */ + bookedSessions: string[] | null; + sessionTickets: { + [key: string]: string; + } | null; + name: string; + bookedBy: string; + email: string; + phone: string; + option: string; + variant?: string | null; + quantity: number; + /** @description Session id (or `event`) → people checked in */ + checkIns: { + [key: string]: number; + }; + attended: number; + total: number; + /** @description Meets the certificate rule */ + completed: boolean; + certificate?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + })[]; + totals: { + [key: string]: number; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18666,6 +21568,11 @@ export interface operations { requestBody: { content: { "application/json": { + ticketId: string; + /** @description A session id, or `event` on a single-date event */ + sessionId: string; + present: boolean; + } & { [key: string]: unknown; }; }; @@ -18678,7 +21585,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + ok: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18723,7 +21635,9 @@ export interface operations { getEventsIdAttendanceExport: { parameters: { query?: { + /** @description File type, e.g. `pdf` or `xlsx` */ format?: string; + /** @description Multi-day events: the session (default: today's) */ sessionId?: string; }; header?: never; @@ -18795,6 +21709,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Just this person (default: everyone who qualifies) */ + ticketId?: string | null; + } & { [key: string]: unknown; }; }; @@ -18807,7 +21724,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + issued: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18862,6 +21783,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Just this one (default: every one not sent yet) */ + certificateId?: string | null; + } & { [key: string]: unknown; }; }; @@ -18874,7 +21798,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + sent: number; + skipped: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -18991,7 +21920,37 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + medicalShown: boolean; + groups: ({ + id: string; + name: string; + capacity?: number | null; + gender?: string | null; + setName: string; + event: { + id?: string; + title?: string; + startDate?: string | null; + endDate?: string | null; + } & { + [key: string]: unknown; + }; + members: ({ + attendeeId?: string; + name: string; + gender?: string | null; + dateOfBirth?: string | null; + groupId?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19034,7 +21993,61 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + sets: ({ + id: string; + eventId: string; + name: string; + showOnTicket: boolean; + order: number; + groups: ({ + id: string; + setId: string; + name: string; + capacity?: number | null; + gender?: string | null; + leaderUserId?: string | null; + minAge?: number | null; + maxAge?: number | null; + ratio?: number | null; + order: number; + } & { + [key: string]: unknown; + })[]; + assignments: ({ + attendeeId: string; + groupId: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + attendees: ({ + id: string; + name: string; + gender?: string | null; + dateOfBirth?: string | null; + registrationId: string; + bookedBy: string; + } & { + [key: string]: unknown; + })[]; + leaders: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Places with no name yet */ + unnamedPlaces: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19087,6 +22100,9 @@ export interface operations { content: { "application/json": { eventId: string; + /** @description e.g. Cabins, Buses */ + name: string; + showOnTicket?: boolean | null; } & { [key: string]: unknown; }; @@ -19100,7 +22116,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + name: string; + showOnTicket: boolean; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19152,7 +22176,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19207,6 +22235,9 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + showOnTicket?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -19219,7 +22250,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + name: string; + showOnTicket: boolean; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19264,6 +22303,7 @@ export interface operations { "getAllocation-setsIdLists": { parameters: { query?: { + /** @description `true`: include medical notes (supervisors; logged) */ medical?: string; }; header?: never; @@ -19282,7 +22322,37 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + set: { + id: string; + name: string; + } & { + [key: string]: unknown; + }; + event: { + [key: string]: unknown; + }; + groups: ({ + id: string; + name: string; + capacity?: number | null; + gender?: string | null; + leader?: string | null; + members: ({ + attendeeId?: string; + name: string; + gender?: string | null; + dateOfBirth?: string | null; + groupId?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19337,6 +22407,16 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + capacity?: number | string | null; + gender?: ("male" | "female" | "mixed") | null; + /** @description A staff member */ + leaderUserId?: string | null; + minAge?: number | string | null; + maxAge?: number | string | null; + /** @description Children per leader */ + ratio?: number | string | null; + } & { [key: string]: unknown; }; }; @@ -19349,7 +22429,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + setId: string; + name: string; + capacity?: number | null; + gender?: string | null; + leaderUserId?: string | null; + minAge?: number | null; + maxAge?: number | null; + ratio?: number | null; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19404,6 +22497,10 @@ export interface operations { requestBody: { content: { "application/json": { + attendeeId: string; + /** @description null takes them out */ + groupId?: string | null; + } & { [key: string]: unknown; }; }; @@ -19416,7 +22513,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19477,7 +22578,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19532,6 +22637,12 @@ export interface operations { requestBody: { content: { "application/json": { + /** + * @description Keep each booking together, or spread them + * @enum {string} + */ + mode?: "together" | "split"; + } & { [key: string]: unknown; }; }; @@ -19544,7 +22655,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + placed: number; + unplaced: number; + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19605,7 +22722,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -19660,6 +22781,16 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + capacity?: number | string | null; + gender?: ("male" | "female" | "mixed") | null; + /** @description A staff member */ + leaderUserId?: string | null; + minAge?: number | string | null; + maxAge?: number | string | null; + /** @description Children per leader */ + ratio?: number | string | null; + } & { [key: string]: unknown; }; }; @@ -19672,7 +22803,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + setId: string; + name: string; + capacity?: number | null; + gender?: string | null; + leaderUserId?: string | null; + minAge?: number | null; + maxAge?: number | null; + ratio?: number | null; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20308,7 +23452,62 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + family: ({ + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }) | null; + /** @description The family QR code (shown at the desk) */ + qrToken?: string | null; + /** @description Collection codes for children checked in now */ + codes: { + [key: string]: unknown; + }[]; + /** @description Recent "come to the room" messages */ + pages: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20333,6 +23532,8 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + } & { [key: string]: unknown; }; }; @@ -20345,7 +23546,62 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + family: ({ + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }) | null; + /** @description The family QR code (shown at the desk) */ + qrToken?: string | null; + /** @description Collection codes for children checked in now */ + codes: { + [key: string]: unknown; + }[]; + /** @description Recent "come to the room" messages */ + pages: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20385,7 +23641,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description What happened: left, or the family was deleted as the last parent */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -20410,6 +23669,8 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + } & { [key: string]: unknown; }; }; @@ -20422,7 +23683,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20456,6 +23758,16 @@ export interface operations { requestBody: { content: { "application/json": { + firstName: string; + lastName?: string | null; + dateOfBirth?: string | null; + /** @description male or female (anything else: not given) */ + gender?: string | null; + allergies?: string | null; + medicalNotes?: string | null; + /** @description Kept encrypted, like the medical notes */ + custodyNotes?: string | null; + } & { [key: string]: unknown; }; }; @@ -20468,7 +23780,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20505,6 +23835,16 @@ export interface operations { requestBody: { content: { "application/json": { + firstName?: string; + lastName?: string | null; + dateOfBirth?: string | null; + /** @description male or female (anything else: not given) */ + gender?: string | null; + allergies?: string | null; + medicalNotes?: string | null; + /** @description Kept encrypted, like the medical notes */ + custodyNotes?: string | null; + } & { [key: string]: unknown; }; }; @@ -20517,7 +23857,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20569,7 +23927,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20612,6 +23974,10 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + phone?: string | null; + relationship?: string | null; + } & { [key: string]: unknown; }; }; @@ -20624,7 +23990,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20661,6 +24034,10 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + phone?: string | null; + relationship?: string | null; + } & { [key: string]: unknown; }; }; @@ -20673,7 +24050,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20725,7 +24109,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20774,7 +24162,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + kidsCheckIn?: boolean | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -20814,7 +24221,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id?: string; + title?: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate?: string; + /** @description Date and time (ISO 8601) */ + endDate?: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -20857,7 +24282,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + id: string; + title: string; + scheduleType?: string | null; + kidsCheckIn: boolean; + kidsOptionId?: string | null; + kidsRoomSetId?: string | null; + } & { + [key: string]: unknown; + }; + options: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + })[]; + /** @description Allocation sets that can be the rooms */ + sets: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -20912,6 +24366,12 @@ export interface operations { requestBody: { content: { "application/json": { + enabled?: boolean | null; + /** @description The kids ticket (`new` makes a free one; null: none) */ + optionId?: string | null; + /** @description The allocation set used as rooms */ + roomSetId?: string | null; + } & { [key: string]: unknown; }; }; @@ -20924,7 +24384,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The saved set-up, as GET answers */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -20969,7 +24432,9 @@ export interface operations { getEventsIdKidsBoard: { parameters: { query?: { + /** @description Multi-day events: the session (default: today's) */ sessionId?: string; + /** @description `1` also writes it to the access log (a list with personal details) */ log?: string; }; header?: never; @@ -20988,7 +24453,35 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + /** @description The day or session it's for */ + occasion: string; + sessionId?: string | null; + sessionLabel?: string | null; + rooms: ({ + id: string; + name: string; + minAge?: number | null; + maxAge?: number | null; + capacity?: number | null; + ratio?: number | null; + order?: number | null; + leaderNames?: string[]; + /** @description Ids */ + leaderIds?: string[]; + } & { + [key: string]: unknown; + })[]; + /** @description Children checked in, with room and code */ + checkIns: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21033,7 +24526,9 @@ export interface operations { getEventsIdKidsFamilies: { parameters: { query?: { + /** @description Text to search for */ q?: string; + /** @description Multi-day events: the session (default: today's) */ sessionId?: string; }; header?: never; @@ -21052,7 +24547,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -21107,6 +24643,29 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + parent: { + name: string; + email?: string | null; + /** @description Email or phone needed: the collection code is sent there */ + phone?: string | null; + } & { + [key: string]: unknown; + }; + children?: ({ + firstName: string; + lastName?: string | null; + dateOfBirth?: string | null; + /** @description male or female (anything else: not given) */ + gender?: string | null; + allergies?: string | null; + medicalNotes?: string | null; + /** @description Kept encrypted, like the medical notes */ + custodyNotes?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -21119,7 +24678,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21166,7 +24766,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -21180,7 +24782,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21227,7 +24870,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The family's id */ familyId: string; }; cookie?: never; @@ -21241,7 +24886,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21288,7 +24974,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The family's id */ familyId: string; }; cookie?: never; @@ -21296,6 +24984,11 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + email?: string | null; + /** @description Email or phone needed: the collection code is sent there */ + phone?: string | null; + } & { [key: string]: unknown; }; }; @@ -21308,7 +25001,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21355,7 +25089,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The family's id */ familyId: string; }; cookie?: never; @@ -21363,6 +25099,16 @@ export interface operations { requestBody: { content: { "application/json": { + firstName: string; + lastName?: string | null; + dateOfBirth?: string | null; + /** @description male or female (anything else: not given) */ + gender?: string | null; + allergies?: string | null; + medicalNotes?: string | null; + /** @description Kept encrypted, like the medical notes */ + custodyNotes?: string | null; + } & { [key: string]: unknown; }; }; @@ -21375,7 +25121,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21422,8 +25186,11 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The family's id */ familyId: string; + /** @description The child's id */ childId: string; }; cookie?: never; @@ -21431,6 +25198,16 @@ export interface operations { requestBody: { content: { "application/json": { + firstName?: string; + lastName?: string | null; + dateOfBirth?: string | null; + /** @description male or female (anything else: not given) */ + gender?: string | null; + allergies?: string | null; + medicalNotes?: string | null; + /** @description Kept encrypted, like the medical notes */ + custodyNotes?: string | null; + } & { [key: string]: unknown; }; }; @@ -21443,7 +25220,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21490,7 +25285,9 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; + /** @description The family's id */ familyId: string; }; cookie?: never; @@ -21498,6 +25295,10 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + phone?: string | null; + relationship?: string | null; + } & { [key: string]: unknown; }; }; @@ -21510,7 +25311,48 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21565,6 +25407,18 @@ export interface operations { requestBody: { content: { "application/json": { + familyId: string; + sessionId?: string | null; + /** @description Who, and into which room (default: by age) */ + children: ({ + childId: string; + roomId?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Send the code to this adult too */ + sendToAdultId?: string | null; + } & { [key: string]: unknown; }; }; @@ -21577,7 +25431,33 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description The collection code */ + code: string; + qr: string; + occasion: string; + family: { + id: string; + name: string; + } & { + [key: string]: unknown; + }; + checkIns: ({ + id: string; + name: string; + firstName: string; + room?: { + [key: string]: unknown; + } | null; + already: boolean; + /** @description Write this on the sticker */ + sticker?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21632,6 +25512,14 @@ export interface operations { requestBody: { content: { "application/json": { + code: string; + /** @description Just these children (default: all on the code) */ + checkInIds?: string[]; + /** @description Who collected them */ + collectedBy?: string | null; + roomId?: string | null; + sessionId?: string | null; + } & { [key: string]: unknown; }; }; @@ -21644,7 +25532,17 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkedOut: ({ + id: string; + name: string; + room?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21689,11 +25587,14 @@ export interface operations { getEventsIdKidsCodeCode: { parameters: { query?: { + /** @description Multi-day events: the session (default: today's) */ sessionId?: string; }; header?: never; path: { + /** @description The id */ id: string; + /** @description The code */ code: string; }; cookie?: never; @@ -21707,7 +25608,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + code: string; + found: boolean; + family?: { + [key: string]: unknown; + } | null; + children: ({ + id: string; + name: string; + room?: { + [key: string]: unknown; + } | null; + checkedOutAt?: string | null; + collectedBy?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21762,6 +25682,11 @@ export interface operations { requestBody: { content: { "application/json": { + roomId: string; + sessionId?: string | null; + /** @description false: off duty */ + on?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -21774,7 +25699,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + roomId: string; + on: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21819,7 +25749,9 @@ export interface operations { getEventsIdKidsOffline: { parameters: { query?: { + /** @description This device's id (offline scanning) */ deviceId?: string; + /** @description Multi-day events: the session (default: today's) */ sessionId?: string; }; header?: never; @@ -21838,7 +25770,83 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + /** @description The day or session it's for */ + occasion: string; + sessionId?: string | null; + sessionLabel?: string | null; + rooms: ({ + id: string; + name: string; + minAge?: number | null; + maxAge?: number | null; + capacity?: number | null; + ratio?: number | null; + order?: number | null; + leaderNames?: string[]; + /** @description Ids */ + leaderIds?: string[]; + } & { + [key: string]: unknown; + })[]; + /** @description Children checked in, with room and code */ + checkIns: { + [key: string]: unknown; + }[]; + families: ({ + id: string; + name: string; + parents: ({ + userId: string; + name: string; + phone?: string | null; + email?: string | null; + } & { + [key: string]: unknown; + })[]; + children: ({ + id: string; + firstName: string; + lastName: string; + name: string; + dateOfBirth?: string | null; + age?: number | null; + gender?: string | null; + allergies?: string | null; + hasMedical: boolean; + /** @description There are custody notes */ + hasCustody: boolean; + /** @description Only where notes may be shown */ + medicalNotes?: string | null; + custodyNotes?: string | null; + lastCheckInAt?: string | null; + } & { + [key: string]: unknown; + })[]; + /** @description Others who may collect the children */ + adults: ({ + name: string; + phone?: string | null; + relationship?: string | null; + id: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + /** @description Codes reserved for this device */ + codes: { + [key: string]: unknown; + }[]; + /** @description Date and time (ISO 8601) */ + downloadedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21893,6 +25901,15 @@ export interface operations { requestBody: { content: { "application/json": { + deviceId: string; + sessionId?: string | null; + checkIns?: { + [key: string]: unknown; + }[]; + checkOuts?: { + [key: string]: unknown; + }[]; + } & { [key: string]: unknown; }; }; @@ -21905,7 +25922,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + checkedIn: number; + checkedOut: number; + conflicts: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -21960,6 +25985,9 @@ export interface operations { requestBody: { content: { "application/json": { + reason: string; + collectedBy: string; + } & { [key: string]: unknown; }; }; @@ -21972,7 +26000,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description Date and time (ISO 8601) */ + checkedOutAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22027,6 +26061,8 @@ export interface operations { requestBody: { content: { "application/json": { + message?: string | null; + } & { [key: string]: unknown; }; }; @@ -22039,7 +26075,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Channels used */ + sent: string[]; + text: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22094,6 +26136,8 @@ export interface operations { requestBody: { content: { "application/json": { + roomId: string; + } & { [key: string]: unknown; }; }; @@ -22106,7 +26150,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + roomId: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22158,6 +26207,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -22173,7 +26223,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + resolved: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22231,7 +26285,52 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + slots: ({ + slotId: string; + role: { + [key: string]: unknown; + }; + event: { + [key: string]: unknown; + }; + shift: { + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + text: string; + hours: number; + } & { + [key: string]: unknown; + }; + checkedInAt?: string | null; + canCheckIn: boolean; + past: boolean; + swapId?: string | null; + hasTicket: boolean; + } & { + [key: string]: unknown; + })[]; + /** @description Slots others want covered */ + cover: { + [key: string]: unknown; + }[]; + events: ({ + id: string; + title: string; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + location?: string | null; + roles: number; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22265,7 +26364,90 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + sessions: ({ + id: string; + label: string; + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + } & { + [key: string]: unknown; + })[]; + roles: ({ + id: string; + eventId: string; + sessionId?: string | null; + sessionLabel?: string | null; + name: string; + description: string; + startsAt?: string | null; + endsAt?: string | null; + shift: { + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + text: string; + hours: number; + } & { + [key: string]: unknown; + }; + kidsRoom?: { + [key: string]: unknown; + } | null; + order: number; + past: boolean; + needed?: number | null; + filled?: number | null; + /** @description My place in it */ + mine: ({ + slotId: string; + checkedInAt?: string | null; + swapId?: string | null; + } & { + [key: string]: unknown; + }) | null; + coverNeeded: ({ + swapId: string; + note: string; + } & { + [key: string]: unknown; + })[]; + /** @description Staff only */ + volunteers?: ({ + slotId: string; + userId: string; + name: string; + phone?: string | null; + email?: string | null; + assignedBy?: string | null; + checkedInAt?: string | null; + checkedInBy?: string | null; + checkInMethod?: string | null; + swapOpen: boolean; + hasTicket: boolean; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + totals: { + needed?: number | null; + filled?: number | null; + /** @description % */ + fillRate?: number | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22311,6 +26493,19 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + description?: string | null; + /** @description A multi-day event: the session */ + sessionId?: string | null; + startsAt?: string | null; + /** @description Default: the event's or session's times */ + endsAt?: string | null; + /** @description How many people */ + needed?: number | string | null; + /** @description Serving in a kids room: counts as a leader on duty */ + kidsRoomId?: string | null; + order?: number | string; + } & { [key: string]: unknown; }; }; @@ -22323,7 +26518,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + name: string; + description?: string | null; + sessionId?: string | null; + startsAt?: string | null; + endsAt?: string | null; + needed?: number | null; + kidsRoomId?: string | null; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22375,6 +26583,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -22390,7 +26599,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + slotId: string; + /** @description A free volunteer ticket was issued */ + ticket: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22442,7 +26657,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22488,6 +26707,8 @@ export interface operations { requestBody: { content: { "application/json": { + note?: string | null; + } & { [key: string]: unknown; }; }; @@ -22500,7 +26721,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + swapId: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22552,7 +26777,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + cancelled: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22595,6 +26825,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -22610,7 +26841,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + slotId: string; + role: string; + event: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22653,6 +26890,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description What the QR code holds */ + qr: string; + } & { [key: string]: unknown; }; }; @@ -22665,7 +26905,23 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + id: string; + title: string; + } & { + [key: string]: unknown; + }; + checkedIn: ({ + role: string; + kidsRoom?: string | null; + } & { + [key: string]: unknown; + })[]; + already: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22692,6 +26948,7 @@ export interface operations { getVolunteeringEvents: { parameters: { query?: { + /** @description `true`/`1`: include everything, not just the current ones */ all?: string; }; header?: never; @@ -22707,7 +26964,19 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + title: string; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + scheduleType?: string | null; + campusId?: string | null; + roles: number; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -22743,8 +27012,11 @@ export interface operations { getVolunteeringHours: { parameters: { query?: { + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; + /** @description Only this event */ eventId?: string; }; header?: never; @@ -22760,7 +27032,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + userId?: string; + name: string; + hours: number; + shifts?: number | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -22796,6 +27075,7 @@ export interface operations { getEventsIdVolunteers: { parameters: { query?: { + /** @description `1` also writes it to the access log (a list with personal details) */ log?: string; }; header?: never; @@ -22814,7 +27094,90 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + [key: string]: unknown; + }; + sessions: ({ + id: string; + label: string; + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + } & { + [key: string]: unknown; + })[]; + roles: ({ + id: string; + eventId: string; + sessionId?: string | null; + sessionLabel?: string | null; + name: string; + description: string; + startsAt?: string | null; + endsAt?: string | null; + shift: { + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + text: string; + hours: number; + } & { + [key: string]: unknown; + }; + kidsRoom?: { + [key: string]: unknown; + } | null; + order: number; + past: boolean; + needed?: number | null; + filled?: number | null; + /** @description My place in it */ + mine: ({ + slotId: string; + checkedInAt?: string | null; + swapId?: string | null; + } & { + [key: string]: unknown; + }) | null; + coverNeeded: ({ + swapId: string; + note: string; + } & { + [key: string]: unknown; + })[]; + /** @description Staff only */ + volunteers?: ({ + slotId: string; + userId: string; + name: string; + phone?: string | null; + email?: string | null; + assignedBy?: string | null; + checkedInAt?: string | null; + checkedInBy?: string | null; + checkInMethod?: string | null; + swapOpen: boolean; + hasTicket: boolean; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; + totals: { + needed?: number | null; + filled?: number | null; + /** @description % */ + fillRate?: number | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22875,7 +27238,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + token: string; + /** @description Put this in the QR code */ + qr: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22936,7 +27305,32 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + event: { + id: string; + title: string; + volunteerOptionId?: string | null; + } & { + [key: string]: unknown; + }; + options: ({ + id?: string; + eventId?: string; + name?: string; + description?: string | null; + /** @description Rand */ + price?: number; + isMainTicket?: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + })[]; + kidsRooms: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -22991,6 +27385,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description The free volunteer ticket (null: none) */ + optionId?: string | null; + } & { [key: string]: unknown; }; }; @@ -23003,7 +27400,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The saved set-up, as GET answers */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -23064,7 +27464,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description People who were in it (told by message) */ + volunteers: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23119,6 +27525,19 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string; + description?: string | null; + /** @description A multi-day event: the session */ + sessionId?: string | null; + startsAt?: string | null; + /** @description Default: the event's or session's times */ + endsAt?: string | null; + /** @description How many people */ + needed?: number | string | null; + /** @description Serving in a kids room: counts as a leader on duty */ + kidsRoomId?: string | null; + order?: number | string; + } & { [key: string]: unknown; }; }; @@ -23131,7 +27550,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + eventId: string; + name: string; + description?: string | null; + sessionId?: string | null; + startsAt?: string | null; + endsAt?: string | null; + needed?: number | null; + kidsRoomId?: string | null; + order: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23186,6 +27618,8 @@ export interface operations { requestBody: { content: { "application/json": { + userId: string; + } & { [key: string]: unknown; }; }; @@ -23198,7 +27632,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + slotId: string; + /** @description A free volunteer ticket was issued */ + ticket: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23253,6 +27693,8 @@ export interface operations { requestBody: { content: { "application/json": { + undo?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -23265,7 +27707,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + slotId: string; + changed: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23317,6 +27764,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -23332,7 +27780,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23384,6 +27836,8 @@ export interface operations { requestBody: { content: { "application/json": { + challengeId: string; + } & { [key: string]: unknown; }; }; @@ -23396,7 +27850,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + challengeId: string; + /** @enum {string} */ + method: "email" | "whatsapp"; + /** @description Where the code went, partly hidden */ + destination: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23435,7 +27897,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23460,6 +27926,10 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description From the link */ + token: string; + password: string; + } & { [key: string]: unknown; }; }; @@ -23472,7 +27942,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23497,6 +27971,12 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description From the link */ + token: string; + /** @description At least 8 characters */ + password: string; + acceptTerms?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -23509,7 +27989,17 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message?: string | null; + id: string; + name: string; + email: string; + role: string; + /** @description A new sign-in token */ + token: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23531,6 +28021,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -23546,7 +28037,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description A new token for this device (the old one stops working) */ + token: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23580,6 +28077,10 @@ export interface operations { requestBody: { content: { "application/json": { + password: string; + /** @description Also ask for my personal information to be deleted */ + deleteData?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -23592,7 +28093,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23632,7 +28137,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description login, password_changed, two_factor_enabled… */ + type: string; + device?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -23657,6 +28171,8 @@ export interface operations { requestBody: { content: { "application/json": { + password: string; + } & { [key: string]: unknown; }; }; @@ -23669,7 +28185,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + ok: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23703,6 +28224,10 @@ export interface operations { requestBody: { content: { "application/json": { + /** @enum {string} */ + method: "email" | "whatsapp"; + password: string; + } & { [key: string]: unknown; }; }; @@ -23715,7 +28240,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + challengeId: string; + /** @enum {string} */ + method: "email" | "whatsapp"; + /** @description Where the code went, partly hidden */ + destination: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23749,6 +28282,9 @@ export interface operations { requestBody: { content: { "application/json": { + challengeId: string; + code: string; + } & { [key: string]: unknown; }; }; @@ -23761,7 +28297,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + twoFactorEnabled: true; + twoFactorMethod: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23795,6 +28337,8 @@ export interface operations { requestBody: { content: { "application/json": { + password: string; + } & { [key: string]: unknown; }; }; @@ -23807,7 +28351,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + twoFactorEnabled: false; + twoFactorMethod: null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23834,8 +28384,11 @@ export interface operations { getUsersExists: { parameters: { query?: { + /** @description An email address */ email?: string; + /** @description A phone number */ phone?: string; + /** @description A phone number */ phoneNumber?: string; }; header?: never; @@ -23851,7 +28404,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + exists: boolean; + hasEmail?: boolean | null; + hasPhone?: boolean | null; + user?: ({ + id: string; + name: string; + email?: string | null; + phoneNumber?: string | null; + notificationPreference?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23887,11 +28455,17 @@ export interface operations { getUsers: { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Text to search for */ search?: string; + /** @description admin, supervisor, staff or user */ role?: string; + /** @description `true` or `false` */ isActive?: string; + /** @description Campus id or slug (`all` for every campus) */ campus?: string; }; header?: never; @@ -23907,7 +28481,28 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + data: ({ + id: string; + name: string; + email: string; + phoneNumber?: string | null; + /** @enum {string} */ + role: "admin" | "supervisor" | "staff" | "user"; + isActive?: boolean | null; + notificationPreference?: ("email" | "whatsapp" | "both") | null; + homeCampusId?: string | null; + createdAt?: string | null; + } & { + [key: string]: unknown; + })[]; + total: number; + page: number; + limit: number; + pages: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -23959,7 +28554,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + email: string; + phoneNumber?: string | null; + /** @enum {string} */ + role: "admin" | "supervisor" | "staff" | "user"; + isActive?: boolean | null; + notificationPreference?: ("email" | "whatsapp" | "both") | null; + homeCampusId?: string | null; + createdAt?: string | null; + /** @description Campuses they're limited to */ + scopedCampusIds?: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24020,7 +28630,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24075,6 +28689,21 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + email?: string | null; + phoneNumber?: string | null; + /** @description admin, supervisor, staff or user */ + role?: string | null; + isActive?: boolean | null; + /** @description Set a new password */ + password?: string | null; + /** @description email, whatsapp or both */ + notificationPreference?: string | null; + /** @description Only to turn it off */ + twoFactorEnabled?: boolean | null; + /** @description Limit staff to these campuses (empty: all) */ + scopedCampusIds?: string[]; + } & { [key: string]: unknown; }; }; @@ -24087,7 +28716,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + email: string; + phoneNumber?: string | null; + /** @enum {string} */ + role: "admin" | "supervisor" | "staff" | "user"; + isActive?: boolean | null; + notificationPreference?: ("email" | "whatsapp" | "both") | null; + homeCampusId?: string | null; + createdAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24139,6 +28781,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -24154,7 +28797,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24206,6 +28853,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -24221,7 +28869,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24266,7 +28918,9 @@ export interface operations { "getEvent-listing": { parameters: { query?: { + /** @description Campus id or slug (`all` for every campus) */ campus?: string; + /** @description Event series slug */ series?: string; }; header?: never; @@ -24282,7 +28936,38 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + title: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + eventOptions?: ({ + id: string; + eventId?: string; + name: string; + description?: string | null; + /** @description Rand */ + price: number; + isMainTicket: boolean; + stockLimit?: number | null; + } & { + [key: string]: unknown; + })[]; + isSoldOut?: boolean | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -24313,7 +28998,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + title: string; + description?: string | null; + /** @description Date and time (ISO 8601) */ + startDate: string; + /** @description Date and time (ISO 8601) */ + endDate: string; + location?: string | null; + price?: number | null; + isActive?: boolean | null; + isHidden?: boolean | null; + imageUrl?: string | null; + campusId?: string | null; + scheduleType?: ("single" | "sessions") | null; + cashupStatus?: ("open" | "closed") | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -24350,6 +29053,45 @@ export interface operations { requestBody: { content: { "application/json": { + subject?: string | null; + html?: string | null; + /** @description subject and html or text, unless template is tickets */ + text?: string | null; + /** + * @description tickets: send everyone their tickets; the reminders fill in a standard message + * @enum {string} + */ + template?: "custom" | "tickets" | "payment_reminder" | "event_reminder"; + filter?: { + /** @description any, paid, unpaid, checked_in, not_checked_in… */ + status?: string | null; + /** @description Ids */ + attendeeIds?: string[]; + /** @description Ids */ + registrationIds?: string[]; + /** @description People in one room or group */ + allocationGroupId?: string | null; + name?: string | null; + email?: string | null; + phone?: string | null; + /** + * @description Sponsors of the event instead + * @enum {string} + */ + audience?: "sponsors"; + } & { + [key: string]: unknown; + }; + /** @description Only say who it would reach */ + dryRun?: boolean | null; + /** + * @description update: about something they booked (always sent). news: needs their news consent + * @enum {string} + */ + kind?: "update" | "news"; + /** @description Promote another event (news) */ + promoEventId?: string | null; + } & { [key: string]: unknown; }; }; @@ -24362,7 +29104,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24417,6 +29174,47 @@ export interface operations { requestBody: { content: { "application/json": { + subject?: string | null; + html?: string | null; + /** @description subject and html or text, unless template is tickets */ + text?: string | null; + /** + * @description tickets: send everyone their tickets; the reminders fill in a standard message + * @enum {string} + */ + template?: "custom" | "tickets" | "payment_reminder" | "event_reminder"; + filter?: { + /** @description any, paid, unpaid, checked_in, not_checked_in… */ + status?: string | null; + /** @description Ids */ + attendeeIds?: string[]; + /** @description Ids */ + registrationIds?: string[]; + /** @description People in one room or group */ + allocationGroupId?: string | null; + name?: string | null; + email?: string | null; + phone?: string | null; + /** + * @description Sponsors of the event instead + * @enum {string} + */ + audience?: "sponsors"; + } & { + [key: string]: unknown; + }; + /** @description Only say who it would reach */ + dryRun?: boolean | null; + /** + * @description update: about something they booked (always sent). news: needs their news consent + * @enum {string} + */ + kind?: "update" | "news"; + /** @description Promote another event (news) */ + promoEventId?: string | null; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + } & { [key: string]: unknown; }; }; @@ -24429,7 +29227,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + job: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24484,6 +29289,38 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Required unless template is tickets */ + message?: string | null; + /** @enum {string} */ + template?: "custom" | "tickets" | "payment_reminder" | "event_reminder"; + filter?: { + /** @description any, paid, unpaid, checked_in, not_checked_in… */ + status?: string | null; + /** @description Ids */ + attendeeIds?: string[]; + /** @description Ids */ + registrationIds?: string[]; + /** @description People in one room or group */ + allocationGroupId?: string | null; + name?: string | null; + email?: string | null; + phone?: string | null; + /** + * @description Sponsors of the event instead + * @enum {string} + */ + audience?: "sponsors"; + } & { + [key: string]: unknown; + }; + dryRun?: boolean | null; + /** + * @description update: about something they booked (always sent). news: needs their news consent + * @enum {string} + */ + kind?: "update" | "news"; + promoEventId?: string | null; + } & { [key: string]: unknown; }; }; @@ -24496,7 +29333,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24551,6 +29403,40 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Required unless template is tickets */ + message?: string | null; + /** @enum {string} */ + template?: "custom" | "tickets" | "payment_reminder" | "event_reminder"; + filter?: { + /** @description any, paid, unpaid, checked_in, not_checked_in… */ + status?: string | null; + /** @description Ids */ + attendeeIds?: string[]; + /** @description Ids */ + registrationIds?: string[]; + /** @description People in one room or group */ + allocationGroupId?: string | null; + name?: string | null; + email?: string | null; + phone?: string | null; + /** + * @description Sponsors of the event instead + * @enum {string} + */ + audience?: "sponsors"; + } & { + [key: string]: unknown; + }; + dryRun?: boolean | null; + /** + * @description update: about something they booked (always sent). news: needs their news consent + * @enum {string} + */ + kind?: "update" | "news"; + promoEventId?: string | null; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + } & { [key: string]: unknown; }; }; @@ -24563,7 +29449,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + job: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24615,6 +29508,18 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in addresses, separated by commas or new lines */ + emails?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + } & { [key: string]: unknown; }; }; @@ -24627,7 +29532,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + event?: { + [key: string]: unknown; + } | null; + placeholders?: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24670,6 +29594,21 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in addresses, separated by commas or new lines */ + emails?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + subject: string; + html?: string | null; + text?: string | null; + } & { [key: string]: unknown; }; }; @@ -24682,7 +29621,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24725,6 +29679,23 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in addresses, separated by commas or new lines */ + emails?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + subject: string; + html?: string | null; + text?: string | null; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + } & { [key: string]: unknown; }; }; @@ -24737,7 +29708,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + job: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24780,6 +29758,18 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in numbers, separated by commas or new lines */ + phones?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + } & { [key: string]: unknown; }; }; @@ -24792,7 +29782,26 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + event?: { + [key: string]: unknown; + } | null; + placeholders?: string[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24835,6 +29844,19 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in numbers, separated by commas or new lines */ + phones?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + message: string; + } & { [key: string]: unknown; }; }; @@ -24847,7 +29869,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + eventId?: string | null; + kind?: string | null; + matched: number; + /** @description Left out: no news consent */ + skipped?: number | null; + /** @description The first 20 */ + recipients?: { + [key: string]: unknown; + }[]; + queued?: number | null; + template?: string | null; + sent?: number | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24890,6 +29927,21 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Chosen accounts */ + userIds?: string[]; + /** @description Typed-in numbers, separated by commas or new lines */ + phones?: string | null; + /** @description Everyone registered for this event */ + eventId?: string | null; + /** + * @description Default news + * @enum {string} + */ + kind?: "update" | "news"; + message: string; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + } & { [key: string]: unknown; }; }; @@ -24902,7 +29954,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + job: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -24938,8 +29997,11 @@ export interface operations { "getScheduled-messages": { parameters: { query?: { + /** @description Only this status */ status?: string; + /** @description Only this event */ eventId?: string; + /** @description email or whatsapp */ channel?: string; }; header?: never; @@ -24955,7 +30017,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + jobs: ({ + id: string; + /** @description broadcast or attendees */ + kind: string; + eventId?: string | null; + broadcast: boolean; + channel: ("email" | "whatsapp") | string; + recipient?: string | null; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description queued, sent, failed, cancelled */ + status: string; + attempts: number; + sentAt?: string | null; + lastError?: string | null; + subject: string; + html: string; + text: string; + message: string; + hasHtml: boolean; + hasText: boolean; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25007,7 +30098,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25062,6 +30157,13 @@ export interface operations { requestBody: { content: { "application/json": { + scheduledAt?: string | null; + subject?: string | null; + html?: string | null; + text?: string | null; + /** @description WhatsApp */ + message?: string | null; + } & { [key: string]: unknown; }; }; @@ -25074,7 +30176,37 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + job: { + id: string; + /** @description broadcast or attendees */ + kind: string; + eventId?: string | null; + broadcast: boolean; + channel: ("email" | "whatsapp") | string; + recipient?: string | null; + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description queued, sent, failed, cancelled */ + status: string; + attempts: number; + sentAt?: string | null; + lastError?: string | null; + subject: string; + html: string; + text: string; + message: string; + hasHtml: boolean; + hasText: boolean; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25127,6 +30259,18 @@ export interface operations { content: { "application/json": { eventId: string; + jobs: ({ + /** @description Date and time (ISO 8601) */ + scheduledAt: string; + subject: string; + html?: string | null; + text?: string | null; + /** @enum {string} */ + audience?: "sponsors"; + promoEventId?: string | null; + } & { + [key: string]: unknown; + })[]; } & { [key: string]: unknown; }; @@ -25140,7 +30284,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + jobs: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25189,7 +30340,16 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + tokenMasked: string; + instanceId: string; + hasToken: boolean; + hasInstance: boolean; + configured: boolean; + webhookUrl?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25223,6 +30383,9 @@ export interface operations { requestBody: { content: { "application/json": { + token?: string | null; + instanceId?: string | null; + } & { [key: string]: unknown; }; }; @@ -25235,7 +30398,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25278,6 +30445,8 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + } & { [key: string]: unknown; }; }; @@ -25290,7 +30459,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Plus what the WhatsApp service answered */ + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25339,7 +30513,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Plus what the WhatsApp service answered */ + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25379,7 +30558,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's status answer */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25419,7 +30601,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's answer, with the QR code image */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25453,6 +30638,8 @@ export interface operations { requestBody: { content: { "application/json": { + phoneNumber: string; + } & { [key: string]: unknown; }; }; @@ -25465,7 +30652,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's answer */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25505,6 +30695,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -25520,7 +30711,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's answer */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25560,6 +30754,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -25575,7 +30770,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's answer */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25615,6 +30813,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -25630,7 +30829,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The WhatsApp service's answer */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -25679,7 +30881,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description info, warning, success, error */ + type: string; + liveFrom?: string | null; + liveTill?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25695,6 +30905,12 @@ export interface operations { requestBody: { content: { "application/json": { + message?: string; + /** @description info, warning, success, error */ + type?: string; + liveFrom?: string | null; + liveTill?: string | null; + } & { [key: string]: unknown; }; }; @@ -25707,7 +30923,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + /** @description info, warning, success, error */ + type: string; + liveFrom?: string | null; + liveTill?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25743,6 +30967,7 @@ export interface operations { "getSaved-filters": { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; }; header?: never; @@ -25758,7 +30983,21 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description The list page it belongs to */ + page: string; + name: string; + /** @description The filters */ + params: { + [key: string]: unknown; + }; + isDefault: boolean; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -25801,6 +31040,13 @@ export interface operations { requestBody: { content: { "application/json": { + page: string; + name: string; + params: { + [key: string]: unknown; + }; + isDefault?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -25813,7 +31059,21 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description The list page it belongs to */ + page: string; + name: string; + /** @description The filters */ + params: { + [key: string]: unknown; + }; + isDefault: boolean; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25859,6 +31119,12 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + params?: { + [key: string]: unknown; + }; + isDefault?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -25871,7 +31137,21 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + /** @description The list page it belongs to */ + page: string; + name: string; + /** @description The filters */ + params: { + [key: string]: unknown; + }; + isDefault: boolean; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25932,7 +31212,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + ok: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -25990,7 +31275,43 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Today's events with places and check-ins */ + events: ({ + id: string; + title: string; + /** @description Date and time (ISO 8601) */ + startsAt: string; + /** @description Date and time (ISO 8601) */ + endsAt: string; + sessionLabel?: string | null; + places: number; + checkedIn: number; + } & { + [key: string]: unknown; + })[]; + money?: ({ + /** @description Rand */ + today: number; + todayCount: number; + /** @description Rand */ + week: number; + } & { + [key: string]: unknown; + }) | null; + /** @description What's waiting for you */ + pending: ({ + key: string; + label: string; + count: number; + href: string; + tone?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26017,6 +31338,7 @@ export interface operations { getDashboardSearch: { parameters: { query?: { + /** @description Text to search for */ q?: string; }; header?: never; @@ -26032,7 +31354,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + results: ({ + /** @description event, payment, person, registration */ + type: string; + id: string; + title: string; + subtitle?: string | null; + href?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26081,7 +31416,23 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + scanStats: { + totalToday?: number; + myToday?: number; + lastHour?: number; + byStaff?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + recentScans: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26121,7 +31472,27 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + scanStats: { + totalToday?: number; + myToday?: number; + lastHour?: number; + byStaff?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + recentScans: { + [key: string]: unknown; + }[]; + paymentStats: { + [key: string]: unknown; + }; + activeEventsCount: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26161,7 +31532,27 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + scanStats: { + totalToday?: number; + myToday?: number; + lastHour?: number; + byStaff?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + recentScans: { + [key: string]: unknown; + }[]; + paymentStats: { + [key: string]: unknown; + }; + activeEventsCount: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26188,8 +31579,11 @@ export interface operations { getStatsOverview: { parameters: { query?: { + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; + /** @description Campus id or slug (`all` for every campus) */ campus?: string; }; header?: never; @@ -26205,7 +31599,59 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + funnel?: { + [key: string]: unknown; + } | null; + activeEvents: number; + registrations: { + thisMonth: number; + lastMonth: number; + pctChange?: number | null; + } & { + [key: string]: unknown; + }; + ticketsSold: { + thisMonth: number; + lastMonth: number; + pctChange?: number | null; + } & { + [key: string]: unknown; + }; + revenue: { + thisMonth: number; + lastMonth: number; + pctChange?: number | null; + } & { + [key: string]: unknown; + }; + donations: { + thisMonth: number; + lastMonth: number; + pctChange?: number | null; + } & { + [key: string]: unknown; + }; + trend: ({ + date: string; + /** @description Rand */ + revenue: number; + } & { + [key: string]: unknown; + })[]; + topEvents: ({ + eventId: string; + title: string; + /** @description Rand */ + revenue: number; + registrations: number; + ticketsSold: number; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26248,6 +31694,14 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description The browser's analytics id */ + sessionId: string; + eventId: string; + /** @enum {string} */ + stage: "view" | "start" | "submit" | "paid"; + /** @description Where they came from */ + source?: string | null; + } & { [key: string]: unknown; }; }; @@ -26260,7 +31714,8 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Always 204, no content */ + data: null; }; }; }; @@ -26278,8 +31733,13 @@ export interface operations { getAnalyticsFunnel: { parameters: { query?: { + /** @description These events (comma-separated ids) */ + eventIds?: string; + /** @description Only this event */ eventId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; }; header?: never; @@ -26295,7 +31755,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Counts per stage (view, start, submit, paid), sources and devices, and per ticket */ + data: { + /** @description The same for each event */ + perEvent: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26338,6 +31806,40 @@ export interface operations { requestBody: { content: { "application/json": { + title: string; + subtitle?: string | null; + /** @enum {string} */ + kind: "table" | "layered"; + /** @description kind table */ + table?: { + columns: string[]; + rows: unknown[][]; + } & { + [key: string]: unknown; + }; + /** @description kind layered: titled sections, each with its rows */ + layered?: { + header?: string | null; + sections: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + /** @enum {string} */ + orientation?: "portrait" | "landscape"; + /** @description Figures shown above the table */ + stats?: { + [key: string]: unknown; + }[]; + chart?: { + [key: string]: unknown; + }; + note?: string | null; + extraTables?: { + [key: string]: unknown; + }[]; + } & { [key: string]: unknown; }; }; @@ -26382,6 +31884,40 @@ export interface operations { requestBody: { content: { "application/json": { + title: string; + subtitle?: string | null; + /** @enum {string} */ + kind: "table" | "layered"; + /** @description kind table */ + table?: { + columns: string[]; + rows: unknown[][]; + } & { + [key: string]: unknown; + }; + /** @description kind layered: titled sections, each with its rows */ + layered?: { + header?: string | null; + sections: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + /** @enum {string} */ + orientation?: "portrait" | "landscape"; + /** @description Figures shown above the table */ + stats?: { + [key: string]: unknown; + }[]; + chart?: { + [key: string]: unknown; + }; + note?: string | null; + extraTables?: { + [key: string]: unknown; + }[]; + } & { [key: string]: unknown; }; }; @@ -26426,6 +31962,43 @@ export interface operations { requestBody: { content: { "application/json": { + title: string; + subtitle?: string | null; + /** @enum {string} */ + kind: "table" | "layered"; + /** @description kind table */ + table?: { + columns: string[]; + rows: unknown[][]; + } & { + [key: string]: unknown; + }; + /** @description kind layered: titled sections, each with its rows */ + layered?: { + header?: string | null; + sections: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + /** @enum {string} */ + orientation?: "portrait" | "landscape"; + /** @description Figures shown above the table */ + stats?: { + [key: string]: unknown; + }[]; + chart?: { + [key: string]: unknown; + }; + note?: string | null; + extraTables?: { + [key: string]: unknown; + }[]; + subject?: string | null; + /** @description Text of the email */ + body?: string | null; + } & { [key: string]: unknown; }; }; @@ -26438,7 +32011,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26472,6 +32049,41 @@ export interface operations { requestBody: { content: { "application/json": { + title: string; + subtitle?: string | null; + /** @enum {string} */ + kind: "table" | "layered"; + /** @description kind table */ + table?: { + columns: string[]; + rows: unknown[][]; + } & { + [key: string]: unknown; + }; + /** @description kind layered: titled sections, each with its rows */ + layered?: { + header?: string | null; + sections: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; + /** @enum {string} */ + orientation?: "portrait" | "landscape"; + /** @description Figures shown above the table */ + stats?: { + [key: string]: unknown; + }[]; + chart?: { + [key: string]: unknown; + }; + note?: string | null; + extraTables?: { + [key: string]: unknown; + }[]; + caption?: string | null; + } & { [key: string]: unknown; }; }; @@ -26484,7 +32096,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26524,7 +32140,42 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + news: { + email: boolean; + whatsapp: boolean; + } & { + [key: string]: unknown; + }; + newsAskedAt?: string | null; + canWhatsApp: boolean; + notificationPreference?: string | null; + /** @description Every change to my news consent */ + history: { + [key: string]: unknown; + }[]; + requests: ({ + id: string; + /** @enum {string} */ + type: "access" | "correction" | "deletion"; + /** @enum {string} */ + status: "open" | "completed" | "rejected" | "cancelled"; + userId?: string | null; + name?: string; + email?: string; + details?: string | null; + response?: string | null; + /** @description 30 days after it was made */ + dueAt?: string | null; + closedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26549,6 +32200,11 @@ export interface operations { requestBody: { content: { "application/json": { + email?: boolean | null; + whatsapp?: boolean | null; + /** @description Where it was changed, for the consent log */ + source?: string | null; + } & { [key: string]: unknown; }; }; @@ -26561,7 +32217,17 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + news: { + email: boolean; + whatsapp: boolean; + } & { + [key: string]: unknown; + }; + newsAskedAt?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26588,6 +32254,7 @@ export interface operations { getMePrivacyExport: { parameters: { query?: { + /** @description File type, e.g. `pdf` or `xlsx` */ format?: string; }; header?: never; @@ -26635,6 +32302,13 @@ export interface operations { requestBody: { content: { "application/json": { + /** @enum {string} */ + type: "correction" | "deletion"; + /** @description A correction: what to change */ + details?: string | null; + /** @description A deletion: closes the account too */ + password?: string | null; + } & { [key: string]: unknown; }; }; @@ -26647,7 +32321,30 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + request: { + id: string; + /** @enum {string} */ + type: "access" | "correction" | "deletion"; + /** @enum {string} */ + status: "open" | "completed" | "rejected" | "cancelled"; + userId?: string | null; + name?: string; + email?: string; + details?: string | null; + response?: string | null; + /** @description 30 days after it was made */ + dueAt?: string | null; + closedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + }; + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26678,6 +32375,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -26693,7 +32391,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description The version accepted */ + version: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26720,6 +32423,7 @@ export interface operations { getPrivacyNotice: { parameters: { query?: { + /** @description A version number (default: the current one) */ version?: string; }; header?: never; @@ -26735,7 +32439,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description 0: the built-in text */ + version: number; + builtIn?: boolean | null; + current?: boolean | null; + publishedAt?: string | null; + effectiveDate?: string | null; + changeSummary?: string | null; + /** @description Rendered sections */ + sections: { + [key: string]: unknown; + }[]; + /** @description Every published version */ + versions: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26755,6 +32477,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -26768,7 +32491,23 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @enum {string} */ + kind: "account" | "address"; + /** @description Partly hidden */ + email?: string | null; + hasPhone?: boolean | null; + news?: { + email: boolean; + whatsapp: boolean; + } & { + [key: string]: unknown; + }; + /** @description kind address: the email or phone, partly hidden */ + address?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26797,6 +32536,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The token from the link (it is the credential) */ token: string; }; cookie?: never; @@ -26804,6 +32544,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Default: the link's channel */ + channels?: ("email" | "whatsapp")[]; + } & { [key: string]: unknown; }; }; @@ -26816,7 +32559,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26843,9 +32590,13 @@ export interface operations { getPrivacyRequests: { parameters: { query?: { + /** @description Only this status */ status?: string; + /** @description Text to search for */ search?: string; + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; }; header?: never; @@ -26861,7 +32612,39 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + requests: ({ + id: string; + /** @enum {string} */ + type: "access" | "correction" | "deletion"; + /** @enum {string} */ + status: "open" | "completed" | "rejected" | "cancelled"; + userId?: string | null; + name?: string; + email?: string; + details?: string | null; + response?: string | null; + /** @description 30 days after it was made */ + dueAt?: string | null; + closedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + overdue?: boolean | null; + /** @description Upcoming registrations that stop a deletion */ + blockers?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + })[]; + openCount: number; + total: number; + page: number; + limit: number; + pages: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26907,6 +32690,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Emailed to them; needed for a correction */ + response?: string | null; + } & { [key: string]: unknown; }; }; @@ -26919,7 +32705,33 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + request: { + id: string; + /** @enum {string} */ + type: "access" | "correction" | "deletion"; + /** @enum {string} */ + status: "open" | "completed" | "rejected" | "cancelled"; + userId?: string | null; + name?: string; + email?: string; + details?: string | null; + response?: string | null; + /** @description 30 days after it was made */ + dueAt?: string | null; + closedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + }; + /** @description A deletion: what was removed */ + anonymised?: { + [key: string]: unknown; + } | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -26974,6 +32786,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description The reason, emailed to them */ + response: string; + /** @description They withdrew it */ + cancelled?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -26986,7 +32803,29 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + request: { + id: string; + /** @enum {string} */ + type: "access" | "correction" | "deletion"; + /** @enum {string} */ + status: "open" | "completed" | "rejected" | "cancelled"; + userId?: string | null; + name?: string; + email?: string; + details?: string | null; + response?: string | null; + /** @description 30 days after it was made */ + dueAt?: string | null; + closedAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27044,7 +32883,41 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + sections: ({ + key?: string; + title: string; + /** @description Text; {placeholders} are filled in */ + body: string; + } & { + [key: string]: unknown; + })[]; + isDraft?: boolean | null; + /** @description The sections with placeholders filled in */ + rendered: { + [key: string]: unknown; + }[]; + /** @description The placeholders the text can use */ + placeholders: string[]; + /** @description Published versions */ + versions: { + [key: string]: unknown; + }[]; + builtIn: ({ + key?: string; + title: string; + /** @description Text; {placeholders} are filled in */ + body: string; + } & { + [key: string]: unknown; + })[]; + /** @description Changes to the built-in text not reviewed yet */ + builtInUpdates: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27078,6 +32951,15 @@ export interface operations { requestBody: { content: { "application/json": { + sections: ({ + key?: string; + title: string; + /** @description Text; {placeholders} are filled in */ + body: string; + } & { + [key: string]: unknown; + })[]; + } & { [key: string]: unknown; }; }; @@ -27090,7 +32972,25 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + sections: ({ + key?: string; + title: string; + /** @description Text; {placeholders} are filled in */ + body: string; + } & { + [key: string]: unknown; + })[]; + rendered: { + [key: string]: unknown; + }[]; + /** @constant */ + isDraft: true; + /** @description Date and time (ISO 8601) */ + savedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27139,7 +33039,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27173,6 +33077,18 @@ export interface operations { requestBody: { content: { "application/json": { + sections?: ({ + key?: string; + title: string; + /** @description Text; {placeholders} are filled in */ + body: string; + } & { + [key: string]: unknown; + })[]; + /** @description Shown to people asked to accept it */ + changeSummary: string; + requiresAcceptance?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -27185,7 +33101,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + version: number; + /** @description Date and time (ISO 8601) */ + publishedAt: string; + requiresAcceptance: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27225,6 +33148,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -27240,7 +33164,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + builtInUpdates: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27289,7 +33219,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + name: string; + /** @description What they do for the church */ + purpose: string; + dataShared?: string | null; + /** @description Country the data is kept in */ + location?: string | null; + website?: string | null; + active: boolean; + order: number; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -27323,6 +33270,16 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + /** @description What they do for the church */ + purpose: string; + dataShared?: string | null; + /** @description Country the data is kept in */ + location?: string | null; + website?: string | null; + active?: boolean | null; + order?: number | null; + } & { [key: string]: unknown; }; }; @@ -27335,7 +33292,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + name: string; + /** @description What they do for the church */ + purpose: string; + dataShared?: string | null; + /** @description Country the data is kept in */ + location?: string | null; + website?: string | null; + active: boolean; + order: number; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27381,6 +33355,16 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string; + /** @description What they do for the church */ + purpose?: string; + dataShared?: string | null; + /** @description Country the data is kept in */ + location?: string | null; + website?: string | null; + active?: boolean | null; + order?: number | null; + } & { [key: string]: unknown; }; }; @@ -27393,7 +33377,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + name: string; + /** @description What they do for the church */ + purpose: string; + dataShared?: string | null; + /** @description Country the data is kept in */ + location?: string | null; + website?: string | null; + active: boolean; + order: number; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27454,7 +33455,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27499,8 +33504,11 @@ export interface operations { "getPrivacyConsent-log": { parameters: { query?: { + /** @description Which kind */ type?: string; + /** @description Page number, from 1 */ page?: string; + /** @description Text to search for */ q?: string; }; header?: never; @@ -27516,7 +33524,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description `type` news: email, channel, granted, source, ip; notice: email, version, source, ip; parental: child, event, status, signedName */ + data: { + total: number; + pageSize: number; + rows: ({ + id: string; + at?: string | null; + name?: string | null; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27552,11 +33573,17 @@ export interface operations { "getPrivacyAccess-log": { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description Only this action */ action?: string; + /** @description `true`: only access to sensitive information */ sensitive?: string; + /** @description Only things this person did */ actorId?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; }; header?: never; @@ -27572,7 +33599,34 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + total: number; + pageSize: number; + rows: ({ + id: string; + /** @description Date and time (ISO 8601) */ + at: string; + actor: string; + actorRole?: string | null; + action: string; + what?: string | null; + records?: number | null; + eventId?: string | null; + ip?: string | null; + sensitive: boolean; + } & { + [key: string]: unknown; + })[]; + actions: string[]; + actors: ({ + id: string; + name: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27621,7 +33675,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description % */ + score: number; + passed: number; + total: number; + checks: ({ + key: string; + label: string; + ok: boolean; + detail?: string | null; + href?: string | null; + applies: boolean; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27661,7 +33732,31 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Per kind of information: how long it is kept */ + policies: { + [key: string]: unknown; + }; + definitions: { + [key: string]: unknown; + }; + /** @description What the rules would remove now */ + preview: { + [key: string]: unknown; + }; + lastRun?: { + [key: string]: unknown; + } | null; + related: { + medicalDays: number; + backupCount: number; + analyticsDays: number; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27695,6 +33790,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Per kind of information: { enabled, months } */ + policies: { + [key: string]: unknown; + }; + } & { [key: string]: unknown; }; }; @@ -27707,7 +33807,31 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Per kind of information: how long it is kept */ + policies: { + [key: string]: unknown; + }; + definitions: { + [key: string]: unknown; + }; + /** @description What the rules would remove now */ + preview: { + [key: string]: unknown; + }; + lastRun?: { + [key: string]: unknown; + } | null; + related: { + medicalDays: number; + backupCount: number; + analyticsDays: number; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27747,6 +33871,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -27762,7 +33887,39 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description What was removed or anonymised */ + result: { + [key: string]: unknown; + }; + state: { + /** @description Per kind of information: how long it is kept */ + policies: { + [key: string]: unknown; + }; + definitions: { + [key: string]: unknown; + }; + /** @description What the rules would remove now */ + preview: { + [key: string]: unknown; + }; + lastRun?: { + [key: string]: unknown; + } | null; + related: { + medicalDays: number; + backupCount: number; + analyticsDays: number; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27811,7 +33968,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + title: string; + description: string; + dataAffected: string; + peopleAffected?: number | string | null; + whoAffected?: string | null; + consequences?: string | null; + actionsTaken?: string | null; + adviceToPeople?: string | null; + causedBy?: string | null; + status: string; + /** @description Date and time (ISO 8601) */ + discoveredAt: string; + occurredAt?: string | null; + /** @description When the Information Regulator was told */ + regulatorNotifiedAt?: string | null; + peopleNotifiedAt?: string | null; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + createdBy?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -27845,6 +34031,24 @@ export interface operations { requestBody: { content: { "application/json": { + title: string; + description: string; + dataAffected: string; + peopleAffected?: number | string | null; + whoAffected?: string | null; + consequences?: string | null; + actionsTaken?: string | null; + adviceToPeople?: string | null; + causedBy?: string | null; + /** @description open or closed */ + status?: string | null; + /** @description Date and time (ISO 8601) */ + discoveredAt: string; + occurredAt?: string | null; + /** @description When the Information Regulator was told */ + regulatorNotifiedAt?: string | null; + peopleNotifiedAt?: string | null; + } & { [key: string]: unknown; }; }; @@ -27857,7 +34061,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + title: string; + description: string; + dataAffected: string; + peopleAffected?: number | string | null; + whoAffected?: string | null; + consequences?: string | null; + actionsTaken?: string | null; + adviceToPeople?: string | null; + causedBy?: string | null; + status: string; + /** @description Date and time (ISO 8601) */ + discoveredAt: string; + occurredAt?: string | null; + /** @description When the Information Regulator was told */ + regulatorNotifiedAt?: string | null; + peopleNotifiedAt?: string | null; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + createdBy?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27903,6 +34136,24 @@ export interface operations { requestBody: { content: { "application/json": { + title?: string; + description?: string; + dataAffected?: string; + peopleAffected?: number | string | null; + whoAffected?: string | null; + consequences?: string | null; + actionsTaken?: string | null; + adviceToPeople?: string | null; + causedBy?: string | null; + /** @description open or closed */ + status?: string | null; + /** @description Date and time (ISO 8601) */ + discoveredAt?: string; + occurredAt?: string | null; + /** @description When the Information Regulator was told */ + regulatorNotifiedAt?: string | null; + peopleNotifiedAt?: string | null; + } & { [key: string]: unknown; }; }; @@ -27915,7 +34166,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + title: string; + description: string; + dataAffected: string; + peopleAffected?: number | string | null; + whoAffected?: string | null; + consequences?: string | null; + actionsTaken?: string | null; + adviceToPeople?: string | null; + causedBy?: string | null; + status: string; + /** @description Date and time (ISO 8601) */ + discoveredAt: string; + occurredAt?: string | null; + /** @description When the Information Regulator was told */ + regulatorNotifiedAt?: string | null; + peopleNotifiedAt?: string | null; + id: string; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Date and time (ISO 8601) */ + updatedAt: string; + createdBy?: ({ + name: string; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -27960,13 +34240,21 @@ export interface operations { "getAdminAudit-log": { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Only things this person did */ actorId?: string; + /** @description Only this action */ action?: string; + /** @description admin, supervisor, staff or user */ role?: string; + /** @description On or after (ISO date or date-time) */ from?: string; + /** @description On or before (ISO date or date-time) */ to?: string; + /** @description Text to search for */ search?: string; }; header?: never; @@ -27982,7 +34270,35 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + rows: ({ + id: string; + action: string; + actorRole?: string | null; + targetType?: string | null; + targetId?: string | null; + metadata?: { + [key: string]: unknown; + } | null; + ip?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + actor?: ({ + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + } & { + [key: string]: unknown; + })[]; + total: number; + page: number; + limit: number; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28031,7 +34347,27 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description on, off or timers */ + mode: string; + timezone: string; + jobs: ({ + name: string; + label: string; + cron?: string | null; + enabled: boolean; + envFlag?: string | null; + nextRun?: string | null; + /** @description Recent runs */ + recent: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28060,10 +34396,12 @@ export interface operations { query?: never; header?: never; path: { + /** @description The name */ name: string; }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28079,7 +34417,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + queued: boolean; + id?: string | null; + /** @description When it ran straight away */ + output?: unknown; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28124,6 +34469,7 @@ export interface operations { "getAdminImpersonation-sessions": { parameters: { query?: { + /** @description How many per page */ limit?: string; }; header?: never; @@ -28139,7 +34485,37 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + reason?: string | null; + startedAt?: string | null; + endedAt?: string | null; + expiresAt?: string | null; + admin?: ({ + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + target?: ({ + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }) | null; + /** @description What they did (up to 500) */ + requests: ({ + method: string; + path: string; + blocked: boolean; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -28177,6 +34553,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The person's id */ userId: string; }; cookie?: never; @@ -28184,6 +34561,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Why — kept in the log */ + reason: string; + } & { [key: string]: unknown; }; }; @@ -28196,7 +34576,27 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description A read-only sign-in token */ + token: string; + session: { + id: string; + /** @description Date and time (ISO 8601) */ + expiresAt: string; + target: { + id: string; + name: string; + email: string; + role: string; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28254,7 +34654,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description Date and time (ISO 8601) */ + expiresAt: string; + target: { + id?: string; + name: string; + email?: string | null; + } & { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; }; }; }; @@ -28276,6 +34689,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28291,7 +34705,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28325,6 +34743,8 @@ export interface operations { requestBody: { content: { "application/json": { + path: string; + } & { [key: string]: unknown; }; }; @@ -28337,7 +34757,8 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Always 204, no content */ + data: null; }; }; }; @@ -28377,7 +34798,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Setting key → value: name, logo, colours, contact details, what's switched on */ + data: { + [key: string]: string; + }; }; }; }; @@ -28390,6 +34814,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28405,7 +34830,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28454,7 +34883,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description Setting key → value; secrets masked */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -28488,6 +34920,13 @@ export interface operations { requestBody: { content: { "application/json": { + host?: string | null; + port?: number | string; + secure?: boolean | string; + user?: string | null; + pass?: string | null; + from?: string | null; + } & { [key: string]: unknown; }; }; @@ -28500,7 +34939,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28549,7 +34992,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + needsSetup: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28565,6 +35012,11 @@ export interface operations { requestBody: { content: { "application/json": { + adminName: string; + adminEmail: string; + /** @description At least 8 characters */ + adminPassword: string; + } & { [key: string]: unknown; }; }; @@ -28577,7 +35029,13 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + token: string; + name: string; + email: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28602,6 +35060,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description Setting key → value */ + settings: { + [key: string]: unknown; + }; + } & { [key: string]: unknown; }; }; @@ -28614,7 +35077,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28663,7 +35130,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28697,6 +35208,8 @@ export interface operations { requestBody: { content: { "application/json": { + licenceKey: string; + } & { [key: string]: unknown; }; }; @@ -28709,7 +35222,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28749,6 +35306,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28764,7 +35322,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28804,6 +35406,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28819,7 +35422,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28859,6 +35506,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -28874,7 +35522,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28917,6 +35609,9 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description false: stop putting it off */ + snooze?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -28929,7 +35624,51 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description active, grace, suspended, revoked, none… */ + state: string; + readOnly: boolean; + daysLeft?: number | null; + endsAt?: string | null; + graceEndsAt?: string | null; + licence?: ({ + customer?: string | null; + plan?: string | null; + status?: string | null; + licenceExpiresAt?: string | null; + graceDays?: number | null; + issuedAt?: string | null; + validUntil?: string | null; + limits: { + [key: string]: unknown; + }; + } & { + [key: string]: unknown; + }) | null; + connected: boolean; + keyConfigured: boolean; + hubUrl?: string | null; + lastHeartbeatAt?: string | null; + lastError?: string | null; + /** @description This site's version */ + version: string; + latestVersion?: string | null; + updateAvailable: boolean; + urgentUpdate: boolean; + updateSnoozed?: boolean | null; + /** @description What's new in each version since this one */ + releases?: { + [key: string]: unknown; + }[]; + updateRequest?: { + [key: string]: unknown; + } | null; + notices?: { + [key: string]: unknown; + }[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -28978,7 +35717,18 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + /** @description info, warning, critical */ + level: string; + title: string; + message: string; + startsAt?: string | null; + endsAt?: string | null; + updatedAt?: string | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -29018,7 +35768,36 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Every event type, with an example body */ + eventTypes: { + [key: string]: unknown; + }[]; + /** @description How long deliveries are kept */ + keepDays: number; + endpoints: ({ + id: string; + name: string; + url: string; + /** @description Event types it gets */ + events: string[]; + isActive: boolean; + /** @description Its entry in the operator register */ + operatorId?: string | null; + lastSuccessAt?: string | null; + lastFailureAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description Status → deliveries in the last 7 days */ + lastWeek: { + [key: string]: number; + }; + } & { + [key: string]: unknown; + })[]; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29052,6 +35831,11 @@ export interface operations { requestBody: { content: { "application/json": { + name: string; + /** @description https:// address */ + url: string; + events: string[]; + } & { [key: string]: unknown; }; }; @@ -29064,7 +35848,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + url: string; + /** @description Event types it gets */ + events: string[]; + isActive: boolean; + /** @description Its entry in the operator register */ + operatorId?: string | null; + lastSuccessAt?: string | null; + lastFailureAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + /** @description For checking signatures — shown only now */ + secret: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29107,6 +35908,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -29122,7 +35924,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description succeeded, failed, retrying… */ + status?: string | null; + statusCode?: number | null; + error?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29183,7 +35992,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @constant */ + ok: true; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29238,6 +36052,11 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + url?: string | null; + events?: string[]; + isActive?: boolean | null; + } & { [key: string]: unknown; }; }; @@ -29250,7 +36069,22 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + id: string; + name: string; + url: string; + /** @description Event types it gets */ + events: string[]; + isActive: boolean; + /** @description Its entry in the operator register */ + operatorId?: string | null; + lastSuccessAt?: string | null; + lastFailureAt?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29302,6 +36136,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -29317,7 +36152,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description Shown only now; the old one stops working */ + secret: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29369,6 +36209,7 @@ export interface operations { }; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -29384,7 +36225,14 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + /** @description succeeded, failed, retrying… */ + status?: string | null; + statusCode?: number | null; + error?: string | null; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29429,8 +36277,14 @@ export interface operations { "getOutbound-webhooksIdDeliveries": { parameters: { query?: { + /** @description Page number, from 1 */ page?: string; + /** @description How many per page */ limit?: string; + /** @description Only this status */ + status?: string; + /** @description Older than (ISO date-time), for the next page */ + before?: string; }; header?: never; path: { @@ -29448,7 +36302,24 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + id: string; + eventId: string; + /** @description The event type */ + type: string; + payload: unknown; + /** @description pending, sending, retrying, succeeded, failed */ + status: string; + attempts: number; + nextAttemptAt?: string | null; + lastStatusCode?: number | null; + lastError?: string | null; + /** @description Date and time (ISO 8601) */ + createdAt: string; + deliveredAt?: string | null; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -29506,7 +36377,15 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: ({ + filename: string; + /** @description Bytes */ + size: number; + /** @description Date and time (ISO 8601) */ + createdAt: string; + } & { + [key: string]: unknown; + })[]; }; }; }; @@ -29537,6 +36416,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -29552,7 +36432,10 @@ export interface operations { }; content: { "application/json": { - data: unknown; + /** @description The backup made */ + data: { + [key: string]: unknown; + }; }; }; }; @@ -29590,6 +36473,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The file name */ filename: string; }; cookie?: never; @@ -29659,7 +36543,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + secretKeyMasked: string; + /** @description settings or env */ + secretKeySource?: string | null; + /** @description test or live */ + mode?: string | null; + webhookSecretMasked: string; + webhookSecretSource?: string | null; + webhookId: string; + webhookUrl: string; + configured: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29693,6 +36590,11 @@ export interface operations { requestBody: { content: { "application/json": { + /** @description sk_test_… or sk_live_… */ + secretKey?: string | null; + /** @description whsec_… */ + webhookSecret?: string | null; + } & { [key: string]: unknown; }; }; @@ -29705,7 +36607,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29754,7 +36660,21 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + webhooks: ({ + id: string; + name?: string | null; + url: string; + mode?: string | null; + isActive: boolean; + pointsHere: boolean; + } & { + [key: string]: unknown; + })[]; + defaultUrl: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29788,6 +36708,10 @@ export interface operations { requestBody: { content: { "application/json": { + name?: string | null; + /** @description Default: this site's webhook address */ + url?: string | null; + } & { [key: string]: unknown; }; }; @@ -29800,7 +36724,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + webhook: { + id: string; + name?: string | null; + url: string; + mode?: string | null; + } & { + [key: string]: unknown; + }; + webhookSecretMasked: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29838,6 +36775,7 @@ export interface operations { query?: never; header?: never; path: { + /** @description The id */ id: string; }; cookie?: never; @@ -29851,7 +36789,12 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + clearedSecret: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29909,7 +36852,20 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + merchantId: string; + merchantKey: string; + passphraseMasked: string; + hasPassphrase: boolean; + /** @enum {string} */ + mode: "sandbox" | "live"; + notifyUrl: string; + /** @description Why PayFast couldn't reach it */ + notifyUrlProblem?: string | null; + configured: boolean; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29943,6 +36899,13 @@ export interface operations { requestBody: { content: { "application/json": { + merchantId?: string | null; + merchantKey?: string | null; + /** @description At most 32 characters */ + passphrase?: string | null; + /** @enum {string} */ + mode?: "sandbox" | "live"; + } & { [key: string]: unknown; }; }; @@ -29955,7 +36918,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; @@ -29995,6 +36962,7 @@ export interface operations { path?: never; cookie?: never; }; + /** @description No body needed: send an empty object. */ requestBody: { content: { "application/json": { @@ -30010,7 +36978,11 @@ export interface operations { }; content: { "application/json": { - data: unknown; + data: { + message: string; + } & { + [key: string]: unknown; + }; }; }; }; diff --git a/apps/events/package-lock.json b/apps/events/package-lock.json index 23fb6f9..fa17352 100644 --- a/apps/events/package-lock.json +++ b/apps/events/package-lock.json @@ -1,12 +1,12 @@ { "name": "hope-events", - "version": "1.52.0", + "version": "1.52.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hope-events", - "version": "1.52.0", + "version": "1.52.1", "license": "ISC", "devDependencies": { "@axe-core/playwright": "^4.14.0", diff --git a/apps/events/package.json b/apps/events/package.json index c0d0e75..68fc075 100644 --- a/apps/events/package.json +++ b/apps/events/package.json @@ -1,6 +1,6 @@ { "name": "hope-events", - "version": "1.52.0", + "version": "1.52.1", "main": "index.js", "scripts": { "dev:backend": "cd backend && npm run dev",