{
  "$defs": {
    "InterCoKind": {
      "description": "Kind of inter-company arrangement.",
      "oneOf": [
        {
          "const": "service_agreement",
          "description": "Service agreement (consulting, R&D, marketing, IT).",
          "type": "string"
        },
        {
          "const": "ip_licence",
          "description": "Intellectual-property licence (trademark, patent, copyright,\nknow-how, brand).",
          "type": "string"
        },
        {
          "const": "loan",
          "description": "Inter-company loan.",
          "type": "string"
        },
        {
          "const": "guarantee",
          "description": "Guarantee provided by one entity for another's debt or obligation.",
          "type": "string"
        },
        {
          "const": "cost_sharing",
          "description": "Cost-sharing arrangement (R&D, marketing, infrastructure).",
          "type": "string"
        },
        {
          "const": "secondment",
          "description": "Employee secondment between group entities.",
          "type": "string"
        },
        {
          "const": "distribution",
          "description": "Distribution arrangement (resale, commissionaire, agent).",
          "type": "string"
        },
        {
          "const": "cash_pool",
          "description": "Cash-pooling arrangement.",
          "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"
    },
    "MonetaryAmount": {
      "description": "A monetary value with currency.",
      "properties": {
        "amount": {
          "format": "double",
          "type": "number"
        },
        "currency": {
          "$ref": "#/$defs/IsoCurrency"
        }
      },
      "required": [
        "amount",
        "currency"
      ],
      "type": "object"
    },
    "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"
    },
    "TpDocTier": {
      "description": "BEPS Action 13 documentation tier this transaction is in scope for.",
      "oneOf": [
        {
          "const": "master_file",
          "description": "Group-level Master File documentation.",
          "type": "string"
        },
        {
          "const": "local_file",
          "description": "Per-entity Local File documentation.",
          "type": "string"
        },
        {
          "const": "cbc_report",
          "description": "Country-by-Country Report (group revenue ≥€750M threshold).",
          "type": "string"
        }
      ]
    },
    "TpMethod": {
      "description": "OECD Transfer Pricing Guidelines Chapter II arm's-length method.",
      "oneOf": [
        {
          "const": "cup",
          "description": "Comparable Uncontrolled Price.",
          "type": "string"
        },
        {
          "const": "resale_price",
          "description": "Resale Price Method.",
          "type": "string"
        },
        {
          "const": "cost_plus",
          "description": "Cost Plus Method.",
          "type": "string"
        },
        {
          "const": "tnmm",
          "description": "Transactional Net Margin Method.",
          "type": "string"
        },
        {
          "const": "profit_split",
          "description": "Profit Split Method.",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/intercompany.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Typed inter-company relationship record.\n\nNote: this is the *relationship* record (continuous over time). For\nthe per-year transaction-summary record used in BDR 0072\nTransferPricingDocs.controlled_transactions[], a separate\n`ControlledTransaction` type is referenced from there. Both coexist.",
  "properties": {
    "agreement": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef into `legal/contracts/<slug>` for the agreement."
    },
    "annual_value": {
      "anyOf": [
        {
          "$ref": "#/$defs/MonetaryAmount"
        },
        {
          "type": "null"
        }
      ],
      "description": "Latest annual transaction value."
    },
    "arms_length_method": {
      "anyOf": [
        {
          "$ref": "#/$defs/TpMethod"
        },
        {
          "type": "null"
        }
      ],
      "description": "Arm's-length method per OECD TPG Ch. II. Required for TP-applicable\nkinds (services, IP licence, distribution)."
    },
    "benchmarking_study": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into a benchmarking-study artifact establishing the arm's-\nlength range."
    },
    "description": {
      "description": "Free-form description / rationale.",
      "type": [
        "string",
        "null"
      ]
    },
    "documentation_tier": {
      "anyOf": [
        {
          "$ref": "#/$defs/TpDocTier"
        },
        {
          "type": "null"
        }
      ],
      "description": "BEPS Action 13 documentation-tier flag."
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate",
      "description": "Date the arrangement took effect."
    },
    "effective_to": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "Date the arrangement ended (null when active)."
    },
    "from": {
      "$ref": "#/$defs/PathRef",
      "description": "The providing / lending / licensing entity."
    },
    "id": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef identifier, conventionally\n`entity/intercompany/<from-slug>-to-<to-slug>-<kind>`."
    },
    "kind": {
      "$ref": "#/$defs/InterCoKind",
      "description": "Kind of arrangement."
    },
    "to": {
      "$ref": "#/$defs/PathRef",
      "description": "The receiving entity."
    }
  },
  "required": [
    "id",
    "from",
    "to",
    "kind",
    "agreement",
    "effective_from"
  ],
  "title": "InterCompanyRelationship",
  "type": "object",
  "x-corpospec-pillar": "financials"
}