{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/diligenceops-product-to-proof-loop.schema.json",
  "title": "DiligenceOps Product-to-Proof Loop",
  "type": "object",
  "required": ["schema_version", "workflow_context"],
  "properties": {
    "schema_version": { "const": "diligenceops_product_to_proof_loop.v1" },
    "checkout_id": { "type": "string" },
    "payment_reference": { "type": "string" },
    "agent_credit_id": { "type": "string" },
    "operator_decision": { "type": "string", "enum": ["success_criteria_met", "ready_to_return", "approved_for_return", "needs_followup", "hold"] },
    "requester": { "type": "object" },
    "workflow_context": {
      "type": "object",
      "required": ["diligence_scope", "available_evidence"],
      "properties": {
        "diligence_scope": { "type": "string" },
        "available_evidence": { "type": "array", "items": { "type": "string" } }
      },
      "additionalProperties": true
    },
    "callback_url": { "type": "string", "format": "uri" },
    "allow_without_payment": { "type": "boolean" }
  },
  "additionalProperties": true
}
