{
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "2.0",
      "default": "2.0",
      "title": "Schema Version",
      "type": "string"
    },
    "tenant_id": {
      "maxLength": 100,
      "minLength": 1,
      "title": "Tenant Id",
      "type": "string"
    },
    "source": {
      "pattern": "^[a-z][a-z0-9_]{0,63}$",
      "title": "Source",
      "type": "string"
    },
    "source_instance_id": {
      "maxLength": 100,
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9_:\\-]+$",
      "title": "Source Instance Id",
      "type": "string"
    },
    "source_event_id": {
      "maxLength": 120,
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9_:.\\-]+$",
      "title": "Source Event Id",
      "type": "string"
    },
    "subject_key": {
      "anyOf": [
        {
          "pattern": "^[a-zA-Z0-9_\\-]{8,120}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject Key"
    },
    "caused_by": {
      "anyOf": [
        {
          "pattern": "^[a-f0-9]{64}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Caused By"
    },
    "event_type": {
      "enum": [
        "click",
        "registration",
        "kyc",
        "deposit",
        "ftd",
        "partner_ftd",
        "ngr",
        "commission",
        "payout",
        "lead",
        "qualified_lead",
        "sale",
        "funded_account",
        "partner_conversion",
        "revenue"
      ],
      "title": "Event Type",
      "type": "string"
    },
    "occurred_at": {
      "format": "date-time",
      "title": "Occurred At",
      "type": "string"
    },
    "received_at": {
      "format": "date-time",
      "title": "Received At",
      "type": "string"
    },
    "economic_period_start": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Economic Period Start"
    },
    "economic_period_end": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Economic Period End"
    },
    "operator_id": {
      "maxLength": 100,
      "minLength": 1,
      "title": "Operator Id",
      "type": "string"
    },
    "partner_id": {
      "maxLength": 100,
      "minLength": 1,
      "title": "Partner Id",
      "type": "string"
    },
    "campaign_id": {
      "maxLength": 100,
      "minLength": 1,
      "title": "Campaign Id",
      "type": "string"
    },
    "geo": {
      "pattern": "^[A-Z]{2}$",
      "title": "Geo",
      "type": "string"
    },
    "currency": {
      "pattern": "^[A-Z]{3}$",
      "title": "Currency",
      "type": "string"
    },
    "amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,16}|(?=[\\d.]{1,19}0*$)\\d{0,16}\\.\\d{0,2}0*$)",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Amount"
    },
    "status": {
      "default": "confirmed",
      "enum": [
        "confirmed",
        "pending",
        "rejected"
      ],
      "title": "Status",
      "type": "string"
    },
    "synthetic": {
      "default": false,
      "title": "Synthetic",
      "type": "boolean"
    }
  },
  "required": [
    "tenant_id",
    "source",
    "source_instance_id",
    "source_event_id",
    "event_type",
    "occurred_at",
    "received_at",
    "operator_id",
    "partner_id",
    "campaign_id",
    "geo",
    "currency"
  ],
  "title": "Event",
  "type": "object"
}
