{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/raiffeisen-ru/main/json-schema/raiffeisen-ru-statement-status-response-schema.json",
  "title": "StatementStatusResponse",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/raiffeisen-ru-payroll-openapi.yml#/components/schemas/StatementStatusResponse",
  "type": "object",
  "required": [
    "externalId",
    "status"
  ],
  "properties": {
    "externalId": {
      "$ref": "#/$defs/ExternalId"
    },
    "status": {
      "$ref": "#/$defs/StatementExternalStatus"
    },
    "message": {
      "type": "string",
      "minLength": 1,
      "description": "Причина отказа в случае статуса ведомости DECLINED"
    },
    "errors": {
      "type": "array",
      "description": "Список ошибок в ведомости в случае статуса ведомости ERROR",
      "items": {
        "$ref": "#/$defs/Error"
      }
    },
    "warnings": {
      "type": "array",
      "description": "Список предупреждений в ведомости",
      "items": {
        "$ref": "#/$defs/Warning"
      }
    }
  },
  "$defs": {
    "Error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Код ошибки"
        },
        "message": {
          "type": "string",
          "description": "Текст ошибки"
        }
      }
    },
    "ExternalId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "pattern": "^[a-z0-9\\-]+$",
      "description": "Уникальный идентификатор ведомости во внешней системе"
    },
    "StatementExternalStatus": {
      "type": "string",
      "description": "Статус ведомости",
      "enum": [
        "DRAFT",
        "CHECKING",
        "AWAITING_SIGN",
        "AWAITING_SIGN_WITH_WARNINGS",
        "ERROR",
        "PARTLY_SIGNED",
        "SIGNING",
        "AWAITING_SEND",
        "PROCESSING",
        "DECLINED",
        "EXECUTED",
        "PARTLY_EXECUTED",
        "DELETED",
        "SCHEDULED",
        "ERROR_SIGN"
      ]
    },
    "Warning": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Код предупреждения"
        },
        "message": {
          "type": "string",
          "description": "Текст предупреждения"
        }
      }
    }
  }
}