{
  "format": "vercy-enterprise-allocation-fixtures/v2",
  "candidateName": "Lot / Batch",
  "cases": [
    {
      "id": "produced-lot",
      "kind": "positive",
      "input": "A batch is produced under one plan version.",
      "expect": "Lot identity and production context remain stable.",
      "target": "candidate-allocation-offline-lot-batch",
      "violates": [
        "LOT-INV-01"
      ],
      "closesDefect": [
        "D5"
      ]
    },
    {
      "id": "split",
      "kind": "positive",
      "input": "A lot is split into two child lots.",
      "expect": "Parent provenance is retained.",
      "target": "candidate-allocation-offline-lot-batch",
      "violates": [
        "LOT-INV-05"
      ],
      "closesDefect": [
        "D19"
      ]
    },
    {
      "id": "serial-collapse",
      "kind": "negative",
      "input": "The lot code is used as every item's serial.",
      "expect": "The conflation is rejected.",
      "target": "candidate-allocation-offline-lot-batch",
      "violates": [
        "LOT-INV-02",
        "LE-INV-09"
      ],
      "closesDefect": [
        "D17"
      ],
      "expectedCode": "EMOPS04-E019"
    },
    {
      "id": "unresolved-effectivity",
      "kind": "negative",
      "input": "Lot-based substitution is applied without a lot master.",
      "expect": "The application is rejected.",
      "target": "candidate-allocation-offline-lot-batch",
      "violates": [
        "LOT-INV-06"
      ],
      "closesDefect": [
        "D10"
      ],
      "expectedCode": "EMOPS04-E011"
    },
    {
      "id": "F-LOT-001",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "positive",
      "input": "Two lots share lotCode 'A-77' under different issuers and schemes.",
      "expect": "Both validate; the alternate key is issuer and scheme scoped.",
      "violates": [
        "LOT-INV-01"
      ],
      "closesDefect": [
        "D5"
      ]
    },
    {
      "id": "F-LOT-002",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "Two lots share lotCode, issuerRef and identifierSchemeRef with different lotId values.",
      "expect": "The second lot is rejected on the alternate key.",
      "violates": [
        "LOT-INV-01"
      ],
      "closesDefect": [
        "D5"
      ],
      "expectedCode": "EMOPS04-E003"
    },
    {
      "id": "F-LOT-003",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "positive",
      "input": "A serialized member is bound to lot L by a LotMembership with memberKind, validFrom, sourceEventRef and assertionBasis.",
      "expect": "Membership validates as provenance only.",
      "violates": [
        "LOT-INV-03"
      ],
      "closesDefect": [
        "D19"
      ]
    },
    {
      "id": "F-LOT-004",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "A lot membership is asserted with no sourceEventRef.",
      "expect": "The membership is rejected as unevidenced.",
      "violates": [
        "LOT-INV-03",
        "LOT-INV-05"
      ],
      "closesDefect": [
        "D19"
      ],
      "expectedCode": "EMOPS04-E013"
    },
    {
      "id": "F-LOT-005",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "positive",
      "input": "Lot L is lifecycleState partiallyConsumed and dispositionState quarantined at the same time.",
      "expect": "Both axes record independently with dispositionValidFrom.",
      "violates": [
        "LOT-INV-07"
      ],
      "closesDefect": [
        "D6"
      ]
    },
    {
      "id": "F-LOT-006",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "Quarantine is written into the single collapsed lifecycle field, erasing the consumption state.",
      "expect": "The collapse is rejected.",
      "violates": [
        "LOT-INV-07"
      ],
      "closesDefect": [
        "D6"
      ],
      "expectedCode": "EMOPS04-E004"
    },
    {
      "id": "F-LOT-007",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "A lot quantity carries a unit with no basis or unit code-list version.",
      "expect": "The quantity is rejected.",
      "violates": [
        "LOT-INV-04",
        "LE-INV-02"
      ],
      "closesDefect": [
        "D8"
      ],
      "expectedCode": "EMOPS04-E008"
    },
    {
      "id": "F-LOT-008",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "The lot record asserts the as-built composition of a serialized member.",
      "expect": "The assertion is rejected as outside lot mastership.",
      "violates": [
        "LOT-INV-03",
        "LE-INV-05"
      ],
      "closesDefect": [
        "D17"
      ],
      "expectedCode": "EMOPS04-E038"
    },
    {
      "id": "F-LOT-009",
      "target": "candidate-allocation-offline-lot-batch",
      "kind": "negative",
      "input": "A recalled lot's identifier is reassigned to a replacement batch.",
      "expect": "The reuse is rejected and recall genealogy is preserved.",
      "violates": [
        "LOT-INV-08",
        "LOT-INV-09"
      ],
      "closesDefect": [
        "D5"
      ],
      "expectedCode": "EMOPS04-E023"
    }
  ],
  "contourId": "EM-OPS-04",
  "target": "candidate-allocation-offline-lot-batch",
  "errorCodeRegistryRef": "error-codes.json",
  "defectRegistryRef": "audit-defects.json"
}
