From a924d90de57f80be1b9535c8277d8355f00dd353 Mon Sep 17 00:00:00 2001 From: cawcenter Date: Sat, 13 Dec 2025 22:00:00 -0500 Subject: [PATCH] feat: consolidate schema and fix frontend type errors --- SCHEMA_REFERENCE.md | 274 ++++++ complete-schema-setup.sh | 101 +++ frontend/src/types/schema.ts | 131 ++- unified_schema.json | 1525 ++++++++++++++++++++++++++++++++++ 4 files changed, 2025 insertions(+), 6 deletions(-) create mode 100644 SCHEMA_REFERENCE.md create mode 100755 complete-schema-setup.sh create mode 100644 unified_schema.json diff --git a/SCHEMA_REFERENCE.md b/SCHEMA_REFERENCE.md new file mode 100644 index 0000000..eb247f3 --- /dev/null +++ b/SCHEMA_REFERENCE.md @@ -0,0 +1,274 @@ +# Spark Platform - Database Schema Reference + +This document serves as the **Single Source of Truth** for the Spark Platform database schema. It consolidates all core systems, engines, and analytics modules. + +## 1. Core System + +### `sites` +Managed WordPress instances. +- **id** (UUID): Primary Key +- **name** (String): Site Name +- **url** (String): Full URL (e.g., https://example.com) +- **wp_username** (String): Admin username +- **wp_app_password** (String): Application Password +- **domain_age_years** (Integer): Age of domain for velocity calculation +- **status** (String): `active` | `paused` | `archived` +- **created_at** (Timestamp) +- **updated_at** (Timestamp) + +### `globals` +Site-wide settings and branding. +- **id** (UUID): Primary Key +- **site** (M2O -> sites): Owner site +- **site_name** (String) +- **site_tagline** (String) +- **logo** (Image) +- **favicon** (Image) +- **primary_color** (String) +- **secondary_color** (String) +- **footer_text** (Text) +- **social_links** (JSON) +- **scripts_head** (Text) +- **scripts_body** (Text) + +### `navigation` +Site menus. +- **id** (UUID) +- **site** (M2O -> sites) +- **label** (String) +- **url** (String) +- **target** (String): `_self` | `_blank` +- **parent** (M2O -> navigation): For nested menus +- **sort** (Integer) + +--- + +## 2. Content Factory (SEO Engine) + +### `campaign_masters` +Controls content generation campaigns. +- **id** (UUID) +- **site_id** (M2O -> sites) +- **name** (String) +- **headline_spintax_root** (Text): Root spintax for titles +- **niche_variables** (JSON): Key/Value pairs for replacement +- **location_mode** (String): `none` | `state` | `county` | `city` +- **location_target** (String) +- **batch_count** (Integer) +- **target_word_count** (Integer): Default 1500 +- **velocity_mode** (String): `RAMP_UP` | `CONSISTENT` +- **backdate_start** (Date) +- **backdate_end** (Date) +- **status** (String): `active` | `paused` | `completed` + +### `generated_articles` +The central content unit (replaces/aliases `posts` for SEO). +- **id** (UUID) +- **site_id** (M2O -> sites) +- **campaign_id** (M2O -> campaign_masters) +- **title** (String) +- **slug** (String) +- **html_content** (Text): Full rendered HTML +- **schema_json** (JSON): FAQ, Article, Product schema +- **meta_desc** (Text) +- **meta_title** (String) +- **featured_image** (Image) +- **generation_hash** (String): For duplicate checks +- **is_published** (Boolean) +- **status** (String): `queued` | `processing` | `qc` | `approved` | `published` +- **sitemap_status** (String): `ghost` | `queued` | `indexed` +- **date_created** (Timestamp) +- **date_published** (Timestamp) + +### `headline_inventory` +Pre-generated titles awaiting content. +- **id** (UUID) +- **campaign** (M2O -> campaign_masters) +- **final_title_text** (String) +- **status** (String): `available` | `used` +- **used_on_article** (M2O -> generated_articles) + +### `content_fragments` +Reusable content blocks (intros, outros, CTAs). +- **id** (UUID) +- **campaign** (M2O -> campaign_masters) +- **fragment_type** (String) +- **content_body** (Text) +- **word_count** (Integer) + +### `production_queue` +Manages generation schedule and velocity. +- **id** (UUID) +- **site** (M2O -> sites) +- **campaign** (M2O -> campaign_masters) +- **status** (String): `test_batch` | `pending` | `active` | `completed` +- **total_requested** (Integer) +- **completed_count** (Integer) +- **velocity_mode** (String) +- **schedule_data** (JSON): Array of planned dates + +--- + +## 3. Cartesian Engine (Advanced Logic) + +### `generation_jobs` +Batch jobs for Cartesian product generation. +- **id** (UUID) +- **site_id** (M2O -> sites) +- **target_quantity** (Integer) +- **status** (String): `Pending` | `Processing` | `Complete` +- **filters** (JSON) +- **current_offset** (Integer) + +### `cartesian_patterns` +Logic patterns for data combinations. +- **id** (UUID) +- **pattern_key** (String): Unique key +- **pattern_type** (String) +- **formula** (String): Logic formula +- **data** (JSON) + +### `spintax_dictionaries` +Global spintax terms. +- **id** (UUID) +- **category** (String): e.g., "power_words" +- **data** (JSON): Array of strings + +--- + +## 4. Intelligence Library + +### `avatar_intelligence` +User personas for targeted content. +- **id** (UUID) +- **avatar_key** (String) +- **base_name** (String) +- **wealth_cluster** (String) +- **business_niches** (JSON) +- **data** (JSON): Pain points, desires, etc. + +### `avatar_variants` +Variations of personas. +- **id** (UUID) +- **avatar_key** (String) +- **variant_type** (String) +- **data** (JSON) + +### `geo_intelligence` +Location data clusters. +- **id** (UUID) +- **cluster_key** (String) +- **data** (JSON): Demographics, local keywords + +### `offer_blocks` +Universal and personalized offer content. +- **id** (UUID) +- **block_type** (String) +- **avatar_key** (String) +- **data** (JSON) + +### `quality_flags` +Content quality control issues. +- **id** (UUID) +- **site** (M2O -> sites) +- **batch_id** (String) +- **article_a** (String) +- **article_b** (String) +- **collision_text** (Text) +- **similarity_score** (Float) +- **status** (String): `pending` | `resolved` | `ignored` + +--- + +## 5. Analytics & Tracking + +### `events` +Custom user interactions. +- **id** (UUID) +- **site** (M2O -> sites) +- **event_name** (String) +- **event_category** (String) +- **event_label** (String) +- **event_value** (Integer) +- **page_path** (String) +- **session_id** (String) +- **visitor_id** (String) +- **metadata** (JSON) +- **timestamp** (Timestamp) + +### `pageviews` +Traffic logging. +- **id** (UUID) +- **site** (M2O -> sites) +- **page_path** (String) +- **page_title** (String) +- **referrer** (String) +- **user_agent** (String) +- **ip_address** (String) +- **device_type** (String) +- **browser** (String) +- **os** (String) +- **utm_source** (String) +- **utm_medium** (String) +- **utm_campaign** (String) +- **is_bot** (Boolean) +- **bot_name** (String) +- **timestamp** (Timestamp) + +### `conversions` +Goal completions. +- **id** (UUID) +- **site** (M2O -> sites) +- **lead** (M2O -> leads) +- **conversion_type** (String) +- **value** (Float) +- **currency** (String) +- **source** (String) +- **sent_to_google** (Boolean) +- **sent_to_facebook** (Boolean) + +### `site_analytics` +Analytics configuration per site. +- **id** (UUID) +- **site** (M2O -> sites) +- **google_ads_id** (String) +- **google_ads_conversion_label** (String) +- **fb_pixel_id** (String) +- **fb_access_token** (String) + +--- + +## 6. Infrastructure + +### `hub_pages` +Programmatic internal linking hubs. +- **id** (UUID) +- **site** (M2O -> sites) +- **title** (String) +- **slug** (String) +- **parent_hub** (M2O -> hub_pages) +- **level** (Integer) +- **articles_count** (Integer) +- **schema_json** (JSON) + +### `link_targets` +Internal linking destinations. +- **id** (UUID) +- **site** (M2O -> sites) +- **target_url** (String) +- **anchor_text** (String) +- **anchor_variations** (JSON) +- **priority** (Integer) +- **is_active** (Boolean) +- **is_hub** (Boolean) + +### `work_log` +System audit trail. +- **id** (UUID) +- **site** (M2O -> sites) +- **action** (String) +- **entity_type** (String) +- **entity_id** (String) +- **details** (JSON) +- **user** (String) +- **timestamp** (Timestamp) diff --git a/complete-schema-setup.sh b/complete-schema-setup.sh new file mode 100755 index 0000000..a47adec --- /dev/null +++ b/complete-schema-setup.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +# Spark Platform - Complete Schema Setup Script +# Usage: ./complete-schema-setup.sh [DIRECTUS_URL] [TOKEN] +# Defaults to hardcoded values if not provided + +DIRECTUS_URL=${1:-"https://spark.jumpstartscaling.com"} +TOKEN=${2:-"oGn-0AZjenB900pfzQYH8zCbFwGw7flU"} +SCHEMA_FILE="unified_schema.json" + +echo "🚀 Starting Complete Schema Setup..." +echo "Target: $DIRECTUS_URL" +echo "" + +if [ ! -f "$SCHEMA_FILE" ]; then + echo "❌ Error: $SCHEMA_FILE not found!" + exit 1 +fi + +# Dependency check +if ! command -v jq &> /dev/null; then + echo "❌ Error: jq is required but not installed." + exit 1 +fi + +# Function to create a collection +create_collection() { + local name=$1 + local meta=$2 + + echo "📦 Checking collection: $name" + + # Construct payload + local payload=$(jq -n \ + --arg name "$name" \ + --argjson meta "$meta" \ + '{collection: $name, meta: $meta, schema: {}}') + + # Try to create + response=$(curl -s -k -x POST "$DIRECTUS_URL/collections" \ + -H "Authorization: Bearer $TOKEN" \ + -H "Content-Type: application/json" \ + -d "$payload") + + if echo "$response" | grep -q "errors"; then + echo " → Exists or Error: $(echo $response | jq -r '.errors[0].message')" + else + echo " → Created successfully" + fi +} + +# Function to create a field +create_field() { + local collection=$1 + local field_name=$2 + local field_def=$3 + + echo " 🔹 Field: $field_name" + + response=$(curl -s -k -X POST "$DIRECTUS_URL/fields/$collection" \ + -H "Authorization: Bearer $TOKEN" \ + -H "Content-Type: application/json" \ + -d "$field_def") + + if echo "$response" | grep -q "errors"; then + # Ignore "field already exists" errors silently-ish + err=$(echo $response | jq -r '.errors[0].message') + if [[ "$err" != *"already exists"* ]]; then + echo " ⚠️ Error: $err" + fi + else + echo " → Created" + fi +} + +# Main Loop over JSON +count=$(jq '. | length' $SCHEMA_FILE) + +for ((i=0; i<$count; i++)); do + # Get collection details + name=$(jq -r ".[$i].collection" $SCHEMA_FILE) + meta=$(jq ".[$i].meta" $SCHEMA_FILE) + + # Create Collection + create_collection "$name" "$meta" + + # Get fields count + field_count=$(jq ".[$i].fields | length" $SCHEMA_FILE) + + for ((j=0; j<$field_count; j++)); do + field_name=$(jq -r ".[$i].fields[$j].field" $SCHEMA_FILE) + field_def=$(jq ".[$i].fields[$j]" $SCHEMA_FILE) + + # Create Field + create_field "$name" "$field_name" "$field_def" + done + + echo "" +done + +echo "✅ Schema Setup Complete!" diff --git a/frontend/src/types/schema.ts b/frontend/src/types/schema.ts index 161a13a..1959563 100644 --- a/frontend/src/types/schema.ts +++ b/frontend/src/types/schema.ts @@ -47,6 +47,7 @@ export interface Post { published_at?: string; category?: string; author?: string; + meta_title?: string; seo_title?: string; seo_description?: string; date_created?: string; @@ -132,6 +133,9 @@ export interface ImageTemplate { id: string; name: string; svg_template: string; + svg_source?: string; + is_default?: boolean; + preview?: string; } export interface LocationState { @@ -254,11 +258,15 @@ export interface GeneratedArticle { due_date?: string; seo_score?: number; generation_hash: string; + meta_title?: string; meta_desc?: string; is_published?: boolean; sync_status?: string; schema_json?: Record; + is_test_batch?: boolean; date_created?: string; + date_updated?: string; + date_published?: string; } @@ -303,6 +311,9 @@ export interface FormSubmission { date_created?: string; } +/** + * Full Spark Platform Schema for Directus SDK + */ /** * Full Spark Platform Schema for Directus SDK */ @@ -314,7 +325,7 @@ export interface SparkSchema { navigation: Navigation[]; authors: Author[]; - // Legacy SEO Engine (Keep for compatibility if needed) + // SEO Engine campaign_masters: CampaignMaster[]; headline_inventory: HeadlineInventory[]; content_fragments: ContentFragment[]; @@ -322,8 +333,10 @@ export interface SparkSchema { locations_states: LocationState[]; locations_counties: LocationCounty[]; locations_cities: LocationCity[]; + production_queue: ProductionQueueItem[]; + quality_flags: QualityFlag[]; - // New Cartesian Engine + // Cartesian Engine generation_jobs: GenerationJob[]; article_templates: ArticleTemplate[]; avatars: Avatar[]; @@ -336,26 +349,131 @@ export interface SparkSchema { offer_blocks_personalized: OfferBlockPersonalized[]; generated_articles: GeneratedArticle[]; + // CRM & Forms leads: Lead[]; newsletter_subscribers: NewsletterSubscriber[]; forms: Form[]; form_submissions: FormSubmission[]; + + // Infrastructure & Analytics link_targets: LinkTarget[]; + hub_pages: HubPage[]; work_log: WorkLog[]; + events: AnalyticsEvent[]; + pageviews: PageView[]; + conversions: Conversion[]; + site_analytics: SiteAnalyticsConfig[]; +} + +export interface ProductionQueueItem { + id: string; + site: string | Site; + campaign: string | CampaignMaster; + status: 'test_batch' | 'pending' | 'active' | 'completed' | 'paused'; + total_requested: number; + completed_count: number; + velocity_mode: string; + schedule_data: any[]; // JSON + date_created?: string; +} + +export interface QualityFlag { + id: string; + site: string | Site; + batch_id?: string; + article_a: string; + article_b: string; + collision_text: string; + similarity_score: number; + status: 'pending' | 'resolved' | 'ignored'; + date_created?: string; +} + +export interface HubPage { + id: string; + site: string | Site; + title: string; + slug: string; + parent_hub?: string | HubPage; + level: number; + articles_count: number; + schema_json?: Record; + date_created?: string; +} + +export interface AnalyticsEvent { + id: string; + site: string | Site; + event_name: string; + event_category?: string; + event_label?: string; + event_value?: number; + page_path: string; + session_id?: string; + visitor_id?: string; + metadata?: Record; + timestamp?: string; +} + +export interface PageView { + id: string; + site: string | Site; + page_path: string; + page_title?: string | null; + referrer?: string | null; + user_agent?: string | null; + device_type?: string | null; + browser?: string | null; + os?: string | null; + utm_source?: string | null; + utm_medium?: string | null; + utm_campaign?: string | null; + utm_content?: string | null; + utm_term?: string | null; + is_bot?: boolean; + bot_name?: string | null; + session_id?: string | null; + visitor_id?: string | null; + timestamp?: string; +} + +export interface Conversion { + id: string; + site: string | Site; + lead?: string | Lead; + conversion_type: string; + value?: number; + currency?: string; + source?: string; + campaign?: string; + gclid?: string; + fbclid?: string; + sent_to_google?: boolean; + sent_to_facebook?: boolean; + date_created?: string; +} + +export interface SiteAnalyticsConfig { + id: string; + site: string | Site; + google_ads_id?: string; + google_ads_conversion_label?: string; + fb_pixel_id?: string; + fb_access_token?: string; } export interface WorkLog { id: number; - site?: number; + site?: number | string; // Relaxed type action: string; entity_type?: string; entity_id?: string | number; - details?: string; + details?: string | Record; // Relaxed to allow JSON object level?: string; status?: string; - timestamp?: string; // Directus uses date_created + timestamp?: string; date_created?: string; - user?: string; // user ID + user?: string; } export interface LinkTarget { @@ -370,3 +488,4 @@ export interface LinkTarget { is_hub?: boolean; max_per_article?: number; } + diff --git a/unified_schema.json b/unified_schema.json new file mode 100644 index 0000000..c15cf1e --- /dev/null +++ b/unified_schema.json @@ -0,0 +1,1525 @@ +[ + { + "collection": "sites", + "meta": { + "icon": "language", + "note": "Managed WordPress sites" + }, + "fields": [ + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "url", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "wp_username", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "wp_app_password", + "type": "string", + "meta": { + "interface": "input", + "special": [ + "hash" + ] + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Active", + "value": "active" + }, + { + "text": "Paused", + "value": "paused" + }, + { + "text": "Inactive", + "value": "inactive" + } + ] + } + } + }, + { + "field": "domain_age_years", + "type": "integer", + "meta": { + "interface": "input", + "note": "For velocity calc" + } + } + ] + }, + { + "collection": "pages", + "meta": { + "icon": "description", + "note": "Static pages" + }, + "fields": [ + { + "field": "title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "slug", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "content", + "type": "text", + "meta": { + "interface": "input-rich-text-html" + } + }, + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Draft", + "value": "draft" + }, + { + "text": "Published", + "value": "published" + } + ] + } + } + }, + { + "field": "schema_json", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "posts", + "meta": { + "icon": "article", + "note": "Generated content posts (Legacy)" + }, + "fields": [ + { + "field": "title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "slug", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "content", + "type": "text", + "meta": { + "interface": "input-rich-text-html" + } + }, + { + "field": "excerpt", + "type": "text", + "meta": { + "interface": "textarea" + } + }, + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Draft", + "value": "draft" + }, + { + "text": "Published", + "value": "published" + } + ] + } + } + }, + { + "field": "meta_title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "seo_title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "seo_description", + "type": "string", + "meta": { + "interface": "textarea" + } + }, + { + "field": "schema_json", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "leads", + "meta": { + "icon": "contacts", + "note": "Lead capture data" + }, + "fields": [ + { + "field": "email", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "name", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "phone", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "source", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + } + ] + }, + { + "collection": "campaign_masters", + "meta": { + "icon": "campaign", + "note": "SEO Campaigns" + }, + "fields": [ + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o", + "display": "related-values" + }, + "schema": { + "foreign_key_table": "sites", + "foreign_key_column": "id" + } + }, + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "headline_spintax_root", + "type": "text", + "meta": { + "interface": "input-multiline" + } + }, + { + "field": "niche_variables", + "type": "json", + "meta": { + "interface": "input-code", + "options": { + "language": "json" + } + } + }, + { + "field": "target_word_count", + "type": "integer", + "meta": { + "interface": "input", + "default_value": 1500 + } + }, + { + "field": "velocity_mode", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Ramp Up", + "value": "RAMP_UP" + }, + { + "text": "Consistent", + "value": "CONSISTENT" + } + ] + } + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Active", + "value": "active" + }, + { + "text": "Paused", + "value": "paused" + }, + { + "text": "Completed", + "value": "completed" + } + ] + } + } + } + ] + }, + { + "collection": "generated_articles", + "meta": { + "icon": "article", + "note": "SEO Generated Articles" + }, + "fields": [ + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "campaign_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "campaign_masters" + } + }, + { + "field": "title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "slug", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "html_content", + "type": "text", + "meta": { + "interface": "input-rich-text-html" + } + }, + { + "field": "schema_json", + "type": "json", + "meta": { + "interface": "input-code" + } + }, + { + "field": "meta_title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "meta_desc", + "type": "text", + "meta": { + "interface": "textarea" + } + }, + { + "field": "generation_hash", + "type": "string", + "meta": { + "interface": "input", + "readonly": true + } + }, + { + "field": "is_published", + "type": "boolean", + "meta": { + "interface": "boolean" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Queued", + "value": "queued" + }, + { + "text": "Processing", + "value": "processing" + }, + { + "text": "Approved", + "value": "approved" + }, + { + "text": "Published", + "value": "published" + } + ] + } + } + }, + { + "field": "sitemap_status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Ghost", + "value": "ghost" + }, + { + "text": "Queued", + "value": "queued" + }, + { + "text": "Indexed", + "value": "indexed" + } + ] + } + } + }, + { + "field": "is_test_batch", + "type": "boolean", + "meta": { + "interface": "boolean" + } + }, + { + "field": "date_updated", + "type": "timestamp", + "meta": { + "interface": "datetime", + "special": [ + "date-updated" + ] + } + }, + { + "field": "date_published", + "type": "timestamp", + "meta": { + "interface": "datetime" + } + } + ] + }, + { + "collection": "headline_inventory", + "meta": { + "icon": "title", + "note": "Generated Headlines" + }, + "fields": [ + { + "field": "campaign_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "campaign_masters" + } + }, + { + "field": "final_title_text", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Available", + "value": "available" + }, + { + "text": "Used", + "value": "used" + } + ] + } + } + }, + { + "field": "used_on_article", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "generated_articles" + } + } + ] + }, + { + "collection": "content_fragments", + "meta": { + "icon": "extension", + "note": "Content Blocks" + }, + "fields": [ + { + "field": "campaign_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "campaign_masters" + } + }, + { + "field": "fragment_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "content_body", + "type": "text", + "meta": { + "interface": "textarea" + } + }, + { + "field": "word_count", + "type": "integer", + "meta": { + "interface": "input" + } + } + ] + }, + { + "collection": "production_queue", + "meta": { + "icon": "schedule", + "note": "Content Schedule" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "campaign", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "campaign_masters" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Test Batch", + "value": "test_batch" + }, + { + "text": "Pending", + "value": "pending" + }, + { + "text": "Active", + "value": "active" + } + ] + } + } + }, + { + "field": "total_requested", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "completed_count", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "velocity_mode", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "schedule_data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "quality_flags", + "meta": { + "icon": "flag", + "note": "Content Quality Issues" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "article_a", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "article_b", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "collision_text", + "type": "text", + "meta": { + "interface": "textarea" + } + }, + { + "field": "similarity_score", + "type": "float", + "meta": { + "interface": "input" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Pending", + "value": "pending" + }, + { + "text": "Resolved", + "value": "resolved" + } + ] + } + } + } + ] + }, + { + "collection": "avatar_intelligence", + "meta": { + "icon": "person", + "note": "Avatar User Personas" + }, + "fields": [ + { + "field": "avatar_key", + "type": "string", + "meta": { + "interface": "input", + "required": true, + "unique": true + } + }, + { + "field": "base_name", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "wealth_cluster", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "business_niches", + "type": "json", + "meta": { + "interface": "input-code" + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "avatar_variants", + "meta": { + "icon": "people", + "note": "Avatar Variations" + }, + "fields": [ + { + "field": "avatar_key", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "variant_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "geo_intelligence", + "meta": { + "icon": "map", + "note": "Geographic Data Clusters" + }, + "fields": [ + { + "field": "cluster_key", + "type": "string", + "meta": { + "interface": "input", + "unique": true + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "spintax_dictionaries", + "meta": { + "icon": "book", + "note": "Spintax Dictionaries" + }, + "fields": [ + { + "field": "category", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "cartesian_patterns", + "meta": { + "icon": "grid_on", + "note": "Logic patterns for Cartesian Engine" + }, + "fields": [ + { + "field": "pattern_key", + "type": "string", + "meta": { + "interface": "input", + "unique": true + } + }, + { + "field": "pattern_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "offer_blocks", + "meta": { + "icon": "inventory", + "note": "Offer Content Blocks" + }, + "fields": [ + { + "field": "block_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "avatar_key", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "data", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "generation_jobs", + "meta": { + "icon": "engineering", + "note": "Cartesian Generation Jobs" + }, + "fields": [ + { + "field": "site_id", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "target_quantity", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Pending", + "value": "Pending" + }, + { + "text": "Processing", + "value": "Processing" + }, + { + "text": "Complete", + "value": "Complete" + } + ] + } + } + }, + { + "field": "filters", + "type": "json", + "meta": { + "interface": "input-code" + } + }, + { + "field": "current_offset", + "type": "integer", + "meta": { + "interface": "input" + } + } + ] + }, + { + "collection": "image_templates", + "meta": { + "icon": "image", + "note": "SVG Templates" + }, + "fields": [ + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "svg_template", + "type": "text", + "meta": { + "interface": "input-multiline" + } + }, + { + "field": "svg_source", + "type": "text", + "meta": { + "interface": "input-multiline" + } + }, + { + "field": "is_default", + "type": "boolean", + "meta": { + "interface": "boolean" + } + }, + { + "field": "preview", + "type": "string", + "meta": { + "interface": "image" + } + } + ] + }, + { + "collection": "events", + "meta": { + "icon": "touch_app", + "note": "Custom Interaction Events" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "event_name", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "event_category", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "event_label", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "event_value", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "page_path", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "session_id", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "metadata", + "type": "json", + "meta": { + "interface": "input-code" + } + } + ] + }, + { + "collection": "pageviews", + "meta": { + "icon": "visibility", + "note": "Traffic Logs" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "page_path", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "page_title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "referrer", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "user_agent", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "ip_address", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "device_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "utm_source", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "utm_medium", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "utm_campaign", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "utm_content", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "utm_term", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "is_bot", + "type": "boolean", + "meta": { + "interface": "boolean" + } + } + ] + }, + { + "collection": "conversions", + "meta": { + "icon": "monetization_on", + "note": "Goal Completions" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "conversion_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "value", + "type": "float", + "meta": { + "interface": "input" + } + }, + { + "field": "currency", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "source", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "gclid", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "fbclid", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "sent_to_google", + "type": "boolean", + "meta": { + "interface": "boolean" + } + }, + { + "field": "sent_to_facebook", + "type": "boolean", + "meta": { + "interface": "boolean" + } + } + ] + }, + { + "collection": "site_analytics", + "meta": { + "icon": "settings_input_component", + "note": "Analytics Config" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "google_ads_id", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "google_ads_conversion_label", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "fb_pixel_id", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "fb_access_token", + "type": "string", + "meta": { + "interface": "input", + "special": [ + "cast-hash" + ] + } + } + ] + }, + { + "collection": "hub_pages", + "meta": { + "icon": "hub", + "note": "Internal Linking Hubs" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "title", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "slug", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "parent_hub", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "hub_pages" + } + }, + { + "field": "level", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "articles_count", + "type": "integer", + "meta": { + "interface": "input" + } + } + ] + }, + { + "collection": "link_targets", + "meta": { + "icon": "link", + "note": "Internal Linking Targets" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "target_url", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "anchor_text", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "priority", + "type": "integer", + "meta": { + "interface": "input" + } + }, + { + "field": "is_active", + "type": "boolean", + "meta": { + "interface": "boolean" + } + } + ] + }, + { + "collection": "work_log", + "meta": { + "icon": "history", + "note": "System Audit Trail" + }, + "fields": [ + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o" + }, + "schema": { + "foreign_key_table": "sites" + } + }, + { + "field": "action", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "entity_type", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "entity_id", + "type": "string", + "meta": { + "interface": "input" + } + }, + { + "field": "details", + "type": "json", + "meta": { + "interface": "input-code" + } + }, + { + "field": "user", + "type": "string", + "meta": { + "interface": "input" + } + } + ] + } +] \ No newline at end of file