{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/casaintelligence-com-au/json-schema/casaintelligence-com-au-feasibility-pdfrequest-schema.json",
  "title": "FeasibilityPDFRequest",
  "description": "Casa Daily sends the full assembled payload it intends to print.\n\nThe user may have edited inputs in the variables-sheet card before\nclicking 'Generate feasibility report', so the source of truth for\nthe PDF is the post-edit payload, not the original /compose response.\nThe AI narrative comes from Casa Daily's curated chat synthesis —\nit's NOT regenerated server-side here so the PDF matches what the\nuser saw on screen.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/casaintelligence-com-au-casa-daily-feasibility-api-openapi.yml#/components/schemas/FeasibilityPDFRequest",
  "properties": {
    "payload": {
      "$ref": "#/$defs/FeasibilityComposePayload"
    },
    "project_name": {
      "type": "string",
      "maxLength": 200,
      "title": "Project Name"
    },
    "user_full_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Full Name"
    },
    "user_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Email"
    },
    "ai_narrative": {
      "additionalProperties": true,
      "type": "object",
      "title": "Ai Narrative",
      "description": "AI-generated narrative sections keyed by name: executive_summary, site_assessment, casa_planner_pathway, etc."
    },
    "casa_planner_section": {
      "additionalProperties": true,
      "type": "object",
      "title": "Casa Planner Section",
      "description": "The Casa Planner upsell block — likelihood, required docs, consultant pack, cost-to-DA, marketing CTA. Optional but expected for the launch pitch."
    },
    "variables_snapshot": {
      "additionalProperties": true,
      "type": "object",
      "title": "Variables Snapshot",
      "description": "User-edited financial variables sheet at PDF compile time (purchase_price, unit_count, build_cost_per_unit, etc.)"
    },
    "variables_outputs": {
      "additionalProperties": true,
      "type": "object",
      "title": "Variables Outputs",
      "description": "Computed financial outputs from the variables sheet (profit, margin_pct, total_project_cost, breakeven_sale_price_per_unit, etc.)"
    },
    "dev_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dev Type"
    },
    "unit_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unit Count"
    }
  },
  "type": "object",
  "required": [
    "payload",
    "project_name"
  ],
  "$defs": {
    "FeasibilityComposePayload": {
      "properties": {
        "property": {
          "additionalProperties": true,
          "type": "object",
          "title": "Property"
        },
        "feasibility": {
          "additionalProperties": true,
          "type": "object",
          "title": "Feasibility"
        },
        "infrastructure_charges": {
          "additionalProperties": true,
          "type": "object",
          "title": "Infrastructure Charges"
        },
        "predicted_conditions": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Predicted Conditions"
        },
        "assessment_levels": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Assessment Levels"
        },
        "timeline": {
          "additionalProperties": true,
          "type": "object",
          "title": "Timeline"
        },
        "nearby_das": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Nearby Das"
        },
        "da_pathway": {
          "additionalProperties": true,
          "type": "object",
          "title": "Da Pathway"
        },
        "required_documents": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Required Documents"
        },
        "consultant_package": {
          "additionalProperties": true,
          "type": "object",
          "title": "Consultant Package"
        },
        "informational_only": {
          "type": "boolean",
          "title": "Informational Only",
          "default": true
        },
        "disclaimer": {
          "type": "string",
          "title": "Disclaimer",
          "default": "Informational only — not financial, taxation, or planning advice. Verify all numbers with your accountant, lender, surveyor, and council assessment officer before relying on them for any commercial decision."
        }
      },
      "type": "object",
      "required": [
        "property",
        "feasibility",
        "infrastructure_charges",
        "predicted_conditions",
        "assessment_levels",
        "timeline",
        "nearby_das",
        "da_pathway",
        "required_documents",
        "consultant_package"
      ],
      "title": "FeasibilityComposePayload",
      "description": "The full deterministic payload Casa Daily renders as inline cards."
    }
  }
}