Fix: door and manual registrations get their tickets; admin Corrections (1.52.0)
On events with a required attendee form, tickets waited for the forms, but
At the door and Manual registration never asked for them: payment was
recorded and nobody could be checked in.
- The form pops up at the door and in Manual registration; "Fill in later"
(any staff) issues the tickets once paid and sends the payer a link
(Registration.formWaivedAt, POST /api/v2/registrations/{id}/form-later).
- One form per person on picked-session bookings; a required form with no
questions no longer holds tickets back; every caller asks the ticket
generator (formsOutstanding).
- Kiosk asks for the forms the server says are missing; headings show as text.
- Admin Corrections page and /api/v2/corrections: issue missing tickets,
pay later (ticketsReleasedAt), make it free (complimentaryDiscount),
check in or undo after the event.
- Migration 20261102120000_corrections; unit and e2e tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -187,11 +187,43 @@ async function seed(url) {
|
||||
await generateTicketsForRegistration(northReg.id);
|
||||
const northTicket = await prisma.ticket.findFirst({ where: { registrationOption: { registrationId: northReg.id } } });
|
||||
|
||||
// Corrections (corrections.spec.ts): a paid camp with a required attendee form, and an event
|
||||
// that ended yesterday with someone who was never checked in. Hidden, like kids/serving.
|
||||
const formEvent = await prisma.event.create({
|
||||
data: {
|
||||
title: 'E2E Camp Weekend', description: 'A camp with a required attendee form.', startDate: at(5, 7), endDate: at(6, 15),
|
||||
price: 200, isHidden: true, createdById: users.supervisor.id,
|
||||
eventOptions: { create: [{ name: 'Camp ticket', price: 200, isMainTicket: true }] },
|
||||
form: { create: { isRequired: true, fields: { create: [
|
||||
{ type: 'paragraph', label: 'About you', order: 0 },
|
||||
{ type: 'text', label: 'Emergency contact', isRequired: true, order: 1 },
|
||||
] } } },
|
||||
},
|
||||
include: { eventOptions: true },
|
||||
});
|
||||
const pastEvent = await prisma.event.create({
|
||||
data: {
|
||||
title: 'E2E Last Sunday', description: 'It ended yesterday.', startDate: at(-1, 7), endDate: at(-1, 10),
|
||||
price: 0, isHidden: true, createdById: users.supervisor.id,
|
||||
eventOptions: { create: [{ name: 'Entry', price: 0, isMainTicket: true }] },
|
||||
},
|
||||
include: { eventOptions: true },
|
||||
});
|
||||
const latecomer = await mk('user', 'Lerato Late', 'late@e2e.test', '0820000009');
|
||||
const lateReg = await prisma.registration.create({
|
||||
data: {
|
||||
userId: latecomer.id, eventId: pastEvent.id, status: 'paid',
|
||||
registrationOptions: { create: [{ eventOptionId: pastEvent.eventOptions[0].id, quantity: 2, priceSnapshot: 0, tranches: { create: [{ quantity: 2, priceSnapshot: 0 }] } }] },
|
||||
},
|
||||
});
|
||||
await generateTicketsForRegistration(lateReg.id);
|
||||
|
||||
const out = {
|
||||
users: Object.fromEntries(Object.entries(users).map(([k, u]) => [k, { id: u.id, name: u.name, email: u.email, token: generateToken(u.id, u.role, u.tokenVersion || 0) }])),
|
||||
events: { free: free.id, paid: paid.id, course: course.id, dropIn: dropIn.id, conference: conference.id, kids: kids.id, serving: serving.id },
|
||||
events: { free: free.id, paid: paid.id, course: course.id, dropIn: dropIn.id, conference: conference.id, kids: kids.id, serving: serving.id, form: formEvent.id, past: pastEvent.id },
|
||||
campuses: { north: { id: north.id, slug: north.slug }, south: { id: south.id, slug: south.slug } },
|
||||
northTicketQr: northTicket.qrCode,
|
||||
formOptionId: formEvent.eventOptions[0].id,
|
||||
course: { sessions: course.sessions.map(s => ({ id: s.id, label: s.label })), ticketId: ticket.id, qrCode: ticket.qrCode },
|
||||
// An account that has never answered the news question (asked once after login).
|
||||
newsPromptUser: await (async () => {
|
||||
|
||||
Reference in New Issue
Block a user