Managing registrations on API v2 (1.51.10)

- v2: staff list (paged), event registrations, registration in full (+ /me), status, manual
  registration, bulk, items, invoice, coupon, attendees and form links, form drafts and responses.
- src/services/registrationAdmin.ts holds the rest of registrationController.js (now v1 wrappers).
- Frontend: fetchAllRegistrations(); every registration screen on v2.
- Roadmap: money gets its own release (1.51.11); webhooks and links move to 1.51.16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
2026-10-29 13:16:59 +02:00
co-authored by Claude Opus 5.5
parent 7eb6f99e97
commit a7a9382a93
16 changed files with 119 additions and 31 deletions
@@ -1,5 +1,6 @@
// Registrations (v1). The work is in src/services: registrations.ts (making and cancelling
// one) and registrationAdmin.ts (everything after) — shared with /api/v2.
const { getClientIp } = require('../utils/requestUtils');
const { v1StatusOf } = require('../services/errors');
const registrationService = require('../services/registrations');
const admin = require('../services/registrationAdmin');
@@ -77,7 +77,7 @@ const as400 = <A extends unknown[], R>(fn: (...args: A) => Promise<R>) => async
return await fn(...args);
} catch (e: any) {
if (e instanceof ServiceError || e?.statusCode || (typeof e?.code === 'string' && /^P\d{4}$/.test(e.code))) throw e;
if (e instanceof TypeError || e instanceof ReferenceError) throw e;
if (e instanceof TypeError || e instanceof ReferenceError || e?.code === 'MODULE_NOT_FOUND') throw e;
throw new ServiceError(400, e?.message || 'Request failed.');
}
};
@@ -633,7 +633,7 @@ export const createManualRegistration = as400(async (call: Call): Promise<any> =
});
userId = created.id;
if (!skipActivationNotice) {
const { sendActivationLink } = require('./userController');
const { sendActivationLink } = require('../controllers/userController');
sendActivationLink(created);
}
}
@@ -191,9 +191,9 @@ export const manual = defineRoute({
eventId: id,
options: z.array(lineBody).min(1).max(100),
user: z.looseObject({ name: z.string().trim().min(1).max(200), email: z.string().max(200).nullish(), phoneNumber: z.string().max(40).nullish(), password: z.string().max(200).optional().describe('Self-service kiosk: the visitor sets it, and the account is active at once') }),
notificationPreference: z.enum(['email', 'whatsapp', 'both']).optional(),
notificationPreference: z.string().max(20).nullish().describe('email, whatsapp or both (anything else: worked out from the contact details given)'),
skipActivationNotice: z.boolean().optional(),
couponCode: z.string().max(40).optional(),
couponCode: z.string().max(40).nullish(),
attendees: z.array(attendeeBody).max(1000).optional(),
ticketDelivery: z.enum(['payer', 'each']).optional(),
}),