{
  "tool_id": "art-294-einvoice-vat-calc-verifier",
  "note": "golden_hash empty until first `node golden-parity.test.mjs --update`.",
  "vectors": [
    {
      "name": "multi-rate-consistent-pass",
      "policy_parameters": {
        "document": {
          "line_items": [
            {
              "line_id": 1,
              "net_amount": 1000,
              "vat_category": "S",
              "vat_rate_pct": 19
            },
            {
              "line_id": 2,
              "net_amount": 500,
              "vat_category": "Z",
              "vat_rate_pct": 0
            }
          ],
          "tax_subtotals_asserted": [
            {
              "vat_category": "S",
              "vat_rate_pct": 19,
              "taxable_amount": 1000,
              "tax_amount": 190
            },
            {
              "vat_category": "Z",
              "vat_rate_pct": 0,
              "taxable_amount": 500,
              "tax_amount": 0
            }
          ],
          "grand_total_asserted": 1690,
          "tax_total_asserted": 190
        },
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        }
      },
      "output_payload": {
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        },
        "subtotal_deltas": [
          {
            "vat_category": "S",
            "vat_rate_pct": 19,
            "taxable_amount_computed": 1000,
            "tax_amount_computed": 190,
            "taxable_amount_delta": 0,
            "tax_amount_delta": 0,
            "matched_asserted_subtotal": true
          },
          {
            "vat_category": "Z",
            "vat_rate_pct": 0,
            "taxable_amount_computed": 500,
            "tax_amount_computed": 0,
            "taxable_amount_delta": 0,
            "tax_amount_delta": 0,
            "matched_asserted_subtotal": true
          }
        ],
        "tax_total_delta": 0,
        "grand_total_delta": 0,
        "tax_total_computed": 190,
        "grand_total_computed": 1690,
        "consistent": true,
        "parse_error": null
      },
      "golden_hash": "9d8889af914e0db9148fa90242a719aed431a468b0b79ccd97636833aab15bcb"
    },
    {
      "name": "vat-total-mismatch-fail",
      "policy_parameters": {
        "document": {
          "line_items": [
            {
              "line_id": 1,
              "net_amount": 1000,
              "vat_category": "S",
              "vat_rate_pct": 19
            }
          ],
          "tax_subtotals_asserted": [
            {
              "vat_category": "S",
              "vat_rate_pct": 19,
              "taxable_amount": 1000,
              "tax_amount": 999
            }
          ],
          "grand_total_asserted": 1999,
          "tax_total_asserted": 999
        },
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        }
      },
      "output_payload": {
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        },
        "subtotal_deltas": [
          {
            "vat_category": "S",
            "vat_rate_pct": 19,
            "taxable_amount_computed": 1000,
            "tax_amount_computed": 190,
            "taxable_amount_delta": 0,
            "tax_amount_delta": -809,
            "matched_asserted_subtotal": true
          }
        ],
        "tax_total_delta": -809,
        "grand_total_delta": -809,
        "tax_total_computed": 190,
        "grand_total_computed": 1190,
        "consistent": false,
        "parse_error": null
      },
      "golden_hash": "68e39bf41fa8052139d8b5e69048c6aa914be573f28805207a0faba11b12f34a"
    },
    {
      "name": "reverse-charge-zero-rate-pass",
      "policy_parameters": {
        "document": {
          "line_items": [
            {
              "line_id": 1,
              "net_amount": 200,
              "vat_category": "AE",
              "vat_rate_pct": 19
            }
          ],
          "tax_subtotals_asserted": [
            {
              "vat_category": "AE",
              "vat_rate_pct": 0,
              "taxable_amount": 200,
              "tax_amount": 0
            }
          ],
          "grand_total_asserted": 200,
          "tax_total_asserted": 0
        },
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        }
      },
      "output_payload": {
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        },
        "subtotal_deltas": [
          {
            "vat_category": "AE",
            "vat_rate_pct": 0,
            "taxable_amount_computed": 200,
            "tax_amount_computed": 0,
            "taxable_amount_delta": 0,
            "tax_amount_delta": 0,
            "matched_asserted_subtotal": true
          }
        ],
        "tax_total_delta": 0,
        "grand_total_delta": 0,
        "tax_total_computed": 0,
        "grand_total_computed": 200,
        "consistent": true,
        "parse_error": null
      },
      "golden_hash": "e9409c32d25d9dcc6071345683d85e295e311f90e458966663ef6fd04318e358"
    },
    {
      "name": "empty-input-finite-gate",
      "policy_parameters": {},
      "output_payload": {
        "rounding": {
          "method": "half-up",
          "granularity": "per-line"
        },
        "subtotal_deltas": [],
        "tax_total_delta": null,
        "grand_total_delta": null,
        "tax_total_computed": null,
        "grand_total_computed": null,
        "consistent": false,
        "parse_error": "no_line_items"
      },
      "golden_hash": "ecb59db27b0a3e348048c06b62ff8c4b61128a48b4e7b5139affe0ee71209463"
    }
  ]
}
