diff --git a/docs/api/admin.md b/docs/api/admin.md index 445e7ce..93d388c 100644 --- a/docs/api/admin.md +++ b/docs/api/admin.md @@ -46,9 +46,11 @@ removes the row. * `logo` up to 2048 chars (a public URL — uploaded separately) * `welcomeMarkdown` up to 64 000 chars * `themeKey` is one of `THEME_IDS` -* `eventStartUtc` / `eventEndUtc` parseable dates; `superRefine` - enforces `eventEndUtc > eventStartUtc` and reports the issue on - `eventEndUtc` +* `eventStartUtc` / `eventEndUtc` are validated as ISO-8601 datetimes + (zod `string().datetime(...)`) — empty strings are explicitly allowed + to keep the event window unconfigured. `superRefine` then enforces + `eventEndUtc > eventStartUtc` and reports the issue on `eventEndUtc` + when both fields are non-empty. * `defaultChallengeIp` 1–255 chars * `registrationsEnabled` boolean diff --git a/docs/architecture/key-files.md b/docs/architecture/key-files.md index 283b5da..8f7484f 100644 --- a/docs/architecture/key-files.md +++ b/docs/architecture/key-files.md @@ -25,6 +25,7 @@ timestamp: 2026-07-22T13:40:00Z | `backend/src/modules/auth/auth.controller.ts` | Registers authentication and account endpoints. | | `backend/src/modules/auth/auth.service.ts` | Handles sessions, authentication, registration, and password changes. | | `backend/src/modules/uploads/uploads.controller.ts` | Registers admin-only multipart uploads, including Sharp-backed site-logo format validation. | +| `backend/src/modules/admin/dto/general.dto.ts` | Zod schema for `PUT /api/v1/admin/general/settings` — string-length rules, theme-key enum, ISO-8601 datetime check on the event-window fields (empty string allowed), and the `endAfterStart` super-refine. | # Frontend @@ -45,6 +46,8 @@ timestamp: 2026-07-22T13:40:00Z | `frontend/src/app/features/shell/header/shell-header.component.ts` | Shell title, status LED (size/shape only — color comes from the pure map via `[style.background-color]`), countdown, and user menu. | | `frontend/src/app/features/shell/tabs/quick-tabs.component.ts` | Main shell navigation tabs. | | `frontend/src/app/features/shell/change-password/change-password-modal.component.ts` | Change-password form modal. | +| `frontend/src/app/features/admin/general.component.ts` | `AdminGeneralComponent` reactive form for `/admin/general` — per-field inline error rendering (page-title + event-start + event-end), logo upload wiring, welcome Markdown preview, event-state derivation, and SSE `general` event handling. | +| `frontend/src/app/features/admin/general.pure.ts` | Pure helpers used by `AdminGeneralComponent` — `deriveEventState`, `endAfterStartValidator`, `normalizePageTitle`, `toIsoUtc`, `toDatetimeLocal`, `pageTitleError` / `pageTitleMessage`, `isoDatetimeValidator`, and `datetimeMessage`. | | `tests/frontend/authenticated-event-source.spec.ts` | Tests SSE authorization, frame transport behavior, and the `401`/`403` unauthorized path. | | `tests/frontend/auth-session-events.spec.ts` | Pure tests for cross-tab invalidation message encoding, payload validation, and `storage`-event filtering. | diff --git a/docs/guides/admin-general-settings.md b/docs/guides/admin-general-settings.md index d2a6ccb..39cdc30 100644 --- a/docs/guides/admin-general-settings.md +++ b/docs/guides/admin-general-settings.md @@ -2,8 +2,8 @@ type: guide title: Admin — General Settings description: How an admin edits global platform settings (page title, logo, theme, event window, default challenge IP, registrations, welcome Markdown) from the /admin/general page. -tags: [guide, admin, settings, general, tester] -timestamp: 2026-07-22T12:44:45Z +tags: [guide, admin, settings, general, tester, datetime, validation] +timestamp: 2026-07-22T14:07:58Z --- # When this view is available @@ -42,8 +42,8 @@ The page is a single reactive form with these controls (every | Logo (file picker) | `general-logo-file` | `logo` (public URL) | Uploads via `POST /api/v1/uploads/logo`; the returned `publicUrl` is bound to a hidden input `general-logo`. | | Logo upload status | `general-logo-uploading` / `general-logo-error` / `general-logo-current` | — | Inline status text under the file picker. | | Global theme | `general-themeKey` | `themeKey` | `