{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://extol.work/attestation/org/v1/onboarding-verification/schema.json",
  "title": "Onboarding verification (Extol trust anchor)",
  "description": "Extol's on-chain record of observed events during an organization's Pattern 3 setup. Abstractor posture: records what Extol observed, does not certify underlying facts. See https://extol.work/attestation/org/v1/onboarding-verification for the human-readable specification.",
  "type": "object",
  "required": ["officer_signup", "org_metadata_entered", "teos_lookup", "feature_activation", "terms_uri"],
  "properties": {
    "officer_signup": {
      "type": "object",
      "required": ["user_id", "signed_up_at"],
      "properties": {
        "user_id": { "type": "string", "format": "uuid", "description": "Extol user record ID" },
        "email": { "type": "string", "format": "email", "description": "Officer's email at signup" },
        "signed_up_at": { "type": "string", "format": "date-time" }
      }
    },
    "org_metadata_entered": {
      "type": "object",
      "required": ["legal_name", "ein"],
      "properties": {
        "legal_name": { "type": "string", "description": "Legal name as typed by officer" },
        "ein": { "type": "string", "pattern": "^[0-9]{2}-[0-9]{7}$" },
        "entered_at": { "type": "string", "format": "date-time" }
      }
    },
    "teos_lookup": {
      "type": "object",
      "required": ["checked_at", "status"],
      "properties": {
        "checked_at": { "type": "string", "format": "date-time" },
        "status": {
          "type": "string",
          "enum": ["verified_501c3", "verified_501c4", "revoked", "pending", "not_found", "api_error", "other"]
        },
        "legal_name_returned": { "type": "string", "description": "Legal name as returned by IRS TEOS (may differ from officer-entered)" },
        "deductibility_code": { "type": "string" },
        "revocation_date": { "type": "string", "format": "date-time", "description": "Present only when status=revoked" }
      }
    },
    "feature_activation": {
      "type": "object",
      "required": ["feature", "activated_at"],
      "properties": {
        "feature": { "type": "string", "description": "e.g., statement" },
        "activated_at": { "type": "string", "format": "date-time" },
        "disclosure_accepted": { "type": "boolean", "description": "Officer clicked confirm on the feature-activation disclosure modal" }
      }
    },
    "terms_uri": {
      "type": "string",
      "format": "uri",
      "description": "Pointer to the versioned Pattern 3 attestation terms in effect at issuance"
    }
  }
}
