{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Non-normative, domain-neutral fixtures for the canonical Write contract.",
  "fixtures": [
    {
      "name": "direct-create",
      "operationId": "createRecord",
      "request": {
        "path": {"collectionId": "records"},
        "headers": {"Idempotency-Key": "\"018f47d2-4c42-7ca4-bf47-2bd31f88b922\""},
        "body": {
          "data": {"exampleField": "example value"},
          "source": {
            "system": "https://source.example/systems/register",
            "revision": "source-revision-17",
            "recordedAt": "2026-11-04T08:00:00Z"
          }
        }
      },
      "response": {
        "status": 201,
        "headers": {
          "Location": "/v1/collections/records/records/r_42",
          "ETag": "\"record-7fa9\"",
          "Cache-Control": "no-store"
        },
        "body": {"collectionId": "records", "recordId": "r_42", "etag": "\"record-7fa9\""}
      }
    },
    {
      "name": "governed-update-submission",
      "operationId": "submitChangeRequest",
      "request": {
        "headers": {"Idempotency-Key": "\"018f47d2-4c42-7ca4-bf47-2bd31f88b923\""},
        "body": {
          "kind": "update",
          "target": {"collectionId": "records", "recordId": "r_42"},
          "baseETag": "\"record-7fa9\"",
          "inputMediaType": "application/merge-patch+json",
          "input": {"data": {"exampleField": "changed value"}}
        }
      },
      "response": {
        "status": 201,
        "headers": {
          "Location": "/v1/change-requests/cr_7",
          "ETag": "\"change-request-7-v1-pending\"",
          "Cache-Control": "no-store"
        },
        "body": {
          "changeRequestId": "cr_7",
          "proposalVersion": 1,
          "kind": "update",
          "target": {"collectionId": "records", "recordId": "r_42"},
          "baseETag": "\"record-7fa9\"",
          "inputMediaType": "application/merge-patch+json",
          "input": {"data": {"exampleField": "changed value"}},
          "reviewState": "pending",
          "applicationState": "not-started",
          "submittedAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:00:00Z"
        }
      }
    },
    {
      "name": "approved-not-yet-applied",
      "operationId": "approveChangeRequest",
      "request": {
        "path": {"changeRequestId": "cr_7"},
        "headers": {
          "If-Match": "\"change-request-7-v1-pending\"",
          "Idempotency-Key": "\"018f47d2-4c42-7ca4-bf47-2bd31f88b924\""
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "ETag": "\"change-request-7-v1-approved\"",
          "Cache-Control": "no-store"
        },
        "body": {
          "changeRequestId": "cr_7",
          "proposalVersion": 1,
          "kind": "update",
          "target": {"collectionId": "records", "recordId": "r_42"},
          "baseETag": "\"record-7fa9\"",
          "inputMediaType": "application/merge-patch+json",
          "input": {"data": {"exampleField": "changed value"}},
          "reviewState": "approved",
          "applicationState": "not-started",
          "submittedAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:03:00Z"
        }
      }
    },
    {
      "name": "application-blocked-by-source-change",
      "schema": "#/components/schemas/ChangeRequest",
      "value": {
        "changeRequestId": "cr_7",
        "proposalVersion": 1,
        "kind": "update",
        "target": {"collectionId": "records", "recordId": "r_42"},
        "baseETag": "\"record-7fa9\"",
        "inputMediaType": "application/merge-patch+json",
        "input": {"data": {"exampleField": "changed value"}},
        "reviewState": "approved",
        "applicationState": "blocked",
        "error": {
          "type": "https://govstack.global/problems/digital-registries/source-precondition-failed",
          "title": "Source Record changed",
          "traceId": "6f1c3f0e2a9b4c8d7e6f5a4b3c2d1e0f"
        },
        "submittedAt": "2026-11-04T08:00:00Z",
        "updatedAt": "2026-11-04T08:04:00Z"
      }
    },
    {
      "name": "background-create-accepted",
      "operationId": "createRecord",
      "request": {
        "path": {
          "collectionId": "records"
        },
        "headers": {
          "Idempotency-Key": "\"018f47d2-4c42-7ca4-bf47-2bd31f88b925\""
        },
        "body": {
          "data": {
            "exampleField": "example value"
          },
          "source": {
            "system": "https://source.example/systems/register",
            "revision": "source-revision-17",
            "recordedAt": "2026-11-04T08:00:00Z"
          }
        }
      },
      "response": {
        "status": 202,
        "headers": {
          "Location": "/v1/operations/op_7",
          "Cache-Control": "no-store"
        },
        "body": {
          "operationId": "op_7",
          "status": "pending",
          "createdAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:00:00Z"
        }
      }
    },
    {
      "name": "background-create-running",
      "operationId": "getOperation",
      "request": {
        "path": {
          "operationId": "op_7"
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "Cache-Control": "no-store"
        },
        "body": {
          "operationId": "op_7",
          "status": "running",
          "createdAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:00:05Z",
          "progress": 40
        }
      }
    },
    {
      "name": "background-create-succeeded",
      "operationId": "getOperation",
      "request": {
        "path": {
          "operationId": "op_7"
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "Cache-Control": "no-store"
        },
        "body": {
          "operationId": "op_7",
          "status": "succeeded",
          "createdAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:00:05Z",
          "result": {
            "collectionId": "records",
            "recordId": "r_42",
            "etag": "\"record-7fa9\""
          }
        }
      }
    },
    {
      "name": "background-create-failed",
      "operationId": "getOperation",
      "request": {
        "path": {
          "operationId": "op_7"
        }
      },
      "response": {
        "status": 200,
        "headers": {
          "Cache-Control": "no-store"
        },
        "body": {
          "operationId": "op_7",
          "status": "failed",
          "createdAt": "2026-11-04T08:00:00Z",
          "updatedAt": "2026-11-04T08:00:05Z",
          "error": {
            "type": "https://registry.example/problems/source-unavailable",
            "title": "Authoritative source unavailable",
            "traceId": "6f1c3f0e2a9b4c8d7e6f5a4b3c2d1e0f"
          }
        }
      }
    }
  ]
}
