feat: postponed

This commit is contained in:
2026-04-20 21:30:00 +02:00
parent d3a4554b0d
commit 130cb9186d
6 changed files with 225 additions and 17 deletions

View File

@@ -8,3 +8,10 @@ export const OPENS = "maandag 16 maart 2026 om 19:00";
// Registration opens — used for reminder scheduling windows
export const REGISTRATION_OPENS_AT = new Date("2026-03-16T19:00:00+01:00");
/**
* Set to `true` when the event has been postponed.
* Allows waitlist email subscriptions even after the original registration
* open date has passed.
*/
export const POSTPONED = true;

View File

@@ -18,7 +18,7 @@ import {
sum,
} from "drizzle-orm";
import { z } from "zod";
import { REGISTRATION_OPENS_AT } from "../constants";
import { POSTPONED, REGISTRATION_OPENS_AT } from "../constants";
import {
emailLog,
sendCancellationEmail,
@@ -902,6 +902,13 @@ export const appRouter = {
return { success: true, message: "Admin toegang goedgekeurd" };
}),
getWaitlistSubscribers: adminProcedure.handler(async () => {
return db
.select()
.from(reminder)
.orderBy(desc(reminder.createdAt));
}),
rejectAdminRequest: adminProcedure
.input(z.object({ requestId: z.string() }))
.handler(async ({ input, context }) => {
@@ -943,8 +950,9 @@ export const appRouter = {
.handler(async ({ input, context }) => {
const now = Date.now();
// Registration is already open — no point subscribing
if (now >= REGISTRATION_OPENS_AT.getTime()) {
// Registration is already open — no point subscribing, unless the event
// is postponed (in which case we collect waitlist signups instead).
if (now >= REGISTRATION_OPENS_AT.getTime() && !POSTPONED) {
return { ok: false, reason: "already_open" as const };
}