{
  "title": "Fictional schema-change exercise",
  "guide": "https://yenra.com/adaptive-data-integration/",
  "fictional": true,
  "instructions": [
    "Validate only the records in source_batch under rules. Other top-level fields are exercise instructions.",
    "Retain the delivery_note in raw input; the destination maps only approved fields.",
    "Compute quantity times unit_price_cents for each accepted order. All amounts are USD cents.",
    "Quarantine invalid records and show the partial batch as incomplete.",
    "Apply the source correction to the held order, then replay the batch; identical accepted orders must not duplicate.",
    "Compare results with expected. Changed accepted values require a separately approved correction path."
  ],
  "rules": {
    "order_id": "Unique nonempty string, one line per order in this exercise",
    "quantity": "Positive integer; text is invalid",
    "unit_price_cents": "Nonnegative integer",
    "currency": "USD",
    "approved_fields": [
      "order_id",
      "quantity",
      "unit_price_cents",
      "currency"
    ],
    "excluded": [
      "tax",
      "shipping",
      "discounts",
      "multiple lines per order"
    ],
    "replay": "Identical accepted order_id and values are a no-op; conflicting accepted values require review"
  },
  "source_batch": [
    {
      "order_id": "A101",
      "quantity": 2,
      "unit_price_cents": 1250,
      "currency": "USD",
      "delivery_note": "Side entrance"
    },
    {
      "order_id": "A102",
      "quantity": 3,
      "unit_price_cents": 800,
      "currency": "USD",
      "delivery_note": ""
    },
    {
      "order_id": "A103",
      "quantity": "two",
      "unit_price_cents": 900,
      "currency": "USD",
      "delivery_note": "Call on arrival"
    }
  ],
  "source_correction": {
    "order_id": "A103",
    "quantity": 2,
    "unit_price_cents": 900,
    "currency": "USD",
    "delivery_note": "Call on arrival"
  },
  "expected": {
    "initial_received": 3,
    "initial_accepted": 2,
    "initial_quarantined": 1,
    "initial_total_cents": 4900,
    "correction_additional_cents": 1800,
    "final_unique_accepted": 3,
    "final_quarantined": 0,
    "final_total_cents": 6700,
    "after_identical_replay_unique_accepted": 3,
    "after_identical_replay_total_cents": 6700
  }
}
