Archived
New report (Reports -> Other, or "Compare" on the Event series page): each event in a series side by side, oldest first - registrations, tickets, income (dashboard definition), people checked in (average per session on multi-session events) and attendance rate, with the change from the event before. Exports like the other reports; campus-scoped staff see only their campuses' events. GET /api/series/:id/compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { listSeries, createSeries, updateSeries, deleteSeries, getSeriesBySlug, followSeries, unfollowSeries, compare } = require('../controllers/seriesController');
|
|
const { protect, admin, supervisor, optionalAuth } = require('../middleware/authMiddleware');
|
|
const { campusIndependent, scopeList } = require('../utils/campusScope');
|
|
|
|
const SPANS = campusIndependent('a series spans campuses; adding an event to one is checked on the event');
|
|
|
|
router.get('/by-slug/:slug', optionalAuth, getSeriesBySlug);
|
|
router.post('/:id/follow', protect, followSeries);
|
|
router.delete('/:id/follow', protect, unfollowSeries);
|
|
|
|
// The list filters each series' events by the person's campuses itself.
|
|
router.get('/', protect, supervisor, SPANS, listSeries);
|
|
router.post('/', protect, supervisor, SPANS, createSeries);
|
|
router.put('/:id', protect, supervisor, SPANS, updateSeries);
|
|
router.delete('/:id', protect, admin, deleteSeries);
|
|
// Year-on-year report: only the events the person may see (filtered in the controller).
|
|
router.get('/:id/compare', protect, supervisor, scopeList, compare);
|
|
|
|
module.exports = router;
|