# Changelog All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] ### Added - Post-event feedback, set up in a new Feedback step in the event wizard. - Questions use the form builder. - You pick when it's sent (the default is the morning after the event) and who gets it: everyone who checked in, or everyone registered. - Each person gets a personal link by email (and WhatsApp where they use it). - Anyone who hasn't answered gets one reminder 3 days later. - Answers can be anonymous or named. - "Send now" is available, and the questions lock once people start answering. - New form field types: **Rating (1–5 stars)** and **Multiple choice**. They're used for feedback, and can also go on attendee forms (registration page, My Events, the kiosk, manual registration and Supervisor → Forms). - New report, **Feedback summary**: - response rate; - average rating per question, with star distribution; - multiple-choice and yes/no breakdowns as bar charts; - a list of text answers (with names unless the form is anonymous). - Select several events to compare their ratings (e.g. Camp 2025 vs Camp 2026). Exports to PDF and Excel like other reports. - New `/api/feedback` endpoints and a job every 15 minutes (`FEEDBACK_JOB_ENABLED=false` to turn it off). - Requires the `add_feedback_forms` database migration. ## [1.20.0] - 2026-10-19 ### Added - Sponsor a spot: a new event setting, "Allow sponsorships" (event wizard → Sponsor a spot). - It adds a "Sponsor a spot" button on the event page so people can fund a place for someone who can't afford it. - Sponsors choose one or more whole spots (at the main ticket price) or a custom amount, and pay through Yoco. Guests just give a name and email. - Sponsors can give anonymously, or add a name and a message for the organisers. - An optional goal ("12 of 20 spots sponsored") and public progress bar. - Each sponsorship is recorded as a donation tagged to the event, in that event's sponsorship pool. - Supervisors assign pool money to registrations with the existing donation assign/unassign flow, fully or partly. - Under Payments → Donations, sponsorships are labelled, there's an "Only the sponsorship pool" filter, and the sponsor's message is shown. - Who receives help is never shown to sponsors. - Sponsors get a "Thank you for sponsoring a spot" receipt. - Automations has a new "Thank Your Sponsors" email for events with sponsorships. - Email attendees can target an event's sponsors (`filter.audience: 'sponsors'`). - The Donations breakdown report has sponsorship pool columns per event: received, assigned and remaining. - New `/api/sponsorships` endpoints. - Requires the `add_sponsorships` database migration. ## [1.19.0] - 2026-10-19 ### Added - Rooms & groups (Supervisor → Rooms & groups), for camps and lockdowns: put attendees into rooms, cabins, small groups, teams or buses. - Each event can have several allocation sets (e.g. "Rooms" and "Buses"). Each set has groups with an optional capacity, an optional gender restriction and an optional leader (a staff member). - A drag-and-drop board puts people not yet placed on the left and groups, with capacity counters, on the right. Full groups and groups for the other gender won't accept a person. - Auto-allocate fills groups evenly with everyone not yet placed, respecting capacity and gender. It can keep people on the same booking together or spread them out. - Printable lists per group (with leader) and a master list. On youth events they can include medical and emergency details from consent forms; viewing those is recorded in the audit log. - "Show on tickets" prints the group on each person's ticket and shows it in My Events. - Email and WhatsApp attendees can be sent to one group ("Bus 2 leaves at 07:30"). Messages go to whoever booked for the people in it. - Group leaders see their people under Staff → My groups. Medical details are shown to supervisors only. - New event setting "Ask each person's gender" (under Named attendees). It adds a gender choice for each named person on the registration page, at the door, on the kiosk, in manual registration and in My Events, and is needed for gender-split rooms. - New `/api/allocations` endpoints. - Requires the `add_room_allocation` database migration. ## [1.18.0] - 2026-10-19 ### Added - Ticket transfer. On My Events, "Transfer" hands a ticket to someone else before the event: enter their name and email or phone. - The new holder gets the ticket by email/WhatsApp with a new QR code. If they're new, an inactive account is created and they get an activation link. - The old QR code stops working, so screenshots of it won't scan. Scanning it says who the ticket was transferred to, and offline-mode sync flags it. - For a ticket covering several people, one place is split off to the new holder. - The payer stays responsible for the registration. - Transfer rules: - Only before the event starts, and only for tickets that haven't been scanned. - It can be turned off per event (new "Ticket transfer" setting in the event wizard, on by default). Supervisors can always transfer, from At the door → Tickets. - On youth events, the new holder's date of birth, and a parent's details for a minor, are needed, and a new consent request is sent. - The previous holder's attendee form answers and consent medical details are removed. - Every transfer is recorded in the audit log. - New endpoints `POST /api/tickets/:id/transfer` and `GET /api/tickets/:id/transfers`. - Requires the `add_ticket_transfer` database migration. ## [1.17.0] - 2026-10-19 ### Added - Offline ticket scanning. While online, staff pick an event and section on the scanner and tap "Enable offline mode". The section (or the whole event) is locked to their device and its tickets are downloaded to the device. - With no connection, scans are checked against that list and queued on the device. - The panel shows when the list was downloaded and how many scans are waiting. - Queued scans sync automatically when the device is back online (or with "Sync now"), and check-in messages go out then. - "Release section" ends offline mode and deletes the list from the device. - Only one device can hold a section at a time (a whole-event lock clashes with every section). While a section is locked, other devices see who holds it and can't scan it, online or offline, so a ticket can never be redeemed twice by two offline devices. - Syncing is idempotent and never redeems more than is left on a ticket. Anything that needs a person to look goes into a sync report: tickets not found, cancelled registrations, used-up tickets, scans outside the locked section, and check-ins without consent. - Supervisor → Offline scanning page: active locks with force release (for a lost or flat phone; its scans still sync if it reconnects, and are flagged), and sync reports to review. Locks, releases, force-releases and syncs are recorded in the audit log. - The scanner is installable as an app (web app manifest), and a service worker caches the scanner page and its scripts so it opens with no connection. - The app now stays signed in with the last confirmed profile when it's reloaded without a connection, instead of sending the user to the login page. - New `/api/scan-locks` endpoints. - Requires the `add_offline_scanning` database migration. ### Changed - `POST /api/tickets/scan/:qrCode` now accepts `sectionId` and checks it on the server; this was previously only checked in the browser. - It now refuses (423) scans in a section that another device has locked for offline scanning. ## [1.16.0] - 2026-10-19 ### Added - Waitlist for sold-out tickets. A new event setting (event wizard → Visibility) turns it on, with how long offered places are held (24 hours by default) and whether someone can be offered fewer places than they asked for. - Sold-out tickets show "Join waitlist" on the event page, the register page and the events list. Guests can join on events that allow guest registration. - When places free up, the next person is emailed/WhatsApped a claim link, and the places are held for them so nobody else can buy them. Places free up through a cancellation (by the person or staff), a smaller booking, or a raised stock limit. - The claim link opens the register page with the places pre-selected, and works without logging in. - Unclaimed offers expire (checked every 10 minutes) and move on to the next person. - People can leave a waitlist from My Events, which now lists their waitlists and any places held for them. - Supervisor → Waitlist page: the queue per event, with offer now (even over the stock limit), move up/down and remove. - The daily summary email shows each event's waitlist count. - New `/api/waitlist` endpoints. `POST /api/registrations` accepts `waitlistToken`. - Requires the `add_waitlist` database migration. ### Fixed - Manual registrations (Manual registration, At the door, the kiosk) and adding places to an existing booking never checked stock, so either could take an option over its stock limit. Both are now checked like a normal registration. - Stock is now counted in one place (`utils/stock.js`) for registration checks, `availableCount` and `isSoldOut`, including places held for waitlist offers. ## [1.15.0] - 2026-10-19 ### Added - Parental consent for youth events. A new "Requires parental consent" event setting (event wizard → Visibility) has its own consent text and optional medical info, emergency contact and photo consent questions. It turns on named attendees automatically. - Registering then needs a name and date of birth for every main-ticket place. Anyone under 18 on the event's start date needs a parent or guardian's name, email and phone. - This applies on the registration page, manual registration, at the door, the kiosk, and when editing names in My Events. - The parent gets an email and a WhatsApp (always both) with a link to a new consent page (`/consent/`). There they read the text, answer the optional questions, type their full name and confirm they're the parent or guardian, then give or decline. - The system records the time, IP, device, signed name, and the exact consent text and version shown. - Medical and emergency details are stored encrypted. - The registrant and the event's notification recipients are told the outcome. - Tickets are still issued, but the scanner blocks check-in until consent is given, showing why. Supervisors can override, and the override is recorded in the audit log. On a youth event, a ticket with no named attendee counts as missing consent. - A daily 09:00 job reminds unanswered requests after 2 days, then every 3 days until the event. It also deletes medical and emergency details a set number of days after the event (Site Settings → Legal, default 30). `CONSENT_JOBS_ENABLED=false` turns it off. - Supervisor → Parental consent page: consent status per attendee, resend one or all pending requests, re-request consent after the consent text changes, and a printable, confidential medical & emergency list. Every view of the list is recorded in the audit log. - New reports: "Parental consent status" and "Medical & emergency list". - My Events shows each attendee's consent status, with a "Resend consent" button. - Anonymising or closing an account also clears that person's attendees' parent, date-of-birth, medical and emergency details. - New endpoints under `/api/consent`. `GET /api/tickets/scan-preview/:qrCode` now returns `consentStatus`, and `POST /api/tickets/scan/:qrCode` accepts `overrideConsent`. - Requires the `add_parental_consent` database migration. ## [1.14.0] - 2026-10-19 ### Added - Group tickets (named attendees). A new "Named attendees" event setting (event wizard → Visibility) lets someone registering several people give each main-ticket place a name, with an optional email and phone. It's offered on the registration page, Manual registration, At the door and the self-service kiosk. - Each named person gets their own single-person ticket, with their name on the ticket PDF, the scanner's confirm screen and the staff ticket list. Places left unnamed share one quantity ticket as before. - The payer chooses whether every ticket comes to them or each person gets their own by email/WhatsApp; anyone without contact details falls back to the payer. - The payer stays the account owner for billing, invoices and payments. - An attendee whose email or phone matches an existing account is linked to it (never when the email and phone belong to two different accounts). Their ticket then appears in their own My Events, marked "Booked by …", and they can open and submit their own attendee form. - My Events → registration popup has a new "People" section for adding or changing names and contact details, switching ticket delivery, and sending an attendee a link to fill in their own form (`/forms?registrationId=…&attendeeId=…`). An attendee whose ticket has been scanned can't be removed. - Attendee forms now show one block per named person, labelled with their name, and each response is saved against that attendee. - New endpoints `PUT /api/registrations/:id/attendees` and `POST /api/registrations/:id/attendees/:attendeeId/send-form-link`. `POST /api/registrations` and `/manual` accept `attendees` and `ticketDelivery`. - Requires the `add_named_attendees` database migration. ### Changed - Reducing the quantity of a main ticket removes the newest names beyond the new quantity. - Check-in confirmations for a named ticket go to that person when the registration sends each person their own tickets. - Unauthenticated guest registration now matches an existing account by phone as well as email, and is refused (409) when the email and phone belong to two different accounts, instead of silently reusing whichever account the email matched. - Free registrations now issue tickets through the same generator as paid ones, instead of a separate copy of the logic. ### Security - Registration details (`GET /api/registrations/:id`) hide attendees' email addresses and phone numbers from anyone other than the payer and staff, such as an attendee opening their form link. ## [1.13.0] - 2026-10-19 ### Added - Coupon codes. Supervisors create percentage, fixed-amount or free ("comp") codes under Supervisor → Coupon codes. - Codes can be limited to particular events, ticket options or variants, a date window, total and per-person uses (one per person by default), a minimum number of tickets, and specific people, roles (e.g. Staff and above) or an email domain. Restricted codes need a logged-in account, so they can't be shared around. - By default the better of the code and the early-bird price wins; a code can instead stack on top of early-bird pricing. - People enter codes under "Have a code?" on the registration page and in My Events (for registrations not yet paid in full). Staff can apply them in Manual registration, At the door and the self-service kiosk. - The discount is locked in when it's applied, the same way early-bird prices are. It appears as its own line on invoices, receipts, registration and payment emails, WhatsApp messages and the Yoco checkout. - Editing a registration's items recalculates percentage and free codes; fixed-amount codes keep their amount. Cancelling a registration frees the use. A free code that covers everything marks the registration paid and sends the tickets. - Use limits are enforced under a database lock, so the last available use can't be claimed twice. - Staff price: a ticket option or variant can carry a staff price (event wizard → Items & pricing) that Staff and above pay automatically when it's lower than the normal price. - New "Discounts (coupon codes)" report (Reports → Financial), showing uses and value given away per code and event. The Finance report's "What was sold" is now shown after discounts. - Coupon activity in the admin audit log: codes created, edited and turned off, and codes applied or removed by staff. - New endpoints: `POST /api/coupons/validate`, `GET|POST /api/coupons`, `GET|PUT /api/coupons/:id`, `GET /api/coupons/redemptions`, `POST|DELETE /api/registrations/:id/coupon`. `POST /api/registrations` and `/manual` accept `couponCode`. - Registration responses now include `discountTotal` and `subtotalComputed`. - Requires the `add_coupon_codes` database migration (`npm run prisma:deploy` in `backend`). ### Fixed - Yoco checkout line items priced each item at its most recent price times the whole quantity. When a line spanned several price tranches (some tickets at early-bird, some at full price), the item lines didn't match the amount charged. They now list each price actually charged. - The free-registration check on `POST /api/registrations` and `/manual` had the same fault: it used the latest price for the whole quantity instead of the real total. ## [1.12.0] - 2026-10-19 ### Added - Two-factor authentication is now required for Admin and Supervisor accounts. An admin or supervisor without it is sent a code at their next login (by email, or WhatsApp when SMTP isn't set up), and entering it turns two-factor on — the same code step as before, with a note explaining why. Trusted devices don't skip this first code. They can change whether codes come by email or WhatsApp from Profile & Security, but can no longer turn two-factor off (`POST /api/users/2fa/disable` returns 403 for them). - Existing admin and supervisor sessions without two-factor are ended on their next request (`401` with `code: "TWO_FACTOR_REQUIRED"`), and the login page explains why. Promoting a user to supervisor or admin also ends their sessions if they don't have two-factor yet, so they enrol at their next login. An admin "Reset 2FA" for a supervisor/admin now means they set it up again at their next login. - The requirement is skipped when no channel can deliver a code — no SMTP configured and no WhatsApp — so a fresh install (or the setup wizard, which also gets a short grace period) never locks the first admin out. `TWO_FACTOR_REQUIRED_ROLES=false` turns the requirement off as an emergency switch. - `FEATURES.md`, a repo-root overview of everything the platform does — roles, public site, events, registration, payments, tickets, messaging, dashboards, cashup, reports, settings, security, background jobs, and a page map. ### Changed - `info.md` (the overview for prospective churches) brought up to date with features added since it was written — donations, invoices and receipts, cashup and costs, profit reporting, audit trail, scheduled messaging, self-service kiosk, scan points, backups, branding, and privacy controls. ## [1.11.0] - 2026-10-08 ### Added - Optional two-factor authentication. Any user can turn it on from Profile & Security and choose to receive a 6-digit code by email or WhatsApp; the chosen channel is confirmed with a code before it takes effect. At login the code is asked for after the password, expires after 10 minutes and allows 5 attempts, with a "Resend code" option. If a WhatsApp code can't be sent, it falls back to the account's email address. - "Trust this device for 30 days" on the code step, so a remembered device skips the code. Trusted devices are forgotten when the password is changed or reset, when sessions are signed out everywhere, and when two-factor is turned off. - Admins can reset two-factor authentication for a user who can no longer receive codes ("Reset 2FA" on the Users page). Turning two-factor on or off shows in Account activity. - The self-service kiosk asks supervisors with two-factor on for their code at setup. Changing the event now re-confirms the password against the existing kiosk session (`POST /api/users/verify-password`) instead of logging in again. ### Changed - `POST /api/users/login` returns `{ twoFactorRequired, challengeId, method, destination }` instead of a token for accounts with two-factor on; the token is issued by the new `POST /api/users/login/2fa`. Accounts without two-factor are unaffected. Requires the `add_two_factor` database migration (`npm run prisma:deploy` in `backend`). ## [1.10.6] - 2026-10-08 ### Fixed - The frontend production build (`next build`) no longer hangs or fails when the backend isn't reachable. With no `NEXT_PUBLIC_API_URL`/`API_URL` set, the root layout fetched a relative `/api/settings` URL that never settled during prerender, so every page timed out after 60 seconds; server-side fetches now fail fast when no API base is configured. The home page and the Events page also no longer fail the build when `/api/events` can't be reached — they build with an empty list and fill in on the first revalidation. At runtime a failed fetch still errors, so the last good page keeps being served. ### Security - Updated dependencies to clear `npm audit` advisories: `express`, `multer`, `proxy-addr`, `qs` and others in the backend, `next` (15.5.27) and `sharp` (0.35.5) in the frontend, and `nodemailer` from 9 to 10 (requires Node.js 20 or newer). The root package now overrides `shell-quote` to a patched release, since every `concurrently` version pins a vulnerable one. Backend production dependencies now report no known vulnerabilities; the remaining advisories are in development tooling (`nodemon`, `jest`, `tailwindcss` 3) and have no non-breaking fix. - Dependency install scripts are now explicitly allow-listed via `allowScripts` in the backend and frontend `package.json` (Prisma, `@sentry/cli`, `unrs-resolver`), so npm no longer blocks them. ## [1.10.5] - 2026-10-01 ### Fixed - Events that have already started but not yet finished now show on the home page and the Events page. Both pages were hiding an event as soon as its start time passed; they now keep it listed until its end time, which matches what `GET /api/events` already returns. ## [1.10.4] - 2026-09-01 ### Fixed - "Add to calendar" (`GET /api/events/:id/ics`) always failed with a 400 in production: the `ics` library's `url` field requires a scheme (`https://...`), but `FRONTEND_URL`/`APP_BASE_URL` was configured without one, so `createEvent()` rejected it before generating any output. A missing scheme is now assumed to be `https://` instead of failing. ## [1.10.3] - 2026-08-28 ### Fixed - Creating an event was never recorded in the admin audit log — 1.10.0 added `event_created` as a logged action on the frontend's filter list, but the backend's `createEvent` never actually called `logAdminAction`, only `updateEvent`/`deleteEvent` did. Event creation is now logged the same way. - Staff cancelling a registration via `PUT /api/registrations/:id` (the staff status-change endpoint, separate from the owner-facing `DELETE /:id` cancel route) wasn't logged at all — only the `DELETE` path logged `registration_cancelled`. Both paths now log it, verified against all six audit categories promised in 1.10.0 (refunds, donation assign/unassign, manual registrations, staff-initiated cancellations, event create/update/delete, settings changes) with no other gaps found. - Added a "Back to dashboard" link to Admin → Audit log, matching the back-link pattern already used on the Cashup page. ## [1.10.2] - 2026-08-28 ### Fixed - Sentry wasn't instrumenting Express (`[Sentry] express is not instrumented` at startup): `express`, `cors`, and `@prisma/client` were required at the top of `backend/src/index.js` before `Sentry.init()` ran, but Sentry's auto-instrumentation patches those modules via a require hook that only works if `Sentry.init()` runs first. `Sentry.init()` now runs immediately after `dotenv.config()`, before any of the libraries it instruments are required. ## [1.10.1] - 2026-08-28 ### Security - Fixed a path-traversal vulnerability in event-image, branding (logo/favicon), and event-attachment uploads: the stored filename embedded the client-supplied `originalname` unsanitized, so a crafted filename (e.g. containing `../`) could write the uploaded file outside the intended `public/uploads` subfolder anywhere the server process could write. Uploaded files are now always saved under a server-generated random name; the original filename is preserved only as display metadata. - `express-rate-limit` was declared as a root-only dependency despite being required directly by the backend (`backend/src/index.js`) — a plain `cd backend && npm install`, as documented in the deployment guide, would not have installed it. It's now a proper `backend/package.json` dependency. - Bumped `next` (frontend) off a version affected by a critical unauthenticated RCE in the React Flight protocol (GHSA-9qr9-h5gf-34mp) and several other CVEs, and switched it from an exact pin to `^15.5.24` so future patch releases install automatically. - Bumped `multer`, `nodemailer`, `jsonwebtoken`, and `uuid` (backend) to versions fixing DoS, SMTP/CRLF-injection, HMAC-verification, and buffer-bounds advisories; added an `overrides` entry so the vulnerable `uuid` nested under `exceljs` is also patched. Ran `npm audit fix` across all three workspaces (root/backend/frontend) — 0 known vulnerabilities remain. - `jwt.verify()` now pins `algorithms: ['HS256']` explicitly rather than trusting the algorithm from the token header. - Uploaded assets served from `/uploads` now get `Content-Security-Policy: default-src 'none'; sandbox` and `X-Content-Type-Options: nosniff`, so an uploaded SVG containing a `