← Files VeraARCHIVED FILE

modules/patent-box-review/schemas/ledger-normalization.schema.json

11.6 KB · Oct 3, 2026 · 06:30 UTC

↓ Download file

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:vera:patent-box:ledger-normalization",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "purpose",
    "mappings",
    "non_data_rows",
    "control_totals",
    "fx_rates",
    "costs",
    "excluded_rows",
    "duplicate_reviews",
    "population_duplicate_review",
    "rounding_policy"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "purpose": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
    },
    "mappings": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "table_id",
          "amount_column",
          "currency_column",
          "currency_constant",
          "row_key_column",
          "decimal_separator",
          "thousands_separator",
          "parentheses_negative",
          "economic_key_columns",
          "mapping_rationale"
        ],
        "properties": {
          "table_id": {
            "type": "string",
            "pattern": "T\\.[a-f0-9]{64}"
          },
          "amount_column": {
            "type": "string",
            "pattern": "[A-Z]{1,3}"
          },
          "currency_column": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "[A-Z]{1,3}"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency_constant": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "[A-Z]{3}"
              },
              {
                "type": "null"
              }
            ]
          },
          "row_key_column": {
            "type": "string",
            "pattern": "[A-Z]{1,3}"
          },
          "decimal_separator": {
            "type": "string",
            "enum": [
              ".",
              ","
            ]
          },
          "thousands_separator": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  ".",
                  ",",
                  " "
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "parentheses_negative": {
            "type": "boolean"
          },
          "economic_key_columns": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "[A-Z]{1,3}"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "mapping_rationale": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        }
      },
      "minItems": 1,
      "maxItems": 100
    },
    "non_data_rows": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "row_ref",
          "reason"
        ],
        "properties": {
          "row_ref": {
            "type": "string",
            "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        }
      },
      "minItems": 0,
      "maxItems": 100000
    },
    "control_totals": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "table_id",
          "currency",
          "value",
          "evidence_id",
          "locator",
          "source_cell"
        ],
        "properties": {
          "table_id": {
            "type": "string",
            "pattern": "T\\.[a-f0-9]{64}"
          },
          "currency": {
            "type": "string",
            "pattern": "[A-Z]{3}"
          },
          "value": {
            "type": "string",
            "pattern": "-?(0|[1-9][0-9]{0,13})\\.[0-9]{2}"
          },
          "evidence_id": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "locator": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "source_cell": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "row_ref",
                  "column_id"
                ],
                "properties": {
                  "row_ref": {
                    "type": "string",
                    "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
                  },
                  "column_id": {
                    "type": "string",
                    "pattern": "[A-Z]{1,3}"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "minItems": 1,
      "maxItems": 500
    },
    "fx_rates": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rate_id",
          "from_currency",
          "eur_per_unit",
          "rate_date",
          "evidence_id",
          "locator",
          "rationale"
        ],
        "properties": {
          "rate_id": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "from_currency": {
            "type": "string",
            "pattern": "[A-Z]{3}"
          },
          "eur_per_unit": {
            "type": "string",
            "pattern": "[0-9]{1,8}(\\.[0-9]{1,12})?"
          },
          "rate_date": {
            "type": "string",
            "format": "date"
          },
          "evidence_id": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "locator": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "rationale": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        }
      },
      "minItems": 0,
      "maxItems": 100000
    },
    "costs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cost_id",
          "period_id",
          "account",
          "category",
          "components",
          "income_max",
          "irap_max",
          "rationale",
          "evidence_ids"
        ],
        "properties": {
          "cost_id": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "period_id": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "account": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "category": {
            "type": "string",
            "enum": [
              "PERSONNEL",
              "DEPRECIATION",
              "SERVICES",
              "MATERIALS",
              "IP_PROTECTION",
              "OTHER"
            ]
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "row_ref",
                "fx_rate_id"
              ],
              "properties": {
                "row_ref": {
                  "type": "string",
                  "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
                },
                "fx_rate_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "minItems": 1,
            "maxItems": 100000
          },
          "income_max": {
            "type": "string",
            "pattern": "(0|[1-9][0-9]{0,13})\\.[0-9]{2}"
          },
          "irap_max": {
            "type": "string",
            "pattern": "(0|[1-9][0-9]{0,13})\\.[0-9]{2}"
          },
          "rationale": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "evidence_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
            },
            "minItems": 1,
            "uniqueItems": true
          }
        }
      },
      "minItems": 0,
      "maxItems": 100000
    },
    "excluded_rows": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "row_ref",
          "reason",
          "evidence_ids"
        ],
        "properties": {
          "row_ref": {
            "type": "string",
            "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "evidence_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
            },
            "minItems": 1,
            "uniqueItems": true
          }
        }
      },
      "minItems": 0,
      "maxItems": 100000
    },
    "duplicate_reviews": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "row_refs",
          "decision",
          "retained_row_ref",
          "reason",
          "evidence_ids"
        ],
        "properties": {
          "row_refs": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
            },
            "minItems": 2,
            "uniqueItems": true
          },
          "decision": {
            "type": "string",
            "enum": [
              "DISTINCT",
              "DUPLICATE",
              "UNRESOLVED"
            ]
          },
          "retained_row_ref": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "T\\.[a-f0-9]{64}:r[1-9][0-9]{0,6}"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "evidence_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
            },
            "minItems": 1,
            "uniqueItems": true
          }
        }
      },
      "minItems": 0,
      "maxItems": 100000
    },
    "population_duplicate_review": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "assessment",
        "evidence_ids"
      ],
      "properties": {
        "assessment": {
          "type": "string",
          "minLength": 1,
          "maxLength": 10000
        },
        "evidence_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "[A-Za-z0-9][A-Za-z0-9_.:-]{0,119}"
          },
          "minItems": 1,
          "uniqueItems": true
        }
      }
    },
    "rounding_policy": {
      "const": "HALF_UP_AT_NORMALIZED_COST_TOTAL"
    }
  }
}

SHA-256: f5c1faa3d58c6dbcfbcf7273230af69c631f8471b71214128f81a34bcd553457