From 40e6b6465b3c69c1f408459d3102d2ade121b19c Mon Sep 17 00:00:00 2001 From: cawcenter Date: Sun, 14 Dec 2025 09:37:05 -0500 Subject: [PATCH] feat: add final 3 collections (article_templates, avatars, campaigns) - complete frontend-backend alignment --- add_final_collections.py | 54 ++++++++++++++++ unified_schema.json | 135 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 add_final_collections.py diff --git a/add_final_collections.py b/add_final_collections.py new file mode 100644 index 0000000..291bf02 --- /dev/null +++ b/add_final_collections.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +""" +Add final 3 missing collections +""" +import json + +with open('unified_schema.json', 'r') as f: + schema = json.load(f) + +# Add article_templates (alias for existing structure) +schema.append({ + "collection": "article_templates", + "meta": {"icon": "article", "note": "Article structure templates"}, + "fields": [ + {"field": "name", "type": "string", "meta": {"interface": "input", "required": True}}, + {"field": "structure_json", "type": "json", "meta": {"interface": "list", "note": "Array of section types"}}, + {"field": "description", "type": "text", "meta": {"interface": "input-multiline"}}, + {"field": "is_default", "type": "boolean", "meta": {"interface": "boolean"}} + ] +}) + +# Add avatars (simpler version, avatar_intelligence is the main one) +schema.append({ + "collection": "avatars", + "meta": {"icon": "person", "note": "Simple avatar list (use avatar_intelligence for full data)"}, + "fields": [ + {"field": "name", "type": "string", "meta": {"interface": "input", "required": True}}, + {"field": "slug", "type": "string", "meta": {"interface": "input", "required": True}}, + {"field": "description", "type": "text", "meta": {"interface": "input-multiline"}} + ] +}) + +# Add campaigns (alias for campaign_masters) +schema.append({ + "collection": "campaigns", + "meta": {"icon": "campaign", "note": "Marketing campaigns (use campaign_masters for SEO campaigns)"}, + "fields": [ + {"field": "name", "type": "string", "meta": {"interface": "input", "required": True}}, + {"field": "site", "type": "uuid", "meta": {"interface": "select-dropdown-m2o", "special": ["m2o"]}}, + {"field": "status", "type": "string", "meta": {"interface": "select-dropdown", "options": {"choices": [ + {"text": "Active", "value": "active"}, + {"text": "Paused", "value": "paused"}, + {"text": "Completed", "value": "completed"} + ]}}}, + {"field": "start_date", "type": "timestamp", "meta": {"interface": "datetime"}}, + {"field": "end_date", "type": "timestamp", "meta": {"interface": "datetime"}} + ] +}) + +with open('unified_schema.json', 'w') as f: + json.dump(schema, f, indent=4) + +print(f"✅ Added article_templates, avatars, campaigns") +print(f"✅ Total collections: {len(schema)}") diff --git a/unified_schema.json b/unified_schema.json index dd84fcb..9a3f9ef 100644 --- a/unified_schema.json +++ b/unified_schema.json @@ -2272,5 +2272,140 @@ } } ] + }, + { + "collection": "article_templates", + "meta": { + "icon": "article", + "note": "Article structure templates" + }, + "fields": [ + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "structure_json", + "type": "json", + "meta": { + "interface": "list", + "note": "Array of section types" + } + }, + { + "field": "description", + "type": "text", + "meta": { + "interface": "input-multiline" + } + }, + { + "field": "is_default", + "type": "boolean", + "meta": { + "interface": "boolean" + } + } + ] + }, + { + "collection": "avatars", + "meta": { + "icon": "person", + "note": "Simple avatar list (use avatar_intelligence for full data)" + }, + "fields": [ + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "slug", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "description", + "type": "text", + "meta": { + "interface": "input-multiline" + } + } + ] + }, + { + "collection": "campaigns", + "meta": { + "icon": "campaign", + "note": "Marketing campaigns (use campaign_masters for SEO campaigns)" + }, + "fields": [ + { + "field": "name", + "type": "string", + "meta": { + "interface": "input", + "required": true + } + }, + { + "field": "site", + "type": "uuid", + "meta": { + "interface": "select-dropdown-m2o", + "special": [ + "m2o" + ] + } + }, + { + "field": "status", + "type": "string", + "meta": { + "interface": "select-dropdown", + "options": { + "choices": [ + { + "text": "Active", + "value": "active" + }, + { + "text": "Paused", + "value": "paused" + }, + { + "text": "Completed", + "value": "completed" + } + ] + } + } + }, + { + "field": "start_date", + "type": "timestamp", + "meta": { + "interface": "datetime" + } + }, + { + "field": "end_date", + "type": "timestamp", + "meta": { + "interface": "datetime" + } + } + ] } ] \ No newline at end of file