{
  "format": "gostly.synthetic-order-view.v1",
  "packet_version": "1.0.0",
  "synthetic": true,
  "provenance": "Authored request, response and consumer expectations for one frontend date-formatting defect and its controls. No captured provider traffic.",
  "scope": "A local consumer exercise, not a Gostly import format, recording, live HTTP request or replay receipt.",
  "request": {
    "method": "GET",
    "path": "/orders/order_demo_001"
  },
  "expected_order_id": "order_demo_001",
  "contract": {
    "name": "order-delivery-view-v1",
    "response": "HTTP 200, object body, matching order ID and non-negative safe-integer total_minor.",
    "delivery_date": "Required field. Empty string or null means unavailable. Otherwise a real calendar date in exactly YYYY-MM-DD form. Display the original date-only string without timezone conversion.",
    "exclusions": "No ETA freshness, provider truth, authentication, arbitrary ISO timestamps or full application workflow is established."
  },
  "cases": [
    {
      "id": "empty_string",
      "purpose": "The bug trigger: the API has no delivery estimate.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200, "delivery_date": "" } },
      "expected": { "kind": "view", "value": { "id": "order_demo_001", "totalMinor": 4200, "deliveryText": "Delivery estimate unavailable" } }
    },
    {
      "id": "null_estimate",
      "purpose": "Explicitly absent estimate must not become an epoch date.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200, "delivery_date": null } },
      "expected": { "kind": "view", "value": { "id": "order_demo_001", "totalMinor": 4200, "deliveryText": "Delivery estimate unavailable" } }
    },
    {
      "id": "normal_date",
      "purpose": "Known normal date remains usable after the correction.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200, "delivery_date": "2026-10-30" } },
      "expected": { "kind": "view", "value": { "id": "order_demo_001", "totalMinor": 4200, "deliveryText": "Delivery estimate: 2026-10-30" } }
    },
    {
      "id": "malformed_date",
      "purpose": "A nonempty malformed date is an error rather than an absent estimate.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200, "delivery_date": "not-a-date" } },
      "expected": { "kind": "error", "code": "INVALID_DELIVERY_DATE_FORMAT" }
    },
    {
      "id": "impossible_date",
      "purpose": "Do not normalize a nonexistent calendar day into a different estimate.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200, "delivery_date": "2026-02-30" } },
      "expected": { "kind": "error", "code": "INVALID_CALENDAR_DATE" }
    },
    {
      "id": "missing_date",
      "purpose": "A missing required field differs from explicit absence.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": 4200 } },
      "expected": { "kind": "error", "code": "MISSING_DELIVERY_DATE" }
    },
    {
      "id": "wrong_order_id",
      "purpose": "Do not render a different order's response.",
      "response": { "status": 200, "body": { "id": "order_other_002", "total_minor": 4200, "delivery_date": "2026-10-30" } },
      "expected": { "kind": "error", "code": "UNEXPECTED_ORDER_ID" }
    },
    {
      "id": "http_error",
      "purpose": "An unavailable API is not a valid order view.",
      "response": { "status": 503, "body": { "error": "temporarily_unavailable" } },
      "expected": { "kind": "error", "code": "HTTP_STATUS" }
    },
    {
      "id": "invalid_total",
      "purpose": "The correction must retain the amount guard.",
      "response": { "status": 200, "body": { "id": "order_demo_001", "total_minor": -1, "delivery_date": "2026-10-30" } },
      "expected": { "kind": "error", "code": "INVALID_TOTAL" }
    }
  ]
}
