Staff, supervisor and admin dashboards start with what's on today (checked in vs places, children in now, volunteers here; money in today and this week for supervisors) and, for supervisors and admins, what's waiting for someone (unpaid registrations, consent, waitlists, cover requests, roster gaps; for admins cashups, reconciling, privacy requests, failed webhooks), each linking to where it's dealt with. Ctrl+K opens a palette of pages, settings, reports and actions for the role, with search: events, payments by amount, people and registrations (admins). All campus-scoped. Bulk actions and saved filters follow as 1.49.1 and 1.49.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const { protect, staff } = require('../middleware/authMiddleware');
|
|
const { scopeList } = require('../utils/campusScope');
|
|
const dashboard = require('../utils/dashboard');
|
|
|
|
// Both follow the person's campus scope inside utils/dashboard.js.
|
|
|
|
// @desc Today's events and how they're going, money in, and what's waiting (1.49.0)
|
|
// @route GET /api/dashboard/today
|
|
// @access Private/Staff (money and waiting items for supervisors and admins)
|
|
router.get('/today', protect, staff, scopeList, async (req, res) => {
|
|
try { res.json(await dashboard.today(req)); } catch (e) { res.status(400).json({ message: e.message }); }
|
|
});
|
|
|
|
// @desc Command palette search (?q=): events; supervisors also payments by amount; admins people and registrations
|
|
// @route GET /api/dashboard/search
|
|
// @access Private/Staff
|
|
router.get('/search', protect, staff, scopeList, async (req, res) => {
|
|
try { res.json({ results: await dashboard.search(req, req.query.q) }); } catch (e) { res.status(400).json({ message: e.message }); }
|
|
});
|
|
|
|
module.exports = router;
|