AI Implementation feature(859): Admin Area General Settings and Categories (#21)

This commit was merged in pull request #21.
This commit is contained in:
2026-07-22 11:45:23 +00:00
parent de527ec6d6
commit c9e8dfc611
34 changed files with 7349 additions and 62 deletions
@@ -0,0 +1,27 @@
import { z } from 'zod';
import { THEME_IDS } from '../../../common/types/theme-ids';
export const GeneralSettingsSchema = z
.object({
pageTitle: z.string().min(1).max(120),
logo: z.string().max(2048),
welcomeMarkdown: z.string().max(64_000),
themeKey: z.enum(THEME_IDS as unknown as [string, ...string[]]),
eventStartUtc: z.string(),
eventEndUtc: z.string(),
defaultChallengeIp: z.string().min(1).max(255),
registrationsEnabled: z.boolean(),
})
.superRefine((val, ctx) => {
const start = Date.parse(val.eventStartUtc);
const end = Date.parse(val.eventEndUtc);
if (Number.isFinite(start) && Number.isFinite(end) && end <= start) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ['eventEndUtc'],
message: 'eventEndUtc must be strictly after eventStartUtc',
});
}
});
export type GeneralSettingsPayload = z.infer<typeof GeneralSettingsSchema>;