{
  "$defs": {
    "CompensationModel": {
      "description": "Compensation model.",
      "oneOf": [
        {
          "const": "rev_share",
          "description": "Revenue share on closed deals.",
          "type": "string"
        },
        {
          "const": "per_lead",
          "description": "Flat referral fee per qualified lead.",
          "type": "string"
        },
        {
          "const": "per_close",
          "description": "Flat fee per closed deal.",
          "type": "string"
        },
        {
          "const": "margin",
          "description": "Margin on resold seats.",
          "type": "string"
        },
        {
          "const": "mdf",
          "description": "MDF (marketing development fund) reimbursement.",
          "type": "string"
        },
        {
          "const": "none",
          "description": "No compensation (technology integration only).",
          "type": "string"
        }
      ]
    },
    "Confidentiality": {
      "description": "Cross-cutting confidentiality classification used across privacy,\nsecurity, knowledge, IR pillars. Default rendering rule: `corpospec-report`\nexcludes `Restricted | BoardOnly | InvestorOnly` records from public output\nunless an explicit audience parameter overrides. See BDR 0076 §1.",
      "oneOf": [
        {
          "const": "public",
          "description": "Safe to publish anywhere.",
          "type": "string"
        },
        {
          "const": "customer",
          "description": "Visible to customers under standard ToS.",
          "type": "string"
        },
        {
          "const": "internal",
          "description": "Employees and contractors only.",
          "type": "string"
        },
        {
          "const": "restricted",
          "description": "Need-to-know subset of internal.",
          "type": "string"
        },
        {
          "const": "board_only",
          "description": "Board members and direct staff.",
          "type": "string"
        },
        {
          "const": "investor_only",
          "description": "Existing investors + prospective with NDA.",
          "type": "string"
        }
      ]
    },
    "IsoCurrency": {
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PartnershipKind": {
      "description": "Partnership kind.",
      "oneOf": [
        {
          "const": "reseller",
          "description": "Reseller (partner sells our product).",
          "type": "string"
        },
        {
          "const": "referral",
          "description": "Referral (partner sends leads).",
          "type": "string"
        },
        {
          "const": "affiliate",
          "description": "Affiliate (revenue-share on tracked links).",
          "type": "string"
        },
        {
          "const": "integration",
          "description": "Technology / integration (interop only).",
          "type": "string"
        },
        {
          "const": "solution",
          "description": "Solution / implementation partner.",
          "type": "string"
        },
        {
          "const": "oem",
          "description": "OEM (embeds our product in theirs).",
          "type": "string"
        },
        {
          "const": "co_marketing",
          "description": "Co-marketing / co-selling.",
          "type": "string"
        },
        {
          "const": "strategic_alliance",
          "description": "Strategic alliance (joint planning).",
          "type": "string"
        },
        {
          "const": "investor_referral",
          "description": "Investor-led partnership.",
          "type": "string"
        },
        {
          "const": "standards_consortium",
          "description": "Standards body / consortium.",
          "type": "string"
        }
      ]
    },
    "PartnershipPerformance": {
      "description": "Performance metric snapshot.",
      "properties": {
        "closed_won": {
          "format": "int32",
          "type": "integer"
        },
        "influenced_revenue": {
          "description": "Influenced revenue (partner played a role but not sole source).",
          "format": "double",
          "type": "number"
        },
        "leads_sourced": {
          "format": "int32",
          "type": "integer"
        },
        "opportunities_created": {
          "format": "int32",
          "type": "integer"
        },
        "sourced_revenue": {
          "description": "Sourced revenue (deal closures attributed to partner).",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "leads_sourced",
        "opportunities_created",
        "closed_won",
        "sourced_revenue",
        "influenced_revenue"
      ],
      "type": "object"
    },
    "PartnershipStatus": {
      "description": "Lifecycle.",
      "enum": [
        "discussion",
        "pilot_in_flight",
        "active",
        "underperforming",
        "wound_down",
        "terminated"
      ],
      "type": "string"
    },
    "PartnershipTier": {
      "description": "Partnership tier.",
      "oneOf": [
        {
          "enum": [
            "silver",
            "gold",
            "platinum"
          ],
          "type": "string"
        },
        {
          "const": "authorised",
          "description": "Self-serve / authorised.",
          "type": "string"
        },
        {
          "const": "strategic",
          "description": "Custom / strategic.",
          "type": "string"
        }
      ]
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/partnership-agreement.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Partnership-agreement record.",
  "properties": {
    "annual_target_revenue": {
      "description": "Performance KPIs / targets.",
      "format": "double",
      "type": "number"
    },
    "compensation_model": {
      "$ref": "#/$defs/CompensationModel"
    },
    "confidentiality": {
      "$ref": "#/$defs/Confidentiality"
    },
    "contract_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the underlying legal contract."
    },
    "currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate"
    },
    "effective_to": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "exclusive": {
      "description": "Whether the partnership is exclusive in any region or vertical.",
      "type": "boolean"
    },
    "exclusivity_scope": {
      "type": [
        "string",
        "null"
      ]
    },
    "flat_fee_amount": {
      "description": "Per-lead or per-close flat fee.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "governance_cadence": {
      "description": "Quarterly business review (QBR) cadence — ISO duration.",
      "type": "string"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "integration_refs": {
      "description": "PathRefs to integration artefacts (API specs, marketplace).",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "kind": {
      "$ref": "#/$defs/PartnershipKind"
    },
    "our_owner": {
      "$ref": "#/$defs/PathRef",
      "description": "Owners on each side."
    },
    "partner_contact": {
      "type": "string"
    },
    "partner_name": {
      "type": "string"
    },
    "partner_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the partner entity (when modelled)."
    },
    "performance": {
      "$ref": "#/$defs/PartnershipPerformance"
    },
    "revenue_share_pct": {
      "description": "Revenue-share or referral-fee percentage.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/PartnershipStatus"
    },
    "tier": {
      "$ref": "#/$defs/PartnershipTier"
    }
  },
  "required": [
    "id",
    "entity",
    "partner_name",
    "kind",
    "tier",
    "status",
    "compensation_model",
    "currency",
    "exclusive",
    "contract_ref",
    "effective_from",
    "governance_cadence",
    "our_owner",
    "partner_contact",
    "annual_target_revenue",
    "performance",
    "confidentiality"
  ],
  "title": "PartnershipAgreement",
  "type": "object",
  "x-corpospec-pillar": "legal"
}