{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/connections-icu/json-schema/connections-icu-hosted-event-confirmation-goal-schema.json",
  "title": "HostedEventConfirmationGoal",
  "description": "Public-safe aggregate for an event that proceeds only after a people or conditional-value target is met. Interest mode creates no ticket or payment. Reservation mode saves a card through Pay and charges only after confirmation; currentAmountCents is conditionally reserved value, never collected revenue.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/connections-icu-events-openapi.yml#/components/schemas/HostedEventConfirmationGoal",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "eventId": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "interest",
        "reservation"
      ]
    },
    "measure": {
      "type": "string",
      "enum": [
        "people",
        "money"
      ]
    },
    "targetCount": {
      "type": "integer",
      "minimum": 1
    },
    "targetAmountCents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO currency for a money goal; null for people goals."
    },
    "deadlineAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "collecting",
        "settling",
        "confirmed",
        "not_met",
        "canceled"
      ]
    },
    "currentCount": {
      "type": "integer",
      "minimum": 0
    },
    "currentAmountCents": {
      "type": "integer",
      "minimum": 0,
      "description": "Conditional saved-card reservation value. It is not captured or collected money."
    },
    "thresholdReachedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "confirmedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "failedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "canceledAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "viewerCommitmentStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "active",
        "withdrawing",
        "charge_pending",
        "charged",
        "charge_failed",
        "released",
        "withdrawn",
        null
      ],
      "description": "Present only for a signed-in viewer. Anonymous reads receive null."
    },
    "viewerOrderId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The signed-in viewer's reservation order id."
    },
    "viewerAmountCents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "viewerPaymentStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "pending",
        "setup_required",
        "reserved",
        "charged",
        "charge_failed",
        "released",
        null
      ]
    },
    "locked": {
      "type": "boolean",
      "description": "True after the first commitment, when the host may cancel but may no longer rewrite the goal terms."
    }
  }
}