{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trusgent-com/json-schema/trusgent-com-merged-registry-profile-schema.json",
  "title": "MergedRegistryProfile",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trusgent-com-openapi.yml#/components/schemas/MergedRegistryProfile",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string"
    },
    "apiVersion": {
      "type": "string"
    },
    "registryId": {
      "type": "string"
    },
    "official": {
      "$ref": "#/$defs/RegistryRecord"
    },
    "claimed": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "agentId": {
          "type": "string"
        },
        "profileUrl": {
          "type": "string"
        },
        "jsonUrl": {
          "type": "string"
        }
      }
    },
    "enrichment": {
      "type": [
        "object",
        "null"
      ]
    },
    "trustBreakdown": {
      "type": "object",
      "properties": {
        "officialRegistry": {
          "type": "integer"
        },
        "merchantClaim": {
          "type": "integer"
        },
        "enrichmentConfirmed": {
          "type": "integer"
        },
        "completeness": {
          "type": "integer"
        },
        "auxiliaryReviews": {
          "type": "integer"
        },
        "formulaVersion": {
          "type": "string"
        },
        "totalHint": {
          "type": "integer"
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "dossierLayers": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "citationPolicy": {
      "type": "object"
    },
    "recommendedUse": {
      "type": "object",
      "properties": {
        "identity": {
          "type": "string"
        },
        "hours": {
          "type": "string"
        },
        "contact": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "RegistryRecord": {
      "type": "object",
      "properties": {
        "registryId": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "licenseNo": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "nameZh": {
          "type": "string"
        },
        "district": {
          "type": "string"
        },
        "licenseType": {
          "type": "string"
        },
        "profileUrl": {
          "type": "string"
        },
        "jsonUrl": {
          "type": "string"
        },
        "provenance": {
          "type": "object"
        },
        "verification": {
          "type": "object",
          "properties": {
            "level": {
              "type": "string"
            },
            "note": {
              "type": "string"
            }
          }
        },
        "claimedTrusgentId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Computed ACTIVE PRIMARY Agent handle from registry_agent_links (not a DB column)."
        },
        "businessLicenseNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "businessVerifiedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Entity-layer (/r) business licence verification timestamp."
        }
      }
    }
  }
}