{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://wallet.credenco.com/api/public/schemas/integration/audit-recorded/v1.json",
  "title": "AuditRecorded.v1",
  "description": "Audit-trail metadata for a single record written to the Business Wallet history log. The free-form 'evidence' blob of the underlying record is deliberately not part of this contract.",
  "type": "object",
  "required": ["walletExternalKey", "category", "action", "eventDate"],
  "additionalProperties": true,
  "properties": {
    "walletExternalKey": {"type": "string"},
    "userName": {"type": ["string", "null"]},
    "category": {
      "type": "string",
      "description": "Audited area. Mirrors the HistoryEvent enum; new values may be added within v1. INTEGRATION records are never emitted — they audit the integration pipeline itself.",
      "examples": ["CREDENTIAL", "PRESENTATION"]
    },
    "action": {
      "type": "string",
      "description": "Audited action. Mirrors the HistoryAction enum; new values may be added within v1. The CHANNEL_* and DELIVERY_* actions only ever occur on INTEGRATION records, so they never appear in this event.",
      "examples": ["OFFER_RECEIVED", "OFFER_ACCEPTED", "DELETED"]
    },
    "party": {
      "type": ["string", "null"],
      "description": "Counterparty the action concerned, e.g. the issuer or verifier URL."
    },
    "credentialUuids": {
      "type": "array",
      "description": "Credentials the audited action touched, identified by the 'id' claim of the credential document — not the wallet's credentialExternalKey used by the other events in this catalog. Empty when the action is not credential-scoped.",
      "items": {"type": "string"}
    },
    "eventDate": {"type": "string"}
  }
}
