feat: pre-registrant management and invitation system

Admin interface to review, filter, and batch-invite the 95 pre-registrants
from Baby Ghosts. Accept-invitation page pre-fills their data and collects
circle, pronouns, motivation, contribution tier, and agreement before
creating their member record.
This commit is contained in:
Jennie Robinson Faber 2026-04-06 14:46:11 +01:00
parent bab53cec9e
commit 501be10bfe
15 changed files with 1896 additions and 1 deletions

View file

@ -0,0 +1,19 @@
import PreRegistration from '../../../models/preRegistration.js'
import { connectDB } from '../../../utils/mongoose.js'
export default defineEventHandler(async (event) => {
await requireAdmin(event)
await connectDB()
const counts = await PreRegistration.aggregate([
{ $group: { _id: '$status', count: { $sum: 1 } } }
])
const stats = { total: 0, pending: 0, selected: 0, invited: 0, accepted: 0, expired: 0 }
for (const { _id, count } of counts) {
if (_id in stats) stats[_id] = count
stats.total += count
}
return stats
})