{
  "entities": {
    "InventoryItem": {
      "title": "Inventory Item",
      "description": "Raw materials, packaging, and studio supplies",
      "type": "object",
      "properties": {
        "item": { "type": "string" },
        "stock": { "type": "number" },
        "unit": { "type": "string" },
        "minStock": { "type": "number" },
        "costPerUnit": { "type": "number" },
        "uid": { "type": "string" }
      },
      "required": ["item", "stock", "unit", "uid"]
    },
    "Transaction": {
      "title": "Financial Transaction",
      "description": "Income or expense record",
      "type": "object",
      "properties": {
        "type": { "type": "string", "enum": ["in", "out"] },
        "amount": { "type": "number" },
        "desc": { "type": "string" },
        "date": { "type": "string", "format": "date" },
        "uid": { "type": "string" }
      },
      "required": ["type", "amount", "desc", "date", "uid"]
    },
    "Collection": {
      "title": "Product Collection",
      "description": "Luxury B2B gift collections and stone-cast botanical lines",
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "type": { "type": "string" },
        "stage": { "type": "string" },
        "health": { "type": "string" },
        "description": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["name", "type", "stage", "uid"]
    },
    "Asset": {
      "title": "Studio Asset",
      "description": "Formulation briefs, B2B strategy documents, and copy",
      "type": "object",
      "properties": {
        "type": { "type": "string" },
        "title": { "type": "string" },
        "content": { "type": "string" },
        "author": { "type": "string" },
        "createdAt": { "type": "string", "format": "date" },
        "uid": { "type": "string" }
      },
      "required": ["type", "title", "content", "author", "uid"]
    },
    "Task": {
      "title": "Agent Task",
      "description": "Operational directive for studio specialists",
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "description": { "type": "string" },
        "assignedTo": { "type": "string" },
        "status": { "type": "string" },
        "priority": { "type": "string" },
        "createdAt": { "type": "string", "format": "date" },
        "uid": { "type": "string" }
      },
      "required": ["title", "assignedTo", "status", "uid"]
    },
    "ProposedAction": {
      "title": "Proposed Agent Action",
      "description": "Human-in-the-loop approval queue item",
      "type": "object",
      "properties": {
        "agent": { "type": "string" },
        "tool": { "type": "string" },
        "args": { "type": "object" },
        "status": { "type": "string", "enum": ["pending", "approved", "rejected"] },
        "timestamp": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["agent", "tool", "args", "status", "uid"]
    },
    "UserProfile": {
      "title": "Studio Profile",
      "description": "LJWellness studio identity and operational targets",
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "niche": { "type": "string" },
        "description": { "type": "string" },
        "brandVoice": { "type": "string" },
        "revenueGoal": { "type": "number" },
        "uid": { "type": "string" }
      },
      "required": ["name", "uid"]
    },
    "CorporateAccount": {
      "title": "B2B Builder & Brokerage Account",
      "description": "Luxury builders, condo developers, realtors, and hospitality clients",
      "type": "object",
      "properties": {
        "companyName": { "type": "string" },
        "contactPerson": { "type": "string" },
        "email": { "type": "string" },
        "accountType": { "type": "string" },
        "status": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["companyName", "email", "uid"]
    },
    "PlannerEvent": {
      "title": "Studio Planner Event",
      "description": "Batch cure milestones, B2B handovers, and procurement deadlines",
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "date": { "type": "string" },
        "type": { "type": "string" },
        "category": { "type": "string" },
        "description": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["title", "date", "uid"]
    },
    "BusinessDocument": {
      "title": "Business Document",
      "description": "B2B proposals, closing gift quotes, contracts, and compliance logs",
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "type": { "type": "string" },
        "status": { "type": "string" },
        "content": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["title", "content", "uid"]
    },
    "Formulation": {
      "title": "Botanical Formulation",
      "description": "Precision cold-process, serum, and fragrance batch recipe",
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "ingredients": { "type": "array" },
        "instructions": { "type": "string" },
        "curingTimeDays": { "type": "number" },
        "uid": { "type": "string" }
      },
      "required": ["name", "ingredients", "uid"]
    },
    "ProductionBatch": {
      "title": "Production Batch",
      "description": "Traceability lot record and curing status",
      "type": "object",
      "properties": {
        "formulationId": { "type": "string" },
        "batchName": { "type": "string" },
        "status": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["formulationId", "batchName", "status", "uid"]
    },
    "Message": {
      "title": "Agent Message",
      "description": "Studio orchestration message",
      "type": "object",
      "properties": {
        "sender": { "type": "string" },
        "content": { "type": "string" },
        "timestamp": { "type": "string" },
        "type": { "type": "string" },
        "createdAt": { "type": "string", "format": "date-time" },
        "uid": { "type": "string" }
      },
      "required": ["sender", "content", "timestamp", "type", "uid"]
    },
    "SmartNote": {
      "title": "SMART Note",
      "description": "Strategic SMART goals and B2B execution milestones",
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "category": { "type": "string" },
        "status": { "type": "string" },
        "specific": { "type": "string" },
        "measurable": { "type": "string" },
        "achievable": { "type": "string" },
        "relevant": { "type": "string" },
        "timeBound": { "type": "string" },
        "uid": { "type": "string" }
      },
      "required": ["title", "category", "status", "uid"]
    },
    "DevelopmentPortal": {
      "title": "Development QR Portal",
      "description": "Publicly readable (when published) architectural homeowner handbook and maintenance portal linked to Architect Box QR codes",
      "type": "object",
      "properties": {
        "slug": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-]+$", "maxLength": 128 },
        "developmentName": { "type": "string", "maxLength": 200 },
        "developerName": { "type": "string", "maxLength": 200 },
        "published": { "type": "boolean" },
        "welcomeNote": { "type": "string", "maxLength": 5000 },
        "uid": { "type": "string" }
      },
      "required": ["slug", "developmentName", "published", "uid"]
    }
  },
  "firestore": {
    "/inventory": { "schema": "InventoryItem", "description": "Studio raw materials & packaging" },
    "/transactions": { "schema": "Transaction", "description": "Financial ledger" },
    "/collections": { "schema": "Collection", "description": "Product series" },
    "/assets": { "schema": "Asset", "description": "IP and B2B documentation" },
    "/tasks": { "schema": "Task", "description": "Agent directives" },
    "/proposed_actions": { "schema": "ProposedAction", "description": "HITL approval queue" },
    "/profiles": { "schema": "UserProfile", "description": "Studio owner settings" },
    "/corporate_accounts": { "schema": "CorporateAccount", "description": "Builders, developers, and realtors" },
    "/events": { "schema": "PlannerEvent", "description": "Studio planner & curing events" },
    "/documents": { "schema": "BusinessDocument", "description": "B2B quotes, POs, and binders" },
    "/formulations": { "schema": "Formulation", "description": "Laboratory formulas" },
    "/production_batches": { "schema": "ProductionBatch", "description": "Batch curing and QC lots" },
    "/messages": { "schema": "Message", "description": "Conversational logs" },
    "/smart_notes": { "schema": "SmartNote", "description": "SMART Notebook strategic notes" },
    "/portals": { "schema": "DevelopmentPortal", "description": "Development QR homeowner portals & A3 binder specs" }
  }
}
