Files
EpicNext-Cms/docs/superpowers/specs/2026-09-01-housekeeping-content-events-vertical-design.md
T

4.2 KiB

Housekeeping Content Events Vertical Design

Date: 2026-09-01

Status: Approved

Objective

Replace the generic ASE event command forms with a complete operator workflow for finding, creating, editing, deleting, and administering events while preserving the existing /admin/events implementation as a stable fallback.

Scope

The vertical covers these canonical routes:

  • /ase-next/content/engagement/events
  • /ase-next/content/engagement/events/create
  • /ase-next/content/engagement/events/:id
  • /ase-next/content/engagement/events/types

It includes event search and status filtering, bounded pagination, active event-type selection, prefilled create/edit forms, event status and schedule fields, prizes, winners, registrations, event-type maintenance, and reason-protected destructive actions.

Polls and prefixes remain unchanged. The existing database schema and dependencies remain unchanged.

Data Contract

Event routes expose route-specific typed private payloads through the existing ContentQueryItem.privatePayload boundary:

  • event list items carry type, schedule, capacity, and registration count;
  • event-create items carry active event-type options;
  • event-detail returns one selected event with editable fields, all event-type options, prizes, winners, and registrations;
  • event-type items carry every editable type field.

The query contract validates every route-specific payload and fails closed when a production adapter returns malformed or partial data. Event detail is always selected by the canonical route parameter; its returned ID and cardinality must match the request. Event IDs are positive decimal strings, timestamps are canonical UTC ISO values, and nested operator records follow the same identifier/date rules.

Event-create loads every active type up to an explicit 500-type safety cap instead of applying list pagination. Event detail uses fail-closed caps of 500 types, 100 prizes, 500 winners, and 1,000 registrations. The type-management route keeps normal bounded pagination.

Operator Experience

The event list provides a visible primary action, type-management link, title/type search, status filter, result totals, useful event metadata, and previous/next navigation.

Create and edit forms use real event-type options and browser-native date/time inputs. Date/time values are displayed and submitted as UTC, then normalized to canonical ISO strings. Optional fields carry explicit clear semantics: blank nullable values become null, while the event-type description can be cleared to an empty string. The detail page prepopulates all event fields and groups related operational data below the editor. Prize and winner creation bind the current event ID automatically. Registrations are read-only and display usernames and registration time.

The event-types screen supports create, prefilled update, and reason-protected delete without requiring operators to copy numeric IDs.

Event and event-type deletion use dedicated command IDs that require an audit reason and cannot be bypassed through the generic change commands. Event deletion removes registrations, prizes, and winners before the parent inside the existing mutation transaction. Event-type deletion fails with a conflict while any event still references the type. Non-destructive create and update commands keep their current confirmation behavior.

Dependency Decision

No new runtime dependency is needed. The existing React, Zod, Drizzle, and platform date/input APIs cover the workflow with a smaller security and maintenance surface; Knip remains the dependency/source audit for this vertical.

Permissions and Failure States

events.view can read the event list. events.edit is required for create, detail administration, type administration, and every mutation. Each route preserves explicit loading, forbidden, dependency-error, empty, not-found, and ready states.

Verification

The vertical is complete only when query contract tests, production adapter tests, command policy tests, component rendering tests, the Housekeeping matrix, TypeScript, Biome, Knip, and the production build all pass. The draft PR description is updated in English and Dutch after verified implementation.