Skip to content

Admin Settings and Form Configuration Files #453

@adityapat24

Description

@adityapat24

Goal

Create the admin settings panel (date controls, show-decision toggle, form config editor) and the singleton data layer. No real logic yet, stubs only

This ticket also creates the shared (admin)/layout.tsx file that other admin tickets will rely on, plus the admin landing page.

Folders to create

  • src/app/(admin)/admin/settings/
  • src/app/api/v1/dates/registration-open/
  • src/app/api/v1/dates/registration-closed/
  • src/app/api/v1/dates/confirm-by/
  • src/app/api/v1/show-decision/
  • src/app/api/v1/admin/form-config/
  • src/lib/admin/
  • src/components/admin/

Files to create

Routes

  • src/app/(admin)/layout.tsx — admin shell (sidebar, header); placeholder admin check
  • src/app/(admin)/admin/page.tsx — admin landing, tiles linking to settings/applicants/stats
  • src/app/(admin)/admin/settings/page.tsx — date controls + show-decision toggle + form config editor
  • src/app/api/v1/dates/registration-open/route.tsGET/POST singleton
  • src/app/api/v1/dates/registration-closed/route.tsGET/POST singleton
  • src/app/api/v1/dates/confirm-by/route.tsGET/POST singleton
  • src/app/api/v1/show-decision/route.tsGET/POST singleton
  • src/app/api/v1/admin/form-config/route.tsGET/POST form configuration (questions, sections)

Library

  • src/lib/admin/singleton-keys.tsSingletonKey union ('registration-open' | 'registration-closed' | 'confirm-by' | 'show-decision')
  • src/lib/admin/singleton-service.tsgetSingleton(key), setSingleton(key, value) for singleton_data
  • src/lib/admin/form-config-service.tsgetFormConfig(), updateFormConfig() — admin-editable questions
  • src/lib/admin/types.tsSingletonValue<K>, DateSingletonValue, BooleanSingletonValue, FormConfig, FormConfigSection, FormConfigQuestion types

Components

  • src/components/admin/AdminSidebar.tsx — admin nav, used by admin layout
  • src/components/admin/DateControl.tsx — date+time picker for a singleton key, save button
  • src/components/admin/ShowDecisionToggle.tsx — boolean toggle for show-decision flag
  • src/components/admin/FormConfigEditor.tsx — list of questions, add/edit/reorder UI

Acceptance criteria

  • All folders and files listed above exist and the project compiles.
  • /admin and /admin/settings render placeholder UI.
  • All API routes return typed mocks for GET and 501 for POST.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions