{
  "$defs": {
    "IsoCountry": {
      "description": "ISO 3166-1 alpha-2 country code.",
      "pattern": "^[A-Z]{2}$",
      "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"
    },
    "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"
    },
    "TaxKind": {
      "description": "Tax kind.",
      "oneOf": [
        {
          "enum": [
            "other"
          ],
          "type": "string"
        },
        {
          "const": "de_koerperschaftsteuer",
          "description": "DE Körperschaftsteuer (corporate income).",
          "type": "string"
        },
        {
          "const": "de_gewerbesteuer",
          "description": "DE Gewerbesteuer (trade tax).",
          "type": "string"
        },
        {
          "const": "de_umsatzsteuer",
          "description": "DE Umsatzsteuer / Mehrwertsteuer (VAT).",
          "type": "string"
        },
        {
          "const": "de_lohnsteuer",
          "description": "DE Lohnsteuer (payroll withholding).",
          "type": "string"
        },
        {
          "const": "de_kapitalertragsteuer",
          "description": "DE Kapitalertragsteuer (capital-yields withholding).",
          "type": "string"
        },
        {
          "const": "us_federal_cit",
          "description": "US Federal Corporate Income Tax (Form 1120).",
          "type": "string"
        },
        {
          "const": "us_state_cit",
          "description": "US State Corporate Income Tax.",
          "type": "string"
        },
        {
          "const": "us_sales_and_use_tax",
          "description": "US Sales & Use Tax.",
          "type": "string"
        },
        {
          "const": "us_form1099",
          "description": "US Form 1099 series.",
          "type": "string"
        },
        {
          "const": "uk_corporation_tax",
          "description": "UK Corporation Tax (CT600).",
          "type": "string"
        },
        {
          "const": "uk_vat",
          "description": "UK VAT.",
          "type": "string"
        },
        {
          "const": "fr_is",
          "description": "FR Impôt sur les sociétés.",
          "type": "string"
        },
        {
          "const": "fr_tva",
          "description": "FR TVA.",
          "type": "string"
        },
        {
          "const": "eu_oss_vat",
          "description": "EU OSS VAT (One-Stop-Shop).",
          "type": "string"
        },
        {
          "const": "eu_ioss_vat",
          "description": "EU IOSS VAT (Import One-Stop-Shop).",
          "type": "string"
        },
        {
          "const": "beps_master_file",
          "description": "OECD BEPS A.13 Master File.",
          "type": "string"
        },
        {
          "const": "beps_local_file",
          "description": "OECD BEPS A.13 Local File.",
          "type": "string"
        },
        {
          "const": "beps_cbc_report",
          "description": "OECD BEPS A.13 Country-by-Country Report.",
          "type": "string"
        },
        {
          "const": "pillar2_glo_be",
          "description": "OECD Pillar Two GloBE Information Return.",
          "type": "string"
        },
        {
          "const": "eu_csrd",
          "description": "EU CSRD / ESRS reporting.",
          "type": "string"
        }
      ]
    },
    "TaxReturnStatus": {
      "description": "Filing lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "filed",
            "settled",
            "amended"
          ],
          "type": "string"
        },
        {
          "const": "assessed",
          "description": "Tax authority issued an assessment.",
          "type": "string"
        },
        {
          "const": "under_appeal",
          "description": "In dispute / appeal.",
          "type": "string"
        },
        {
          "const": "under_audit",
          "description": "Audit in progress.",
          "type": "string"
        },
        {
          "const": "final",
          "description": "Beyond the assessment-window — no longer modifiable.",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/tax-return.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "One tax-return record.",
  "properties": {
    "artefact_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the filed return artefact."
    },
    "assessment_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the assessment notice."
    },
    "balance_outstanding": {
      "description": "Outstanding balance (due — paid).",
      "format": "double",
      "type": "number"
    },
    "currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "deductions": {
      "description": "Allowable deductions.",
      "format": "double",
      "type": "number"
    },
    "effective_rate_pct": {
      "description": "Effective rate (computed; informational).",
      "format": "double",
      "type": "number"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "filed_on": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "filing_id": {
      "description": "Filing accession / docket number from the authority.",
      "type": [
        "string",
        "null"
      ]
    },
    "gross_base": {
      "description": "Pre-deduction gross income / sales / wages base.",
      "format": "double",
      "type": "number"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "internal_owner": {
      "$ref": "#/$defs/PathRef"
    },
    "jurisdiction": {
      "$ref": "#/$defs/IsoCountry"
    },
    "period_end": {
      "$ref": "#/$defs/IsoDate"
    },
    "period_start": {
      "$ref": "#/$defs/IsoDate",
      "description": "Period covered by the return."
    },
    "preparer_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to preparing tax advisor / firm."
    },
    "retention_until": {
      "$ref": "#/$defs/IsoDate",
      "description": "Retention until 10y (HGB §257 / AO §147)."
    },
    "status": {
      "$ref": "#/$defs/TaxReturnStatus"
    },
    "statutory_due_date": {
      "$ref": "#/$defs/IsoDate",
      "description": "Statutory filing deadline."
    },
    "tax_due": {
      "description": "Tax computed.",
      "format": "double",
      "type": "number"
    },
    "tax_kind": {
      "$ref": "#/$defs/TaxKind"
    },
    "tax_paid": {
      "description": "Tax already paid (prepayments).",
      "format": "double",
      "type": "number"
    },
    "taxable_base": {
      "description": "Taxable base after deductions.",
      "format": "double",
      "type": "number"
    }
  },
  "required": [
    "id",
    "entity",
    "jurisdiction",
    "tax_kind",
    "period_start",
    "period_end",
    "status",
    "currency",
    "gross_base",
    "deductions",
    "taxable_base",
    "effective_rate_pct",
    "tax_due",
    "tax_paid",
    "balance_outstanding",
    "statutory_due_date",
    "internal_owner",
    "retention_until"
  ],
  "title": "TaxReturn",
  "type": "object",
  "x-corpospec-pillar": "financials"
}