Payload Data Model
Last refreshed: 2026-05-19
Registry
Payload config: src/payload.config.ts.
Anuva app collections are registered through AnuvaxCollections in src/collections/anuvax/index.ts. Upgrade-path orchestration state is not registered as Payload V1 collections; current API, CLI, and worker paths use the in-memory AnuvaRepository.
Core App Collections
workspaces: tenant boundary and ownership root.users: Better Auth user document with workspace/default brand kit fields.brand_kits: workspace brand assets and settings.media_assets: workspace media library with source context, asset query metadata, and optional video sections.voiceover_audio_assets: generated or stored voiceover audio.rag_sources,rag_chunks,rag_ingestion_jobs: RAG ingestion and retrieval data.video_use_cases,taxonomy_categories: generation taxonomy and catalog support data.presentations,presentation_scenes,presentation_compilations: Presentation Video state and snapshots.video_generation_jobs,presentation_generation_jobs: render/generation queues.ai_interactions: AI metering/audit records.sets,set_variants,bots,bot_variants: content store and virtual studio options.content_entitlements: workspace/user access grants.subscription_plans,user_subscriptions,ai_model_conversion_rates,credit_wallets,credit_transactions,credit_packs,credit_pack_purchases: billing, coins, and entitlements.zoho_billing_customers,zoho_webhook_events,billing_reconciliation_reports: Zoho integration state.notifications,audit_logs: operational records.
erDiagram
WORKSPACES ||--o{ USERS : owns
WORKSPACES ||--o{ BRAND_KITS : owns
WORKSPACES ||--o{ RAG_SOURCES : owns
RAG_SOURCES ||--o{ RAG_CHUNKS : contains
RAG_SOURCES ||--o{ RAG_INGESTION_JOBS : queues
WORKSPACES ||--o{ PRESENTATIONS : owns
PRESENTATIONS ||--o{ PRESENTATION_SCENES : contains
PRESENTATIONS ||--o{ PRESENTATION_COMPILATIONS : snapshots
PRESENTATIONS ||--o{ PRESENTATION_GENERATION_JOBS : queues
PRESENTATION_SCENES ||--o{ MEDIA_ASSETS : attaches
PRESENTATION_GENERATION_JOBS ||--o{ MEDIA_ASSETS : creates
WORKSPACES ||--o{ CREDIT_WALLETS : owns
CREDIT_WALLETS ||--o{ CREDIT_TRANSACTIONS : records
Prompt text for Presentation Video and RAG refinements is code-owned in Mastra workflow, agent, and tool helpers. Payload no longer registers an anuva_prompts collection.
Upgrade Runtime State
Upgrade runtime state for contracts, runs, artifacts, sources, quality metrics, conversation turns, and idempotency is held by src/lib/anuva/repository.ts.
flowchart LR
api["Upgrade API callers"] --> service["Anuva orchestration service"]
cli["scripts/anuva-cli.ts"] --> service
worker["scripts/anuva-worker.ts"] --> service
service --> repository["In-memory AnuvaRepository"]
repository -. future gap .-> durable["Durable repository store"]
payload["Payload app collections"] -. not used for V1 upgrade state .-> repository
A durable store for AnuvaRepository is deferred. Do not reintroduce Payload collections for this state without a new persistence design.
CMS Collections And Globals
blog: public blog content.payload-uploads: public CMS upload collection.private-uploads: private upload collection.- Globals:
global-footer,global-terms,global-privacy.
Schema Ownership
Collection schema changes usually affect:
src/collections/**src/payload.config.tssrc/payload-types.tssrc/app/(payload)/admin/importMap.jswhen admin components change- tests and docs that depend on collection shapes
Schema Change Checklist
- Update collection schema.
- Preserve workspace relationship and access-control behavior.
- Regenerate types with
pnpm generate:types. - Regenerate import map with
pnpm generate:importmapif admin components changed. - Run
pnpm typecheckand targeted tests. - Update
docs/coreordocs/stateif behavior or map changed.