{
 "use_case": "certificate-check",
 "title": "Certificate request check: a Texas framing subcontract against four policies",
 "about": "A synthetic subcontract insurance exhibit, the GC's request email (which adds a lender as additional insured on the certificate) and the framer's GL, auto, umbrella and WC papers. Completed-operations additional insured must come back as needing an endorsement, every 'met' must quote the policy, and the signed record must verify.",
 "licence": "Synthetic: the companies, insurers, form numbers and wording are invented; no ISO or ACORD text. Part of decosa-api.",
 "inputs": [
  {
   "file": "inputs/contract.json",
   "what": "The contract's insurance exhibit."
  },
  {
   "file": "inputs/request.json",
   "what": "The holder's request email."
  },
  {
   "file": "inputs/policies.json",
   "what": "Four policies: declarations, forms schedules and endorsement wording."
  }
 ],
 "steps": [
  {
   "id": "check",
   "method": "POST",
   "path": "/certificate/check",
   "body": {
    "state": "TX",
    "holder": "Brasswell Builders LP (fictional)",
    "insured": "Tinwhistle Framing LLC (fictional)",
    "contract": {
     "$file": "inputs/contract.json"
    },
    "request": {
     "$file": "inputs/request.json"
    },
    "policies": {
     "$file": "inputs/policies.json"
    }
   }
  },
  {
   "id": "verify",
   "method": "POST",
   "path": "/record/verify",
   "auth": false,
   "body": {
    "record": {
     "$ref": "check.record"
    }
   }
  }
 ],
 "checks": [
  {
   "says": "completed-operations additional insured needs an endorsement",
   "path": "check.requirements[kind=ai_completed_ops][0].status",
   "equals": "needs_endorsement"
  },
  {
   "says": "the GL each-occurrence limit is met, quoting the declarations",
   "path": "check.requirements[kind=gl_each_occurrence][0].policy_quote",
   "contains": "1,000,000"
  },
  {
   "says": "a carrier request is drafted",
   "path": "check.drafts.carrier_request",
   "contains": "Additional insured, completed operations"
  },
  {
   "says": "the signed record verifies",
   "path": "verify.ok",
   "equals": true
  },
  {
   "says": "every model call has a signed receipt",
   "receipts": "signed",
   "min": 10
  }
 ]
}