{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dbt-se/json-schema/dbt-se-thresholds-response-schema.json",
  "title": "ThresholdsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dbt-se-prospect-api-openapi.yml#/components/schemas/ThresholdsResponse",
  "type": "object",
  "properties": {
    "orgId": {
      "type": "string"
    },
    "companyType": {
      "$ref": "#/$defs/CompanyTypeThreshold"
    },
    "riskForecast": {
      "$ref": "#/$defs/RiskForecastThreshold"
    },
    "kfmDebt": {
      "$ref": "#/$defs/KfmDebtThreshold"
    }
  },
  "required": [
    "orgId",
    "companyType",
    "riskForecast",
    "kfmDebt"
  ],
  "$defs": {
    "CompanyTypeThreshold": {
      "oneOf": [
        {
          "$ref": "#/$defs/CompanyTypeThresholdPass"
        },
        {
          "$ref": "#/$defs/CompanyTypeThresholdFail"
        },
        {
          "$ref": "#/$defs/CompanyTypeThresholdDataNotFound"
        }
      ]
    },
    "CompanyTypeThresholdDataNotFound": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "data_not_found"
          ]
        },
        "value": {
          "type": "null"
        },
        "reportDate": {
          "type": "null"
        }
      },
      "required": [
        "status",
        "value",
        "reportDate"
      ]
    },
    "CompanyTypeThresholdFail": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "fail"
          ]
        },
        "value": {
          "type": "string",
          "enum": [
            "HB_KB",
            "OTHER"
          ]
        },
        "reportDate": {
          "type": "object",
          "properties": {
            "dateString": {
              "type": "string"
            },
            "day": {
              "type": "number"
            },
            "monthIndex": {
              "type": "number"
            },
            "timeZone": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "dateString",
            "day",
            "monthIndex",
            "timeZone",
            "type",
            "year"
          ]
        }
      },
      "required": [
        "status",
        "value",
        "reportDate"
      ]
    },
    "CompanyTypeThresholdPass": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pass"
          ]
        },
        "value": {
          "type": "string",
          "enum": [
            "AB"
          ]
        },
        "reportDate": {
          "type": "object",
          "properties": {
            "dateString": {
              "type": "string"
            },
            "day": {
              "type": "number"
            },
            "monthIndex": {
              "type": "number"
            },
            "timeZone": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "dateString",
            "day",
            "monthIndex",
            "timeZone",
            "type",
            "year"
          ]
        }
      },
      "required": [
        "status",
        "value",
        "reportDate"
      ]
    },
    "KfmDebtThreshold": {
      "oneOf": [
        {
          "$ref": "#/$defs/KfmDebtThresholdPass"
        },
        {
          "$ref": "#/$defs/KfmDebtThresholdFail"
        },
        {
          "$ref": "#/$defs/KfmDebtThresholdDataNotFound"
        }
      ]
    },
    "KfmDebtThresholdDataNotFound": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "data_not_found"
          ]
        },
        "hasDebt": {
          "type": "null"
        },
        "amount": {
          "type": "null"
        },
        "date": {
          "type": "null"
        }
      },
      "required": [
        "status",
        "hasDebt",
        "amount",
        "date"
      ]
    },
    "KfmDebtThresholdFail": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "fail"
          ]
        },
        "hasDebt": {
          "type": "boolean",
          "enum": [
            true
          ]
        },
        "amount": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "string"
            },
            "currency": {
              "type": "string"
            },
            "format": {
              "type": "object",
              "properties": {
                "notation": {
                  "type": "string",
                  "enum": [
                    "scientific",
                    "engineering",
                    "compact"
                  ]
                },
                "roundingPriority": {
                  "type": "string",
                  "enum": [
                    "morePrecision",
                    "lessPrecision"
                  ]
                }
              }
            },
            "numericAmount": {
              "type": "number"
            },
            "type": {
              "type": "string",
              "enum": [
                "currency"
              ]
            }
          },
          "required": [
            "amount",
            "currency",
            "numericAmount",
            "type"
          ]
        },
        "date": {
          "type": "object",
          "properties": {
            "dateString": {
              "type": "string"
            },
            "day": {
              "type": "number"
            },
            "monthIndex": {
              "type": "number"
            },
            "timeZone": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "dateString",
            "day",
            "monthIndex",
            "timeZone",
            "type",
            "year"
          ]
        }
      },
      "required": [
        "status",
        "hasDebt",
        "amount",
        "date"
      ]
    },
    "KfmDebtThresholdPass": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pass"
          ]
        },
        "hasDebt": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "amount": {
          "type": "null"
        },
        "date": {
          "type": "null"
        }
      },
      "required": [
        "status",
        "hasDebt",
        "amount",
        "date"
      ]
    },
    "RiskForecastThreshold": {
      "oneOf": [
        {
          "$ref": "#/$defs/RiskForecastThresholdPass"
        },
        {
          "$ref": "#/$defs/RiskForecastThresholdFail"
        },
        {
          "$ref": "#/$defs/RiskForecastThresholdDataNotFound"
        }
      ]
    },
    "RiskForecastThresholdDataNotFound": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "data_not_found"
          ]
        },
        "currentValue": {
          "type": "null"
        },
        "date": {
          "type": "null"
        }
      },
      "required": [
        "status",
        "currentValue",
        "date"
      ]
    },
    "RiskForecastThresholdFail": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "fail"
          ]
        },
        "currentValue": {
          "type": "object",
          "properties": {
            "format": {
              "type": "object",
              "properties": {
                "maximumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "maximumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                }
              }
            },
            "percentageAsFraction": {
              "type": "number"
            },
            "type": {
              "type": "string",
              "enum": [
                "percent"
              ]
            }
          },
          "required": [
            "percentageAsFraction",
            "type"
          ]
        },
        "date": {
          "type": "object",
          "properties": {
            "dateString": {
              "type": "string"
            },
            "day": {
              "type": "number"
            },
            "monthIndex": {
              "type": "number"
            },
            "timeZone": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "dateString",
            "day",
            "monthIndex",
            "timeZone",
            "type",
            "year"
          ]
        }
      },
      "required": [
        "status",
        "currentValue",
        "date"
      ]
    },
    "RiskForecastThresholdPass": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pass"
          ]
        },
        "currentValue": {
          "type": "object",
          "properties": {
            "format": {
              "type": "object",
              "properties": {
                "maximumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "maximumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                }
              }
            },
            "percentageAsFraction": {
              "type": "number"
            },
            "type": {
              "type": "string",
              "enum": [
                "percent"
              ]
            }
          },
          "required": [
            "percentageAsFraction",
            "type"
          ]
        },
        "date": {
          "type": "object",
          "properties": {
            "dateString": {
              "type": "string"
            },
            "day": {
              "type": "number"
            },
            "monthIndex": {
              "type": "number"
            },
            "timeZone": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "date"
              ]
            },
            "year": {
              "type": "number"
            }
          },
          "required": [
            "dateString",
            "day",
            "monthIndex",
            "timeZone",
            "type",
            "year"
          ]
        }
      },
      "required": [
        "status",
        "currentValue",
        "date"
      ]
    }
  }
}