{
  "dataset": {
    "id": "synthetic-receiving-cartons",
    "version": "1.0.0",
    "kind": "handwritten_synthetic_fixtures",
    "caseCount": 12,
    "description": "Two fixed synthetic product lines and a printed carton total. Expected statuses, totals, discrepancies and issue codes are handwritten independently of the validator."
  },
  "cases": [
    {
      "id": "match",
      "name": "Totals match",
      "input": {
        "productA": "60",
        "productB": "40",
        "printedTotal": "100"
      },
      "expected": {
        "status": "pass",
        "lineTotal": 100,
        "printedTotal": 100,
        "discrepancy": 0,
        "issues": []
      }
    },
    {
      "id": "mismatch",
      "name": "Quantity mismatch",
      "input": {
        "productA": "60",
        "productB": "40",
        "printedTotal": "98"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": 100,
        "printedTotal": 98,
        "discrepancy": 2,
        "issues": [
          {
            "field": "printedTotal",
            "code": "total_mismatch"
          }
        ]
      }
    },
    {
      "id": "quantity",
      "name": "Missing quantity",
      "input": {
        "productA": "60",
        "productB": "",
        "printedTotal": "100"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 100,
        "discrepancy": null,
        "issues": [
          {
            "field": "productB",
            "code": "missing"
          }
        ]
      }
    },
    {
      "id": "total",
      "name": "Missing total",
      "input": {
        "productA": "60",
        "productB": "40",
        "printedTotal": ""
      },
      "expected": {
        "status": "review_required",
        "lineTotal": 100,
        "printedTotal": null,
        "discrepancy": null,
        "issues": [
          {
            "field": "printedTotal",
            "code": "missing"
          }
        ]
      }
    },
    {
      "id": "negative",
      "name": "Negative carton quantity",
      "input": {
        "productA": "-5",
        "productB": "40",
        "printedTotal": "35"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 35,
        "discrepancy": null,
        "issues": [
          {
            "field": "productA",
            "code": "negative"
          }
        ]
      }
    },
    {
      "id": "decimal",
      "name": "Fractional carton quantity",
      "input": {
        "productA": "60",
        "productB": "40.5",
        "printedTotal": "100"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 100,
        "discrepancy": null,
        "issues": [
          {
            "field": "productB",
            "code": "non_integer"
          }
        ]
      }
    },
    {
      "id": "malformed",
      "name": "Quantity includes text",
      "input": {
        "productA": "60 cartons",
        "productB": "40",
        "printedTotal": "100"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 100,
        "discrepancy": null,
        "issues": [
          {
            "field": "productA",
            "code": "invalid"
          }
        ]
      }
    },
    {
      "id": "whitespace",
      "name": "Surrounding whitespace",
      "input": {
        "productA": " 60 ",
        "productB": "40",
        "printedTotal": " 100 "
      },
      "expected": {
        "status": "pass",
        "lineTotal": 100,
        "printedTotal": 100,
        "discrepancy": 0,
        "issues": []
      }
    },
    {
      "id": "zero",
      "name": "Explicit zero is present",
      "input": {
        "productA": "0",
        "productB": "40",
        "printedTotal": "40"
      },
      "expected": {
        "status": "pass",
        "lineTotal": 40,
        "printedTotal": 40,
        "discrepancy": 0,
        "issues": []
      }
    },
    {
      "id": "exponent",
      "name": "Scientific notation blocked",
      "input": {
        "productA": "6e1",
        "productB": "40",
        "printedTotal": "100"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 100,
        "discrepancy": null,
        "issues": [
          {
            "field": "productA",
            "code": "invalid"
          }
        ]
      }
    },
    {
      "id": "limit",
      "name": "Quantity exceeds demo limit",
      "input": {
        "productA": "1000001",
        "productB": "0",
        "printedTotal": "1000000"
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": 1000000,
        "discrepancy": null,
        "issues": [
          {
            "field": "productA",
            "code": "out_of_range"
          }
        ]
      }
    },
    {
      "id": "all-missing",
      "name": "All counts missing",
      "input": {
        "productA": "",
        "productB": " ",
        "printedTotal": ""
      },
      "expected": {
        "status": "review_required",
        "lineTotal": null,
        "printedTotal": null,
        "discrepancy": null,
        "issues": [
          {
            "field": "productA",
            "code": "missing"
          },
          {
            "field": "productB",
            "code": "missing"
          },
          {
            "field": "printedTotal",
            "code": "missing"
          }
        ]
      }
    }
  ]
}
