{
  "wrong_total": {
    "injected_records": [
      {
        "document_id": "SYN-INV-001",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "147.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-002",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S02",
        "currency": "EUR",
        "subtotal": "140.00",
        "tax": "0.00",
        "total": "140.00",
        "lines": [
          [
            "Test service C",
            "1",
            "80.00",
            "80.00"
          ],
          [
            "Test service D",
            "3",
            "20.00",
            "60.00"
          ]
        ]
      },
      {
        "document_id": "SYN-CN-003",
        "document_type": "CREDIT_NOTE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "20.00",
        "tax": "0.00",
        "total": "20.00",
        "lines": [
          [
            "Test return",
            "2",
            "10.00",
            "20.00"
          ]
        ]
      }
    ],
    "findings": [
      {
        "document": 0,
        "code": "TOTAL_RECONCILIATION"
      }
    ],
    "expected_code_detected": true
  },
  "missing_document_id": {
    "injected_records": [
      {
        "document_id": "",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "137.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-002",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S02",
        "currency": "EUR",
        "subtotal": "140.00",
        "tax": "0.00",
        "total": "140.00",
        "lines": [
          [
            "Test service C",
            "1",
            "80.00",
            "80.00"
          ],
          [
            "Test service D",
            "3",
            "20.00",
            "60.00"
          ]
        ]
      },
      {
        "document_id": "SYN-CN-003",
        "document_type": "CREDIT_NOTE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "20.00",
        "tax": "0.00",
        "total": "20.00",
        "lines": [
          [
            "Test return",
            "2",
            "10.00",
            "20.00"
          ]
        ]
      }
    ],
    "findings": [
      {
        "document": 0,
        "code": "MISSING_FIELD",
        "field": "document_id"
      }
    ],
    "expected_code_detected": true
  },
  "unknown_supplier": {
    "injected_records": [
      {
        "document_id": "SYN-INV-001",
        "document_type": "INVOICE",
        "supplier_id": "SYN-UNKNOWN",
        "currency": "USD",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "137.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-002",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S02",
        "currency": "EUR",
        "subtotal": "140.00",
        "tax": "0.00",
        "total": "140.00",
        "lines": [
          [
            "Test service C",
            "1",
            "80.00",
            "80.00"
          ],
          [
            "Test service D",
            "3",
            "20.00",
            "60.00"
          ]
        ]
      },
      {
        "document_id": "SYN-CN-003",
        "document_type": "CREDIT_NOTE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "20.00",
        "tax": "0.00",
        "total": "20.00",
        "lines": [
          [
            "Test return",
            "2",
            "10.00",
            "20.00"
          ]
        ]
      }
    ],
    "findings": [
      {
        "document": 0,
        "code": "SUPPLIER_NOT_IN_TEST_MASTER"
      }
    ],
    "expected_code_detected": true
  },
  "out_of_scope_currency": {
    "injected_records": [
      {
        "document_id": "SYN-INV-001",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S01",
        "currency": "UNLISTED",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "137.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-002",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S02",
        "currency": "EUR",
        "subtotal": "140.00",
        "tax": "0.00",
        "total": "140.00",
        "lines": [
          [
            "Test service C",
            "1",
            "80.00",
            "80.00"
          ],
          [
            "Test service D",
            "3",
            "20.00",
            "60.00"
          ]
        ]
      },
      {
        "document_id": "SYN-CN-003",
        "document_type": "CREDIT_NOTE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "20.00",
        "tax": "0.00",
        "total": "20.00",
        "lines": [
          [
            "Test return",
            "2",
            "10.00",
            "20.00"
          ]
        ]
      }
    ],
    "findings": [
      {
        "document": 0,
        "code": "CURRENCY_OUTSIDE_TEST_SCOPE"
      }
    ],
    "expected_code_detected": true
  },
  "duplicate_document": {
    "injected_records": [
      {
        "document_id": "SYN-INV-001",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "137.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-002",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S02",
        "currency": "EUR",
        "subtotal": "140.00",
        "tax": "0.00",
        "total": "140.00",
        "lines": [
          [
            "Test service C",
            "1",
            "80.00",
            "80.00"
          ],
          [
            "Test service D",
            "3",
            "20.00",
            "60.00"
          ]
        ]
      },
      {
        "document_id": "SYN-CN-003",
        "document_type": "CREDIT_NOTE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "20.00",
        "tax": "0.00",
        "total": "20.00",
        "lines": [
          [
            "Test return",
            "2",
            "10.00",
            "20.00"
          ]
        ]
      },
      {
        "document_id": "SYN-INV-001",
        "document_type": "INVOICE",
        "supplier_id": "SYN-S01",
        "currency": "USD",
        "subtotal": "125.00",
        "tax": "12.50",
        "total": "137.50",
        "lines": [
          [
            "Test service A",
            "2",
            "50.00",
            "100.00"
          ],
          [
            "Test service B",
            "1",
            "25.00",
            "25.00"
          ]
        ]
      }
    ],
    "findings": [
      {
        "code": "DUPLICATE_BUSINESS_KEY",
        "key": [
          "SYN-S01",
          "INVOICE",
          "SYN-INV-001",
          "USD"
        ],
        "count": 2
      }
    ],
    "expected_code_detected": true
  }
}
