- lib/validations.ts: form field/array schemas (8 field types, duplicate-key and select-options refinements) and create/update/ status/submit/link envelope schemas; slug immutable on update - lib/forms-schema.ts: pure parseFormSchema + validateAnswers; unknown answer keys are discarded so a caller cannot inject arbitrary jsonb - lib/actions/forms.ts: create/update/setStatus/delete/list/results/ CSV export (forms.manage via user_has_permission + RLS), submitForm (service-client read+write, visibility + waiver consent enforced, schema/legal/version snapshot, IP/UA capture), and linkSubmissionsForMember (manual admin link; auto path is Phase 5) - updateForm bumps a published waiver's version on legal/schema change (non-blocking; existing submissions stay valid against their snapshot) - deleteForm refuses when submissions exist (immutable records) - types/database.ts: type user_has_permission/user_effective_roles (stale since migration 023) - __tests__/forms.test.ts (14); API_REFERENCE + HANDOFF updated 285/285 tests, build clean. No deploy.
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
/**
|
|
* Barrel re-export for server actions.
|
|
*
|
|
* Client components and pages import action functions via `@/lib/actions`.
|
|
* Each domain lives in its own file in this directory; this barrel keeps
|
|
* the import path stable as the directory grows.
|
|
*
|
|
* Do NOT add `'use server'` here. The directive lives on the domain files
|
|
* themselves; re-exports preserve the marking.
|
|
*/
|
|
|
|
export * from './tasks'
|
|
export * from './projects'
|
|
export * from './members'
|
|
export * from './contacts'
|
|
export * from './payments'
|
|
export * from './knowledge-base'
|
|
export * from './secrets'
|
|
export * from './area-leads'
|
|
export * from './settings'
|
|
export * from './imports'
|
|
|
|
// Governance kernel (Tier 1)
|
|
export * from './proposals'
|
|
export * from './incidents'
|
|
export * from './policies'
|
|
|
|
// Per-space configurable taxonomies
|
|
export * from './areas'
|
|
|
|
// Forum and polymorphic comments
|
|
export * from './forum'
|
|
|
|
// User-creatable chat channels
|
|
export * from './comms'
|
|
|
|
// Custom tiers, custom roles, multi-code invites
|
|
export * from './tiers'
|
|
export * from './roles'
|
|
export * from './invites'
|
|
|
|
// Configurable member onboarding
|
|
export * from './onboarding'
|
|
|
|
// Customizable permissions, per-item Ops ACLs, area-lead roles
|
|
export * from './permissions'
|
|
|
|
// Custom forms and waivers
|
|
export * from './forms'
|