{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/hyperscale0/hyperscale-udl/main/spec/udl.schema.json",
  "title": "UDL document, format version 2",
  "description": "Generated from the Zod grammar in src/schema.ts by scripts/emit-spec.ts. Edits belong in the grammar. This schema pins document shape only; the semantic laws it cannot express are checked by src/validation.ts and test/.",
  "type": "object",
  "properties": {
    "udl": {
      "$ref": "#/$defs/__schema0"
    },
    "version": {
      "$ref": "#/$defs/__schema1"
    },
    "product": {
      "$ref": "#/$defs/__schema3"
    },
    "title": {
      "$ref": "#/$defs/__schema4"
    },
    "currency": {
      "$ref": "#/$defs/__schema5"
    },
    "parties": {
      "$ref": "#/$defs/__schema6"
    },
    "objects": {
      "$ref": "#/$defs/__schema7"
    },
    "instruments": {
      "$ref": "#/$defs/__schema30"
    }
  },
  "required": [
    "udl",
    "version",
    "product",
    "title",
    "currency",
    "parties",
    "objects",
    "instruments"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "number",
      "const": 2
    },
    "__schema1": {
      "exclusiveMinimum": 0,
      "$ref": "#/$defs/__schema2"
    },
    "__schema2": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "__schema3": {
      "type": "string",
      "maxLength": 80,
      "pattern": "^[a-z][a-zA-Z0-9_]*$"
    },
    "__schema4": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "__schema5": {
      "type": "string",
      "const": "SAR"
    },
    "__schema6": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema3"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "person",
              "business",
              "staff"
            ]
          },
          "role": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "required": [
          "kind"
        ],
        "additionalProperties": false
      }
    },
    "__schema7": {
      "maxItems": 256,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema8"
      }
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "entryActions": {
          "minItems": 1,
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "id": {
          "$ref": "#/$defs/__schema9"
        },
        "title": {
          "$ref": "#/$defs/__schema4"
        },
        "authoredFields": {
          "maxItems": 256,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "attachments": {
          "maxItems": 256,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema10"
          }
        },
        "fields": {
          "maxItems": 256,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema12"
          }
        },
        "columns": {
          "maxItems": 8,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        }
      },
      "required": [
        "id",
        "title",
        "authoredFields",
        "attachments",
        "fields",
        "columns"
      ],
      "additionalProperties": false
    },
    "__schema9": {
      "x-udl-reference": "object",
      "$ref": "#/$defs/__schema3"
    },
    "__schema10": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "title": {
          "$ref": "#/$defs/__schema4"
        },
        "parent": {
          "$ref": "#/$defs/__schema3"
        },
        "instrument": {
          "$ref": "#/$defs/__schema11"
        },
        "parties": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema3"
          },
          "additionalProperties": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "actor",
                      "operator"
                    ]
                  }
                },
                "required": [
                  "role"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "party": {
                    "$ref": "#/$defs/__schema3"
                  }
                },
                "required": [
                  "party"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "name",
        "instrument",
        "parties"
      ],
      "additionalProperties": false
    },
    "__schema11": {
      "x-udl-reference": "instrument",
      "$ref": "#/$defs/__schema3"
    },
    "__schema12": {
      "oneOf": [
        {
          "$ref": "#/$defs/__schema13"
        },
        {
          "$ref": "#/$defs/__schema19"
        },
        {
          "$ref": "#/$defs/__schema22"
        },
        {
          "$ref": "#/$defs/__schema23"
        },
        {
          "$ref": "#/$defs/__schema24"
        },
        {
          "$ref": "#/$defs/__schema25"
        },
        {
          "$ref": "#/$defs/__schema26"
        },
        {
          "$ref": "#/$defs/__schema27"
        },
        {
          "$ref": "#/$defs/__schema28"
        },
        {
          "$ref": "#/$defs/__schema29"
        }
      ]
    },
    "__schema13": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "money"
        },
        "value": {
          "$ref": "#/$defs/__schema18"
        },
        "minimum": {
          "$ref": "#/$defs/__schema18"
        },
        "maximum": {
          "$ref": "#/$defs/__schema18"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema14": {
      "$ref": "#/$defs/__schema4"
    },
    "__schema15": {
      "type": "boolean",
      "const": true
    },
    "__schema16": {
      "$ref": "#/$defs/__schema4"
    },
    "__schema17": {
      "type": "boolean",
      "const": true
    },
    "__schema18": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,17})$"
    },
    "__schema19": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "ref"
        },
        "targetKind": {
          "type": "string",
          "enum": [
            "instrument",
            "object"
          ]
        },
        "targetFamily": {
          "$ref": "#/$defs/__schema20"
        },
        "target": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema3"
            },
            {
              "minItems": 1,
              "maxItems": 16,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema3"
              }
            }
          ]
        }
      },
      "required": [
        "name",
        "type",
        "targetKind",
        "target"
      ],
      "additionalProperties": false
    },
    "__schema20": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "module": {
              "$ref": "#/$defs/__schema3"
            },
            "exportPath": {
              "$ref": "#/$defs/__schema21"
            },
            "digest": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "required": [
            "module",
            "exportPath",
            "digest"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "module": {
              "$ref": "#/$defs/__schema3"
            },
            "exportPath": {
              "$ref": "#/$defs/__schema21"
            },
            "revision": {
              "exclusiveMinimum": 0,
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "module",
            "exportPath",
            "revision"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema21": {
      "type": "string",
      "maxLength": 240,
      "pattern": "^[a-z][a-zA-Z0-9_]*(?:\\.[a-z][a-zA-Z0-9_]*)*$"
    },
    "__schema22": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "date"
        },
        "value": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema23": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "duration"
        },
        "value": {
          "exclusiveMinimum": 0,
          "$ref": "#/$defs/__schema2"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema24": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "text"
        },
        "value": {
          "$ref": "#/$defs/__schema4"
        },
        "minLength": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 2048,
          "$ref": "#/$defs/__schema2"
        },
        "maxLength": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 2048,
          "$ref": "#/$defs/__schema2"
        },
        "pattern": {
          "type": "string",
          "pattern": "^\\^\\[[A-Za-z0-9-]+\\]\\{[1-9][0-9]{0,3}\\}\\$$"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema25": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "integer"
        },
        "value": {
          "$ref": "#/$defs/__schema2"
        },
        "minimum": {
          "$ref": "#/$defs/__schema2"
        },
        "maximum": {
          "$ref": "#/$defs/__schema2"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema26": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "percent"
        },
        "value": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "$ref": "#/$defs/__schema2"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema27": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "boolean"
        },
        "value": {
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema28": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "enum"
        },
        "values": {
          "minItems": 1,
          "maxItems": 64,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "value": {
          "$ref": "#/$defs/__schema3"
        }
      },
      "required": [
        "name",
        "type",
        "values"
      ],
      "additionalProperties": false
    },
    "__schema29": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema3"
        },
        "label": {
          "$ref": "#/$defs/__schema14"
        },
        "optional": {
          "$ref": "#/$defs/__schema15"
        },
        "description": {
          "$ref": "#/$defs/__schema16"
        },
        "sensitive": {
          "$ref": "#/$defs/__schema17"
        },
        "type": {
          "type": "string",
          "const": "list"
        },
        "item": {
          "type": "string",
          "enum": [
            "money",
            "date",
            "text",
            "integer",
            "ref"
          ]
        },
        "targetKind": {
          "type": "string",
          "enum": [
            "instrument",
            "object"
          ]
        },
        "targetFamily": {
          "$ref": "#/$defs/__schema20"
        },
        "target": {
          "$ref": "#/$defs/__schema3"
        },
        "maxItems": {
          "type": "integer",
          "minimum": 1,
          "maximum": 366,
          "$ref": "#/$defs/__schema2"
        }
      },
      "required": [
        "name",
        "type",
        "item",
        "maxItems"
      ],
      "additionalProperties": false
    },
    "__schema30": {
      "maxItems": 256,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema31"
      }
    },
    "__schema31": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string",
          "const": "product"
        },
        "reports": {
          "maxItems": 16,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema32"
          }
        },
        "revisioned": {
          "type": "boolean",
          "const": true
        },
        "oncePerRecord": {
          "type": "object",
          "properties": {
            "reopenOn": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema3"
              }
            }
          },
          "required": [
            "reopenOn"
          ],
          "additionalProperties": false
        },
        "family": {
          "$ref": "#/$defs/__schema20"
        },
        "id": {
          "$ref": "#/$defs/__schema11"
        },
        "subject": {
          "$ref": "#/$defs/__schema9"
        },
        "template": {
          "$ref": "#/$defs/__schema3"
        },
        "title": {
          "$ref": "#/$defs/__schema4"
        },
        "summary": {
          "$ref": "#/$defs/__schema4"
        },
        "fields": {
          "maxItems": 256,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema48"
          }
        },
        "calculate": {
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema49"
          }
        },
        "lifecycle": {
          "type": "object",
          "properties": {
            "states": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema3"
              }
            },
            "labels": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema3"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema4"
              }
            },
            "initial": {
              "$ref": "#/$defs/__schema3"
            },
            "transitions": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema3"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "from": {
                    "minItems": 1,
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/__schema3"
                    }
                  },
                  "to": {
                    "$ref": "#/$defs/__schema3"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "states",
            "initial",
            "transitions"
          ],
          "additionalProperties": false
        },
        "actions": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema3"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "allowZero": {
                "type": "boolean",
                "const": true
              },
              "purpose": {
                "type": "string",
                "enum": [
                  "obligation",
                  "option"
                ]
              },
              "summary": {
                "$ref": "#/$defs/__schema4"
              },
              "title": {
                "$ref": "#/$defs/__schema4"
              },
              "publicAction": {
                "$ref": "#/$defs/__schema3"
              },
              "expansionLimit": {
                "type": "number",
                "const": 8192
              },
              "reminder": {
                "type": "object",
                "properties": {
                  "installment": {
                    "$ref": "#/$defs/__schema21"
                  },
                  "recipient": {
                    "$ref": "#/$defs/__schema21"
                  },
                  "dueAt": {
                    "$ref": "#/$defs/__schema21"
                  },
                  "channel": {
                    "type": "string",
                    "const": "email"
                  },
                  "template": {
                    "type": "string",
                    "const": "payment_reminder"
                  },
                  "beforeDays": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 366,
                    "$ref": "#/$defs/__schema2"
                  },
                  "overdueDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 366,
                    "$ref": "#/$defs/__schema2"
                  },
                  "maxPerDay": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "$ref": "#/$defs/__schema2"
                  },
                  "startHour": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23,
                    "$ref": "#/$defs/__schema2"
                  },
                  "endHour": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 24,
                    "$ref": "#/$defs/__schema2"
                  },
                  "timezone": {
                    "$ref": "#/$defs/__schema4"
                  }
                },
                "required": [
                  "installment",
                  "recipient",
                  "dueAt",
                  "channel",
                  "template",
                  "beforeDays",
                  "overdueDays",
                  "maxPerDay",
                  "startHour",
                  "endHour",
                  "timezone"
                ],
                "additionalProperties": false
              },
              "event": {
                "$ref": "#/$defs/__schema4"
              },
              "actor": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "caller"
                  },
                  {
                    "type": "string",
                    "const": "clock"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "party": {
                        "$ref": "#/$defs/__schema3"
                      }
                    },
                    "required": [
                      "party"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "parent": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/__schema11"
                          },
                          {
                            "minItems": 1,
                            "maxItems": 16,
                            "type": "array",
                            "items": {
                              "$ref": "#/$defs/__schema11"
                            }
                          }
                        ]
                      }
                    },
                    "required": [
                      "parent"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "subject": {
                "type": "object",
                "properties": {
                  "requirements": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/__schema53"
                    }
                  },
                  "adapters": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/__schema57"
                    }
                  }
                },
                "required": [
                  "requirements",
                  "adapters"
                ],
                "additionalProperties": false
              },
              "follows": {
                "$ref": "#/$defs/__schema3"
              },
              "input": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema48"
                }
              },
              "requires": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema59"
                }
              },
              "due": {
                "$ref": "#/$defs/__schema60"
              },
              "deadline": {
                "$ref": "#/$defs/__schema60"
              },
              "set": {
                "type": "object",
                "propertyNames": {
                  "$ref": "#/$defs/__schema3"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema50"
                }
              },
              "calculate": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema49"
                }
              },
              "moves": {
                "maxItems": 256,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema61"
                }
              },
              "invoke": {
                "maxItems": 16,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema63"
                }
              }
            },
            "required": [
              "summary",
              "event",
              "actor",
              "input",
              "requires",
              "moves"
            ],
            "additionalProperties": false
          }
        },
        "actionOrder": {
          "minItems": 1,
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "invariants": {
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema59"
          }
        },
        "examples": {
          "maxItems": 16,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema64"
          }
        }
      },
      "required": [
        "id",
        "title",
        "summary",
        "fields",
        "calculate",
        "lifecycle",
        "actions",
        "actionOrder"
      ],
      "additionalProperties": false
    },
    "__schema32": {
      "type": "object",
      "properties": {
        "identity": {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "version": {
              "exclusiveMinimum": 0,
              "$ref": "#/$defs/__schema34"
            },
            "description": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          },
          "required": [
            "id",
            "version",
            "description"
          ],
          "additionalProperties": false
        },
        "scope": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "product",
                "company"
              ]
            },
            "classification": {
              "type": "string",
              "enum": [
                "internal",
                "personal",
                "restricted"
              ]
            },
            "currency": {
              "$ref": "#/$defs/__schema5"
            }
          },
          "required": [
            "kind",
            "classification",
            "currency"
          ],
          "additionalProperties": false
        },
        "datasets": {
          "minItems": 1,
          "maxItems": 16,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema35"
          }
        },
        "time": {
          "type": "object",
          "properties": {
            "timezone": {
              "type": "string",
              "const": "Asia/Riyadh"
            },
            "boundary": {
              "type": "string",
              "const": "startInclusiveEndExclusive"
            },
            "observation": {
              "type": "string",
              "const": "periodEnd"
            },
            "history": {
              "type": "string",
              "const": "retainedOnly"
            }
          },
          "required": [
            "timezone",
            "boundary",
            "observation",
            "history"
          ],
          "additionalProperties": false
        },
        "selection": {
          "type": "object",
          "properties": {
            "dataset": {
              "$ref": "#/$defs/__schema33"
            },
            "predicate": {
              "$ref": "#/$defs/__schema33"
            }
          },
          "required": [
            "dataset"
          ],
          "additionalProperties": false
        },
        "calculation": {
          "type": "object",
          "properties": {
            "joins": {
              "maxItems": 16,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema41"
              }
            },
            "expressions": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema40"
              }
            },
            "groupBy": {
              "maxItems": 8,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            },
            "aggregates": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema42"
              }
            },
            "resultExpressions": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema40"
              }
            }
          },
          "required": [
            "joins",
            "expressions",
            "groupBy",
            "aggregates",
            "resultExpressions"
          ],
          "additionalProperties": false
        },
        "validation": {
          "type": "object",
          "properties": {
            "empty": {
              "type": "string",
              "enum": [
                "refuse",
                "noEligibleFacilities"
              ]
            },
            "required": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            },
            "rowReconcile": {
              "maxItems": 16,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema43"
              }
            },
            "reconcile": {
              "maxItems": 16,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema44"
              }
            },
            "unavailableFacts": {
              "maxItems": 32,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema45"
              }
            }
          },
          "required": [
            "empty",
            "required",
            "rowReconcile",
            "reconcile",
            "unavailableFacts"
          ],
          "additionalProperties": false
        },
        "output": {
          "type": "object",
          "properties": {
            "profile": {
              "type": "string",
              "const": "internal.v1"
            },
            "formats": {
              "minItems": 1,
              "maxItems": 2,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema46"
              }
            },
            "columns": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema47"
              }
            },
            "sort": {
              "minItems": 1,
              "maxItems": 8,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            }
          },
          "required": [
            "profile",
            "formats",
            "columns",
            "sort"
          ],
          "additionalProperties": false
        },
        "authority": {
          "type": "object",
          "properties": {
            "request": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            },
            "read": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            },
            "release": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema33"
              }
            },
            "retention": {
              "type": "object",
              "properties": {
                "policy": {
                  "$ref": "#/$defs/__schema33"
                },
                "years": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100,
                  "$ref": "#/$defs/__schema34"
                }
              },
              "required": [
                "policy",
                "years"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "request",
            "read",
            "release",
            "retention"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "identity",
        "scope",
        "datasets",
        "time",
        "selection",
        "calculation",
        "validation",
        "output",
        "authority"
      ],
      "additionalProperties": false
    },
    "__schema33": {
      "type": "string",
      "maxLength": 80,
      "pattern": "^[a-z][a-zA-Z0-9_]*$"
    },
    "__schema34": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "__schema35": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema33"
        },
        "source": {
          "type": "string",
          "enum": [
            "instrument",
            "account",
            "identity",
            "operation"
          ]
        },
        "instruments": {
          "maxItems": 32,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema36"
          }
        },
        "rowKey": {
          "$ref": "#/$defs/__schema33"
        },
        "columns": {
          "minItems": 1,
          "maxItems": 64,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema37"
          }
        },
        "expressions": {
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema40"
          }
        },
        "selection": {
          "$ref": "#/$defs/__schema33"
        }
      },
      "required": [
        "id",
        "source",
        "instruments",
        "rowKey",
        "columns",
        "expressions"
      ],
      "additionalProperties": false
    },
    "__schema36": {
      "x-udl-reference": "instrument",
      "$ref": "#/$defs/__schema33"
    },
    "__schema37": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema33"
        },
        "field": {
          "$ref": "#/$defs/__schema38"
        },
        "type": {
          "$ref": "#/$defs/__schema39"
        },
        "required": {
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "field",
        "type",
        "required"
      ],
      "additionalProperties": false
    },
    "__schema38": {
      "type": "string",
      "maxLength": 240,
      "pattern": "^[a-z][a-zA-Z0-9_]*(\\.[a-z][a-zA-Z0-9_]*)*$"
    },
    "__schema39": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "money"
            },
            "currency": {
              "$ref": "#/$defs/__schema5"
            }
          },
          "required": [
            "kind",
            "currency"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "text",
                "integer",
                "boolean",
                "date"
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema40": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "field"
            },
            "path": {
              "$ref": "#/$defs/__schema38"
            }
          },
          "required": [
            "id",
            "op",
            "path"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "literal"
            },
            "type": {
              "$ref": "#/$defs/__schema39"
            },
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2048
                },
                {
                  "$ref": "#/$defs/__schema34"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "required": [
            "id",
            "op",
            "type",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "parameter"
            },
            "name": {
              "type": "string",
              "enum": [
                "periodStart",
                "periodEnd",
                "observationAt"
              ]
            }
          },
          "required": [
            "id",
            "op",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "enum": [
                "sum",
                "subtract",
                "minimum",
                "maximum",
                "equal",
                "less",
                "atMost",
                "and",
                "or",
                "daysBetween"
              ]
            },
            "left": {
              "$ref": "#/$defs/__schema33"
            },
            "right": {
              "$ref": "#/$defs/__schema33"
            }
          },
          "required": [
            "id",
            "op",
            "left",
            "right"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "not"
            },
            "value": {
              "$ref": "#/$defs/__schema33"
            }
          },
          "required": [
            "id",
            "op",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "choose"
            },
            "condition": {
              "$ref": "#/$defs/__schema33"
            },
            "yes": {
              "$ref": "#/$defs/__schema33"
            },
            "no": {
              "$ref": "#/$defs/__schema33"
            }
          },
          "required": [
            "id",
            "op",
            "condition",
            "yes",
            "no"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "bucket"
            },
            "value": {
              "$ref": "#/$defs/__schema33"
            },
            "unit": {
              "type": "string",
              "enum": [
                "month",
                "quarter"
              ]
            }
          },
          "required": [
            "id",
            "op",
            "value",
            "unit"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/__schema33"
            },
            "op": {
              "type": "string",
              "const": "ratio"
            },
            "numerator": {
              "$ref": "#/$defs/__schema33"
            },
            "denominator": {
              "$ref": "#/$defs/__schema33"
            },
            "scale": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000,
              "$ref": "#/$defs/__schema34"
            },
            "rounding": {
              "type": "string",
              "enum": [
                "floor",
                "halfUp"
              ]
            },
            "zero": {
              "type": "string",
              "enum": [
                "refuse",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "op",
            "numerator",
            "denominator",
            "scale",
            "rounding",
            "zero"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema41": {
      "type": "object",
      "properties": {
        "dataset": {
          "$ref": "#/$defs/__schema33"
        },
        "local": {
          "$ref": "#/$defs/__schema33"
        },
        "foreign": {
          "$ref": "#/$defs/__schema33"
        },
        "cardinality": {
          "type": "string",
          "enum": [
            "one",
            "many"
          ]
        },
        "missing": {
          "type": "string",
          "enum": [
            "refuse",
            "allow"
          ]
        },
        "aggregates": {
          "maxItems": 32,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema42"
          }
        }
      },
      "required": [
        "dataset",
        "local",
        "foreign",
        "cardinality",
        "missing",
        "aggregates"
      ],
      "additionalProperties": false
    },
    "__schema42": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema33"
        },
        "op": {
          "type": "string",
          "enum": [
            "sum",
            "average",
            "count",
            "minimum",
            "maximum"
          ]
        },
        "rounding": {
          "type": "string",
          "enum": [
            "floor",
            "halfUp"
          ]
        },
        "value": {
          "$ref": "#/$defs/__schema33"
        }
      },
      "required": [
        "name",
        "op"
      ],
      "additionalProperties": false
    },
    "__schema43": {
      "type": "object",
      "properties": {
        "left": {
          "$ref": "#/$defs/__schema33"
        },
        "right": {
          "$ref": "#/$defs/__schema33"
        }
      },
      "required": [
        "left",
        "right"
      ],
      "additionalProperties": false
    },
    "__schema44": {
      "type": "object",
      "properties": {
        "left": {
          "$ref": "#/$defs/__schema33"
        },
        "right": {
          "$ref": "#/$defs/__schema33"
        }
      },
      "required": [
        "left",
        "right"
      ],
      "additionalProperties": false
    },
    "__schema45": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240
    },
    "__schema46": {
      "type": "string",
      "enum": [
        "json",
        "csv"
      ]
    },
    "__schema47": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema33"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "type": {
          "$ref": "#/$defs/__schema39"
        }
      },
      "required": [
        "name",
        "label",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema48": {
      "oneOf": [
        {
          "$ref": "#/$defs/__schema13"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "$ref": "#/$defs/__schema3"
            },
            "label": {
              "$ref": "#/$defs/__schema14"
            },
            "optional": {
              "$ref": "#/$defs/__schema15"
            },
            "description": {
              "$ref": "#/$defs/__schema16"
            },
            "sensitive": {
              "$ref": "#/$defs/__schema17"
            },
            "type": {
              "type": "string",
              "const": "account"
            },
            "owner": {
              "anyOf": [
                {
                  "$ref": "#/$defs/__schema3"
                },
                {
                  "type": "object",
                  "properties": {
                    "adapter": {
                      "$ref": "#/$defs/__schema3"
                    }
                  },
                  "required": [
                    "adapter"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "key": {
              "$ref": "#/$defs/__schema3"
            },
            "book": {
              "default": "cash",
              "type": "string",
              "enum": [
                "cash",
                "claim"
              ]
            },
            "contra": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "name",
            "type",
            "owner"
          ],
          "additionalProperties": false
        },
        {
          "$ref": "#/$defs/__schema19"
        },
        {
          "$ref": "#/$defs/__schema22"
        },
        {
          "$ref": "#/$defs/__schema23"
        },
        {
          "$ref": "#/$defs/__schema24"
        },
        {
          "$ref": "#/$defs/__schema25"
        },
        {
          "$ref": "#/$defs/__schema26"
        },
        {
          "$ref": "#/$defs/__schema27"
        },
        {
          "$ref": "#/$defs/__schema28"
        },
        {
          "$ref": "#/$defs/__schema29"
        }
      ]
    },
    "__schema49": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "at"
            },
            "list": {
              "$ref": "#/$defs/__schema21"
            },
            "position": {
              "$ref": "#/$defs/__schema50"
            }
          },
          "required": [
            "target",
            "op",
            "list",
            "position"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "aggregate"
            },
            "selection": {
              "$ref": "#/$defs/__schema51"
            },
            "measure": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "count"
                },
                {
                  "type": "object",
                  "properties": {
                    "sum": {
                      "$ref": "#/$defs/__schema21"
                    }
                  },
                  "required": [
                    "sum"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "target",
            "op",
            "selection",
            "measure"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "ratio"
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "numerator": {
              "$ref": "#/$defs/__schema50"
            },
            "denominator": {
              "$ref": "#/$defs/__schema50"
            },
            "rounding": {
              "type": "string",
              "const": "floor"
            }
          },
          "required": [
            "target",
            "op",
            "amount",
            "numerator",
            "denominator",
            "rounding"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "sum"
            },
            "values": {
              "$ref": "#/$defs/__schema52"
            }
          },
          "required": [
            "target",
            "op",
            "values"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "subtract"
            },
            "base": {
              "$ref": "#/$defs/__schema50"
            },
            "subtract": {
              "$ref": "#/$defs/__schema52"
            }
          },
          "required": [
            "target",
            "op",
            "base",
            "subtract"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "rate"
            },
            "base": {
              "$ref": "#/$defs/__schema50"
            },
            "bps": {
              "$ref": "#/$defs/__schema50"
            },
            "rounding": {
              "type": "string",
              "const": "floor"
            }
          },
          "required": [
            "target",
            "op",
            "base",
            "bps",
            "rounding"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "minimum"
            },
            "values": {
              "$ref": "#/$defs/__schema52"
            }
          },
          "required": [
            "target",
            "op",
            "values"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "multiply"
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "units": {
              "$ref": "#/$defs/__schema50"
            }
          },
          "required": [
            "target",
            "op",
            "amount",
            "units"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "divide"
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "divisor": {
              "$ref": "#/$defs/__schema50"
            },
            "rounding": {
              "type": "string",
              "const": "floor"
            }
          },
          "required": [
            "target",
            "op",
            "amount",
            "divisor",
            "rounding"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "annuity"
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "rate": {
              "$ref": "#/$defs/__schema50"
            },
            "periods": {
              "$ref": "#/$defs/__schema50"
            },
            "position": {
              "$ref": "#/$defs/__schema50"
            },
            "part": {
              "type": "string",
              "enum": [
                "principal",
                "interest"
              ]
            }
          },
          "required": [
            "target",
            "op",
            "amount",
            "rate",
            "periods",
            "position",
            "part"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "shift"
            },
            "date": {
              "$ref": "#/$defs/__schema50"
            },
            "milliseconds": {
              "$ref": "#/$defs/__schema50"
            },
            "direction": {
              "type": "string",
              "enum": [
                "before",
                "after"
              ]
            }
          },
          "required": [
            "target",
            "op",
            "date",
            "milliseconds",
            "direction"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "target": {
              "$ref": "#/$defs/__schema3"
            },
            "op": {
              "type": "string",
              "const": "step"
            },
            "date": {
              "$ref": "#/$defs/__schema50"
            },
            "period": {
              "$ref": "#/$defs/__schema50"
            },
            "times": {
              "$ref": "#/$defs/__schema50"
            }
          },
          "required": [
            "target",
            "op",
            "date",
            "period",
            "times"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema50": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "literal": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/$defs/__schema2"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "required": [
            "literal"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "field": {
              "$ref": "#/$defs/__schema21"
            }
          },
          "required": [
            "field"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema51": {
      "type": "object",
      "properties": {
        "family": {
          "$ref": "#/$defs/__schema20"
        },
        "instrument": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema11"
            },
            {
              "minItems": 1,
              "maxItems": 16,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema11"
              }
            }
          ]
        },
        "reference": {
          "$ref": "#/$defs/__schema3"
        },
        "anchor": {
          "$ref": "#/$defs/__schema21"
        },
        "states": {
          "minItems": 1,
          "maxItems": 64,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 366,
          "$ref": "#/$defs/__schema2"
        },
        "batch": {
          "type": "boolean",
          "const": true
        },
        "order": {
          "minItems": 1,
          "maxItems": 4,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema21"
          }
        },
        "window": {
          "type": "object",
          "properties": {
            "field": {
              "$ref": "#/$defs/__schema3"
            },
            "milliseconds": {
              "exclusiveMinimum": 0,
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "field",
            "milliseconds"
          ],
          "additionalProperties": false
        },
        "overlaps": {
          "type": "object",
          "properties": {
            "start": {
              "$ref": "#/$defs/__schema3"
            },
            "end": {
              "$ref": "#/$defs/__schema3"
            },
            "from": {
              "$ref": "#/$defs/__schema50"
            },
            "until": {
              "$ref": "#/$defs/__schema50"
            }
          },
          "required": [
            "start",
            "end",
            "from",
            "until"
          ],
          "additionalProperties": false
        },
        "where": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema21"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema50"
          },
          "maxProperties": 8
        }
      },
      "required": [
        "instrument",
        "reference",
        "anchor",
        "states",
        "limit"
      ],
      "additionalProperties": false
    },
    "__schema52": {
      "minItems": 1,
      "maxItems": 256,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema50"
      }
    },
    "__schema53": {
      "type": "object",
      "properties": {
        "field": {
          "$ref": "#/$defs/__schema12"
        },
        "objectField": {
          "$ref": "#/$defs/__schema3"
        },
        "when": {
          "minItems": 1,
          "maxItems": 128,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema54"
          }
        }
      },
      "required": [
        "field"
      ],
      "additionalProperties": false
    },
    "__schema54": {
      "minItems": 1,
      "maxItems": 32,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema55"
      }
    },
    "__schema55": {
      "type": "object",
      "properties": {
        "instrument": {
          "$ref": "#/$defs/__schema11"
        },
        "action": {
          "$ref": "#/$defs/__schema3"
        },
        "guard": {
          "$ref": "#/$defs/__schema56"
        },
        "valueType": {
          "type": "string",
          "enum": [
            "money",
            "date"
          ]
        }
      },
      "required": [
        "instrument",
        "action",
        "guard"
      ],
      "additionalProperties": false
    },
    "__schema56": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "compare"
        },
        "left": {
          "$ref": "#/$defs/__schema50"
        },
        "operator": {
          "type": "string",
          "enum": [
            "==",
            "!=",
            "<",
            "<=",
            ">",
            ">="
          ]
        },
        "right": {
          "$ref": "#/$defs/__schema50"
        }
      },
      "required": [
        "kind",
        "left",
        "operator",
        "right"
      ],
      "additionalProperties": false
    },
    "__schema57": {
      "type": "object",
      "properties": {
        "binding": {
          "$ref": "#/$defs/__schema3"
        },
        "snapshot": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "onboarding": {
                  "minItems": 1,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/__schema58"
                  }
                },
                "provider": {
                  "$ref": "#/$defs/__schema4"
                },
                "capability": {
                  "$ref": "#/$defs/__schema4"
                },
                "operation": {
                  "$ref": "#/$defs/__schema4"
                },
                "declarationDigest": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "requirements": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/__schema12"
                  }
                }
              },
              "required": [
                "provider",
                "capability",
                "operation",
                "declarationDigest",
                "requirements"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "renames": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/__schema3"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema3"
          }
        }
      },
      "required": [
        "binding",
        "snapshot"
      ],
      "additionalProperties": false
    },
    "__schema58": {
      "type": "string",
      "enum": [
        "person",
        "organization"
      ]
    },
    "__schema59": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "hours"
            },
            "at": {
              "$ref": "#/$defs/__schema21"
            },
            "start": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23,
              "$ref": "#/$defs/__schema2"
            },
            "end": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23,
              "$ref": "#/$defs/__schema2"
            },
            "timezone": {
              "$ref": "#/$defs/__schema4"
            }
          },
          "required": [
            "kind",
            "at",
            "start",
            "end",
            "timezone"
          ],
          "additionalProperties": false
        },
        {
          "$ref": "#/$defs/__schema56"
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "state"
            },
            "reference": {
              "$ref": "#/$defs/__schema21"
            },
            "states": {
              "minItems": 1,
              "maxItems": 64,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema3"
              }
            }
          },
          "required": [
            "kind",
            "reference",
            "states"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "unique"
            },
            "namespace": {
              "$ref": "#/$defs/__schema3"
            },
            "fields": {
              "minItems": 1,
              "maxItems": 8,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema21"
              }
            }
          },
          "required": [
            "kind",
            "namespace",
            "fields"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "aggregate"
            },
            "selection": {
              "$ref": "#/$defs/__schema51"
            },
            "measure": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "count"
                },
                {
                  "type": "object",
                  "properties": {
                    "sum": {
                      "$ref": "#/$defs/__schema21"
                    }
                  },
                  "required": [
                    "sum"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "operator": {
              "type": "string",
              "enum": [
                "==",
                "<=",
                ">=",
                "<",
                ">"
              ]
            },
            "value": {
              "$ref": "#/$defs/__schema50"
            }
          },
          "required": [
            "kind",
            "selection",
            "measure",
            "operator",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "evidence"
            },
            "instruction": {
              "$ref": "#/$defs/__schema21"
            },
            "subject": {
              "$ref": "#/$defs/__schema21"
            },
            "family": {
              "$ref": "#/$defs/__schema3"
            },
            "check": {
              "$ref": "#/$defs/__schema3"
            },
            "result": {
              "$ref": "#/$defs/__schema3"
            },
            "maxAge": {
              "exclusiveMinimum": 0,
              "$ref": "#/$defs/__schema2"
            }
          },
          "required": [
            "kind",
            "subject",
            "family",
            "check",
            "result",
            "maxAge"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema60": {
      "type": "object",
      "properties": {
        "at": {
          "$ref": "#/$defs/__schema21"
        },
        "offset": {
          "$ref": "#/$defs/__schema2"
        },
        "localDay": {
          "type": "object",
          "properties": {
            "days": {
              "type": "integer",
              "minimum": 0,
              "maximum": 366,
              "$ref": "#/$defs/__schema2"
            },
            "direction": {
              "type": "string",
              "enum": [
                "before",
                "after"
              ]
            },
            "hour": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23,
              "$ref": "#/$defs/__schema2"
            },
            "timezone": {
              "$ref": "#/$defs/__schema4"
            }
          },
          "required": [
            "days",
            "direction",
            "hour",
            "timezone"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "at"
      ],
      "additionalProperties": false
    },
    "__schema61": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "key": {
              "$ref": "#/$defs/__schema3"
            },
            "operation": {
              "type": "string",
              "const": "internal_transfer.create"
            },
            "economics": {
              "$ref": "#/$defs/__schema62"
            },
            "capture": {
              "$ref": "#/$defs/__schema3"
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "from": {
              "$ref": "#/$defs/__schema21"
            },
            "to": {
              "$ref": "#/$defs/__schema21"
            }
          },
          "required": [
            "key",
            "operation",
            "amount",
            "from",
            "to"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "key": {
              "$ref": "#/$defs/__schema3"
            },
            "operation": {
              "type": "string",
              "const": "internal_transfer.reserve"
            },
            "economics": {
              "$ref": "#/$defs/__schema62"
            },
            "boundary": {
              "type": "object",
              "properties": {
                "adapter": {
                  "$ref": "#/$defs/__schema3"
                }
              },
              "required": [
                "adapter"
              ],
              "additionalProperties": false
            },
            "amount": {
              "$ref": "#/$defs/__schema50"
            },
            "from": {
              "$ref": "#/$defs/__schema21"
            },
            "to": {
              "$ref": "#/$defs/__schema21"
            },
            "capture": {
              "$ref": "#/$defs/__schema3"
            }
          },
          "required": [
            "key",
            "operation",
            "amount",
            "from",
            "to",
            "capture"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "key": {
              "$ref": "#/$defs/__schema3"
            },
            "operation": {
              "type": "string",
              "const": "internal_transfer.post"
            },
            "economics": {
              "$ref": "#/$defs/__schema62"
            },
            "capture": {
              "$ref": "#/$defs/__schema3"
            },
            "transfer": {
              "$ref": "#/$defs/__schema21"
            }
          },
          "required": [
            "key",
            "operation",
            "transfer"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "key": {
              "$ref": "#/$defs/__schema3"
            },
            "operation": {
              "type": "string",
              "const": "internal_transfer.void"
            },
            "economics": {
              "$ref": "#/$defs/__schema62"
            },
            "capture": {
              "$ref": "#/$defs/__schema3"
            },
            "transfer": {
              "$ref": "#/$defs/__schema21"
            }
          },
          "required": [
            "key",
            "operation",
            "transfer"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema62": {
      "type": "object",
      "properties": {
        "purpose": {
          "type": "string",
          "enum": [
            "earning",
            "principal",
            "participant_payout",
            "internal",
            "prepaid_credit",
            "pass_through"
          ]
        },
        "sourceParty": {
          "$ref": "#/$defs/__schema3"
        },
        "reversalOf": {
          "$ref": "#/$defs/__schema21"
        }
      },
      "required": [
        "purpose",
        "sourceParty"
      ],
      "additionalProperties": false
    },
    "__schema63": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "instrument": {
              "$ref": "#/$defs/__schema11"
            },
            "action": {
              "type": "string",
              "const": "create"
            },
            "input": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema3"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema50"
              }
            },
            "guard": {
              "$ref": "#/$defs/__schema56"
            },
            "range": {
              "type": "object",
              "properties": {
                "count": {
                  "$ref": "#/$defs/__schema50"
                },
                "maximum": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 366,
                  "$ref": "#/$defs/__schema2"
                },
                "bind": {
                  "$ref": "#/$defs/__schema3"
                }
              },
              "required": [
                "count",
                "maximum",
                "bind"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "instrument",
            "action",
            "input"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "reference": {
              "$ref": "#/$defs/__schema21"
            },
            "action": {
              "$ref": "#/$defs/__schema3"
            },
            "input": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema3"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema50"
              }
            },
            "guard": {
              "$ref": "#/$defs/__schema56"
            }
          },
          "required": [
            "reference",
            "action",
            "input"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "selection": {
              "$ref": "#/$defs/__schema51"
            },
            "action": {
              "$ref": "#/$defs/__schema3"
            },
            "input": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/$defs/__schema3"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema50"
              }
            },
            "guard": {
              "$ref": "#/$defs/__schema56"
            }
          },
          "required": [
            "selection",
            "action",
            "input"
          ],
          "additionalProperties": false
        }
      ]
    },
    "__schema64": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/__schema4"
        },
        "input": {
          "$ref": "#/$defs/__schema65"
        }
      },
      "required": [
        "name",
        "input"
      ],
      "additionalProperties": false
    },
    "__schema65": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema65"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema65"
          }
        }
      ]
    }
  }
}
