{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dbt-se/json-schema/dbt-se-batch-get-requirements-response-body-schema.json",
  "title": "BatchGetRequirementsResponseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dbt-se-regulatory-records-api-openapi.yml#/components/schemas/BatchGetRequirementsResponseBody",
  "type": "array",
  "items": {
    "$ref": "#/$defs/UcRequirementResponseBody"
  },
  "$defs": {
    "UcRequirementCreatedByResponseBody": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "staff-member"
              ]
            },
            "staffMemberId": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "staffMemberId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "system"
              ]
            }
          },
          "required": [
            "type"
          ]
        }
      ]
    },
    "UcRequirementReasonResponseBody": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "manual"
              ]
            },
            "comment": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "comment"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "automatic"
              ]
            },
            "sources": {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "enum": [
                          "activeClient"
                        ]
                      },
                      "loanIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "reason",
                      "loanIds"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "enum": [
                          "recentlyActiveClient"
                        ]
                      },
                      "loanIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "reason",
                      "loanIds"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "enum": [
                          "activeDeal"
                        ]
                      },
                      "dealIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "reason",
                      "dealIds"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "enum": [
                          "recentlyActiveDeal"
                        ]
                      },
                      "dealIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "reason",
                      "dealIds"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "enum": [
                          "relatedToActiveCaseOrg"
                        ]
                      },
                      "relatedOrgIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "reason",
                      "relatedOrgIds"
                    ]
                  }
                ]
              }
            }
          },
          "required": [
            "type",
            "sources"
          ]
        }
      ]
    },
    "UcRequirementResponseBody": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "orgId": {
          "type": "string"
        },
        "shouldFetchReports": {
          "type": "boolean"
        },
        "shouldReceiveMonitoring": {
          "type": "boolean"
        },
        "reason": {
          "$ref": "#/$defs/UcRequirementReasonResponseBody"
        },
        "createdBy": {
          "$ref": "#/$defs/UcRequirementCreatedByResponseBody"
        },
        "createdAt": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "format": "date-time"
            },
            "type": {
              "type": "string",
              "enum": [
                "datetime"
              ]
            }
          },
          "required": [
            "date",
            "type"
          ]
        },
        "archivedAt": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "date": {
              "type": "string",
              "format": "date-time"
            },
            "type": {
              "type": "string",
              "enum": [
                "datetime"
              ]
            }
          },
          "required": [
            "date",
            "type"
          ]
        }
      },
      "required": [
        "id",
        "orgId",
        "shouldFetchReports",
        "shouldReceiveMonitoring",
        "reason",
        "createdBy",
        "createdAt",
        "archivedAt"
      ]
    }
  }
}