{
  "openapi": "3.0.1",
  "info": {
    "title": "api/time-slots/time-slots",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/gw/timeslots/api/v1/timeslots": {
      "post": {
        "description": "Метод создания или обновления бронирования",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "timeslot": {
                    "$ref": "#/components/schemas/TimeSlot"
                  }
                },
                "required": [
                  "timeslot",
                  "terminal",
                  "warehouse",
                  "approve_status"
                ]
              },
              "examples": {
                "Create Time Slot": {
                  "value": {
                    "timeslot": {
                      "attachments": [],
                      "terminal": 35264,
                      "gate_number": 1,
                      "action_type": "loading_unloading",
                      "comment": "Тестовый комментарий",
                      "date_from": "2023-07-04",
                      "date_to": "2023-07-04",
                      "time_from": "00:00",
                      "time_to": "00:00",
                      "warehouse": 34824,
                      "approve_status": "approved"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Возвращаются актуальные данные созданного или измененного склада",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "warehouse": {
                          "$ref": "#/components/schemas/TimeSlot"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Time Slot Created": {
                    "value": {
                      "ok": true,
                      "result": {
                        "timeslot": {
                          "id": 12429,
                          "time_from": "00:00",
                          "time_to": "00:00",
                          "warehouse_info": {
                            "id": 34824,
                            "name": "Тестовый склад",
                            "address": "Гельсингфорсская улица, 2А",
                            "city_verbose": "Санкт-Петербург, РФ",
                            "utc_offset": 180,
                            "owner": 4022713
                          },
                          "attached_files": [],
                          "can_be_edited": true,
                          "is_expired": true,
                          "timeslot_readable_id": "34824-12429",
                          "approve_status": "approved",
                          "action_type": "loading_unloading",
                          "slot_owner": 4022713,
                          "contact_id": 0,
                          "email": "",
                          "contact_name": null,
                          "contact_phone": "",
                          "country_phone_id": "",
                          "gate_number": 1,
                          "car_number": null,
                          "car_capacity": null,
                          "body_type": null,
                          "cargo": "",
                          "cargo_count": null,
                          "cargo_unit": "",
                          "cargo_owner": "",
                          "cargo_owner_contact_name": "",
                          "cargo_owner_contact_number": "",
                          "comment": "Тестовый комментарий",
                          "firm_name": "",
                          "date_from": "2023-07-04",
                          "date_to": "2023-07-04",
                          "date_creation": "2023-07-04T08:29:44.939037+03:00",
                          "date_modified": "2023-07-04T08:29:44.939059+03:00",
                          "deleted": false,
                          "is_test": true,
                          "warehouse": 34824,
                          "terminal": 35264,
                          "order_point": null,
                          "warehouse_name": "Тестовый склад",
                          "terminal_name": "Тестовая площадка"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка валидации. Возникает, когда в какое-то из полей передано недопустимое значение",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SingleError"
                    },
                    {
                      "$ref": "#/components/schemas/MultipleError"
                    }
                  ]
                },
                "examples": {
                  "Validation Errors": {
                    "value": {
                      "error": "multiple_errors",
                      "error_list": [
                        {
                          "error": "time_to",
                          "reason": "Неправильный формат времени. Используйте один из этих форматов: hh:mm."
                        },
                        {
                          "error": "approve_status",
                          "reason": "Значения test нет среди допустимых вариантов."
                        }
                      ],
                      "reason": "invalid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/timeslots/api/v1/timeslots/my": {
      "get": {
        "responses": {
          "200": {
            "description": "Возвращаются все бронирования и точки заказа без бронирований",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "order_points_without_slots_count": {
                          "type": "integer",
                          "description": "Количество точек заказа, для которых не создано бронирование"
                        },
                        "order_points_without_slots": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/OrderPoint"
                          }
                        },
                        "count": {
                          "type": "integer",
                          "description": "Количество созданных бронирований"
                        },
                        "time_slots": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TimeSlot"
                          }
                        },
                        "accounts": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Account"
                          }
                        },
                        "timeslot_filters": {
                          "type": "object",
                          "properties": {
                            "timeslot_id": {
                              "type": "integer"
                            },
                            "order_point_id": {
                              "type": "integer"
                            },
                            "only_timeslots": {
                              "type": "boolean"
                            },
                            "only_order_points_without_slots": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "lol": {
                    "kek": 1
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/timeslots/api/v1/timeslots/{ati_id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "ati_id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Идентификатор фирмы"
            }
          },
          {
            "in": "query",
            "name": "gates",
            "schema": {
              "type": "string"
            },
            "description": "Номера площадок погрузки-выгрузки"
          },
          {
            "in": "query",
            "name": "warehouse_id",
            "schema": {
              "type": "integer"
            },
            "description": "Идентификатор склада"
          },
          {
            "in": "query",
            "name": "terminal_id",
            "schema": {
              "type": "integer"
            },
            "description": "Идентификатор площадки погрузки-разгрузки"
          },
          {
            "in": "query",
            "name": "date_from",
            "schema": {
              "type": "string"
            },
            "description": "Дата начала бронирований"
          },
          {
            "in": "query",
            "name": "date_to",
            "schema": {
              "type": "string"
            },
            "description": "Дата окончания бронирований"
          },
          {
            "in": "query",
            "name": "time_from",
            "schema": {
              "type": "string"
            },
            "description": "Время начала бронирований"
          },
          {
            "in": "query",
            "name": "time_to",
            "schema": {
              "type": "string"
            },
            "description": "Время окончания бронирований"
          },
          {
            "in": "query",
            "name": "deal_id",
            "schema": {
              "type": "string"
            },
            "description": "Идентификатор сделки"
          },
          {
            "in": "query",
            "name": "ordinal_id",
            "description": "Порядковый номер точки в заказе",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order_point_type",
            "description": "Тип точки в заказе. 1 - точка загрузки, 2 - точка разгрузки",
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ]
            }
          },
          {
            "in": "query",
            "name": "approve_status",
            "description": "Статус бронирования",
            "schema": {
              "$ref": "#/components/schemas/ApproveStatus"
            }
          },
          {
            "in": "query",
            "name": "timeslot_id",
            "description": "Идентификатор бронирования",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "order_point_id",
            "description": "Идентификатор точки заказа",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "only_timeslots",
            "description": "Флаг, определяющий, что надо вернуть только бронирования, без точек из заказа",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "in": "query",
            "name": "only_order_points_without_slots",
            "description": "Флаг, определяющий, что надо вернуть только точки из заказа без бронирований",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Возвращается информация бронированиях с учетом фильтров",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": "Количество найденных бронирований"
                        },
                        "time_slots": {
                          "$ref": "#/components/schemas/TimeSlot"
                        },
                        "accounts": {
                          "$ref": "#/components/schemas/Account"
                        },
                        "timeslot_filters": {
                          "type": "object",
                          "properties": {
                            "timeslot_id": {
                              "type": "integer"
                            },
                            "order_point_id": {
                              "type": "integer"
                            },
                            "only_timeslots": {
                              "type": "boolean"
                            },
                            "only_order_points_without_slots": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Returned Timeslots": {
                    "value": {
                      "ok": true,
                      "result": {
                        "count": 1,
                        "time_slots": [
                          {
                            "id": 12429,
                            "time_from": "00:00",
                            "time_to": "00:00",
                            "warehouse_info": {
                              "id": 34824,
                              "name": "Тестовый склад",
                              "address": "Гельсингфорсская улица, 2А",
                              "city_verbose": "Санкт-Петербург, РФ",
                              "utc_offset": 180,
                              "owner": 4022713
                            },
                            "staying_statuses_history": [
                              {
                                "status_name": "Ожидается",
                                "date_start": "2023-07-04T08:29:44.946522+03:00",
                                "date_end": null,
                                "staying_status": 173845,
                                "timeslot": 12429,
                                "comment": "",
                                "color": "rgb(219, 169, 46)"
                              }
                            ],
                            "attached_files": [],
                            "can_be_edited": true,
                            "is_expired": true,
                            "timeslot_readable_id": "34824-12429",
                            "approve_status": "approved",
                            "action_type": "loading_unloading",
                            "slot_owner": 4022713,
                            "contact_id": 0,
                            "email": "",
                            "contact_name": null,
                            "contact_phone": "",
                            "country_phone_id": "",
                            "gate_number": 1,
                            "car_number": null,
                            "car_capacity": null,
                            "body_type": null,
                            "cargo": "",
                            "cargo_count": null,
                            "cargo_unit": "",
                            "cargo_owner": "",
                            "cargo_owner_contact_name": "",
                            "cargo_owner_contact_number": "",
                            "comment": "Тестовый комментарий",
                            "firm_name": "",
                            "date_from": "2023-07-04",
                            "date_to": "2023-07-04",
                            "date_creation": "2023-07-04T08:29:44.939037+03:00",
                            "date_modified": "2023-07-04T08:29:44.939059+03:00",
                            "deleted": false,
                            "is_test": true,
                            "warehouse": 34824,
                            "terminal": 35264,
                            "order_point": null,
                            "warehouse_name": "Тестовый склад",
                            "terminal_name": "Тестовая площадка"
                          }
                        ],
                        "accounts": {
                          "4022713": {
                            "firm_type": "Экспедитор",
                            "firm_id": 4022713,
                            "account_id": "4022713",
                            "full_firm_name": "JtNEFfon8443, ИП",
                            "firm_name": "JtNEFfon8443",
                            "brand": null,
                            "location": {
                              "city_id": 1,
                              "region_id": 153,
                              "country_id": 1,
                              "full_name": "Санкт-Петербург, Санкт-Петербург (регион), Россия",
                              "short_name": "Санкт-Петербург",
                              "is_regional_center": true,
                              "city_size": 6,
                              "fias_id": "c2deb16a-0330-4f05-821f-1d09c93331e6",
                              "attributes": 2052,
                              "city_name": "Санкт-Петербург",
                              "region_name": "Санкт-Петербург (регион)",
                              "country_name": "Россия",
                              "country_code_name": "RUS"
                            },
                            "passport": {
                              "ati_id": "4022713",
                              "total_score": 0,
                              "ati_data_match_point": 0,
                              "account_lifetime_point": 0,
                              "business_activity_point": 0,
                              "round_table_point": 0,
                              "claim_point": 0,
                              "prof_activity_point": 0,
                              "ati_administration_point": 0,
                              "clones_point": 0,
                              "egr_point": 0,
                              "mass_registration_point": 0,
                              "mass_founder_point": 0,
                              "firm_lifetime_point": 0,
                              "guaranteed_payment_point": 0,
                              "virtual_account_debts_point": 0,
                              "bad_partner_mentions_point": 0,
                              "ri_users_attributes": 100380,
                              "recommendations_count": 0,
                              "status": 2,
                              "status_description": "Отсутствует балл \"Аккаунт подтвержден\" или cумма любых красных баллов меньше или равна 1",
                              "negative_points_sum": 0
                            },
                            "contacts": [
                              {
                                "id": 2,
                                "name": "contact"
                              },
                              {
                                "id": 0,
                                "name": "director"
                              }
                            ]
                          }
                        },
                        "timeslot_filters": {
                          "timeslot_id": null,
                          "order_point_id": null,
                          "only_timeslots": false,
                          "only_order_points_without_slots": false
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Фирма не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleError"
                },
                "examples": {
                  "Firm Not Found": {
                    "value": {
                      "error": "bad_request",
                      "reason": "Фирма не найдена"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/timeslots/api/v1/timeslots/counters": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "warehouse_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "description": "Идентификатор склада во Временных окнах"
                    }
                  }
                },
                "required": [
                  "warehouse_ids"
                ]
              },
              "examples": {
                "Get Time Slots Counters": {
                  "value": {
                    "warehouse_ids": [
                      34824
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Возвращаются количество бронирований пользователей в статусе await_reaction в переданных складах",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    }
                  }
                },
                "examples": {
                  "Returned Time Slots Counters": {
                    "value": {
                      "ok": true,
                      "result": {
                        "34824": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка валидации. Возникает, когда в какое-то из полей передано недопустимое значение",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleError"
                },
                "examples": {
                  "Bad Warehouse Ids": {
                    "value": {
                      "error": "bad_request",
                      "reason": "warehouse_ids должен содержать айдишники складов",
                      "details": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/timeslots/api/v1/timeslots/history/{timeslot_id}": {
      "get": {
        "operationId": "",
        "parameters": [
          {
            "in": "path",
            "name": "timeslot_id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Идентификатор фирмы"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Возвращается история изменений бронирования",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "history_changes": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TimeSlotHistoryItem"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Time Slot History": {
                    "value": {
                      "ok": true,
                      "result": {
                        "history_changes": [
                          {
                            "iso_warehouse_local_datetime": "2023-07-05T08:19:13.132092+03:00",
                            "editor_info": {
                              "name": "director"
                            },
                            "changes": {
                              "created": [],
                              "updated": [
                                {
                                  "field": {
                                    "name": "comment",
                                    "old_value": "Тестовый комментарий",
                                    "new_value": "Измененный комментарий"
                                  }
                                }
                              ],
                              "deleted": []
                            }
                          },
                          {
                            "iso_warehouse_local_datetime": "2023-07-04T08:29:44.939059+03:00",
                            "editor_info": {
                              "name": "director"
                            },
                            "changes": {
                              "created": [
                                {
                                  "field": {
                                    "name": "timeslot_created",
                                    "old_value": null,
                                    "new_value": null
                                  }
                                },
                                {
                                  "field": {
                                    "name": "staying_statuses",
                                    "old_value": null,
                                    "new_value": [
                                      "Ожидается"
                                    ]
                                  }
                                }
                              ],
                              "updated": [],
                              "deleted": []
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Бронирование не найдено",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleError"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "error": "not_found",
                      "reason": "Timeslot not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApproveStatus": {
        "type": "string",
        "description": "Статус бронирования",
        "enum": [
          "approved",
          "decline",
          "await_reaction",
          "await_client"
        ]
      },
      "TimeSlot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор бронирования. Если передан, то бронирование будет обновлено"
          },
          "time_from": {
            "type": "string",
            "description": "Время начала брони"
          },
          "time_to": {
            "type": "string",
            "description": "Время окончания брони"
          },
          "warehouse_info": {
            "type": "object",
            "description": "Информация о складе, на котором создано бронирование",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Идентификатор склада"
              },
              "name": {
                "type": "string",
                "description": "Название склада"
              },
              "address": {
                "type": "string",
                "description": "Адрес склада"
              },
              "city_verbose": {
                "type": "string",
                "description": "Название города, в котором находится склад"
              },
              "utc_offset": {
                "type": "integer",
                "description": "Количество минут, на которые время склада отличается от UTC"
              },
              "owner": {
                "type": "integer",
                "description": "Идентификатор фирмы, которой принадлежит склад"
              }
            }
          },
          "attached_files": {
            "type": "array",
            "description": "Список приложенных к бронированию файлов"
          },
          "can_be_edited": {
            "type": "boolean",
            "description": "Флаг, указывающий на возможность редактирования бронирования"
          },
          "is_expired": {
            "type": "boolean",
            "description": "Флаг, указывающий просрочено ли временя бронирования"
          },
          "timeslot_readable_id": {
            "type": "string",
            "description": "Человекочитаемый идентификатор бронирования"
          },
          "approve_status": {
            "$ref": "#/components/schemas/ApproveStatus"
          },
          "action_type": {
            "type": "string",
            "description": "Тип действия на складе",
            "enum": [
              "unloading",
              "loading",
              "loading_unloading"
            ]
          },
          "slot_owner": {
            "type": "integer",
            "description": "Идентификатор фирмы пользователя, создавшего бронирования"
          },
          "contact_id": {
            "type": "integer",
            "description": "Идентификатор контакта пользователя, создавшего бронирование"
          },
          "email": {
            "type": "string",
            "description": "Адрес электронной почты создателя бронирования"
          },
          "contact_name": {
            "type": "string",
            "description": "ФИО водителя"
          },
          "contact_phone": {
            "type": "string",
            "description": "Телефон водителя"
          },
          "country_phone_id": {
            "type": "integer",
            "description": "Идентификатор страны телефона контактного лица. 0-Россия, 1-Украина, 2-Казахстан, 3-Беларусь, 4-Другие",
            "required": "true",
            "minimum": 0,
            "maximum": 4
          },
          "gate_number": {
            "type": "integer",
            "description": "Идентификатор склада"
          },
          "car_number": {
            "type": "string",
            "description": "Государственный регистрационный номер автомобиля"
          },
          "car_capacity": {
            "type": "integer",
            "description": "Грузоподъемность транспортного средства"
          },
          "body_type": {
            "type": "string",
            "description": "Тип кузова"
          },
          "cargo": {
            "type": "string",
            "description": "Наименование груза"
          },
          "cargo_count": {
            "type": "integer",
            "description": "Количество грура"
          },
          "cargo_unit": {
            "type": "string",
            "description": "Единицы измерения груза"
          },
          "cargo_owner": {
            "type": "string",
            "description": "Владелец груза"
          },
          "cargo_owner_contact_name": {
            "type": "string",
            "description": "Имя грузовладельца"
          },
          "cargo_owner_contact_number": {
            "type": "string",
            "description": "Телефонный номер грузовладельца"
          },
          "comment": {
            "type": "string",
            "description": "Комментарий"
          },
          "firm_name": {
            "type": "string",
            "description": "Название фирмы перевозчика"
          },
          "date_from": {
            "type": "string",
            "description": "Дата начала бронирования"
          },
          "data_to": {
            "type": "string",
            "description": "Дата окончания бронирования"
          },
          "date_creation": {
            "type": "string",
            "description": "Дата и время создания бронирования"
          },
          "date_modified": {
            "type": "string",
            "description": "Дата и время изменения бронирования"
          },
          "deleted": {
            "type": "boolean",
            "description": "Флаг, показывающий удалено бронирование или нет"
          },
          "is_test": {
            "type": "boolean",
            "description": "Флаг, показывающий является ли бронирование тестовым"
          },
          "warehouse": {
            "type": "integer",
            "description": "Идентификатор склада"
          },
          "terminal": {
            "type": "integer",
            "description": "Идентификатор площадки погрузки-выгрузки"
          },
          "order_point": {
            "$ref": "#/components/schemas/OrderPoint"
          },
          "warehouse_name": {
            "type": "string",
            "description": "Название склада"
          },
          "terminal_name": {
            "type": "string",
            "description": "Название площадки погрузки-выгрузки"
          }
        }
      },
      "FieldHistory": {
        "type": "object",
        "properties": {
          "field": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "old_value": {
                "type": "string"
              },
              "new_value": {
                "type": "string"
              }
            }
          }
        }
      },
      "TimeSlotHistoryItem": {
        "type": "object",
        "properties": {
          "iso_warehouse_local_datetime": {
            "type": "string",
            "description": "Время изменения в локальном времени склада"
          },
          "editor_info": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          },
          "changes": {
            "type": "object",
            "properties": {
              "created": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FieldHistory"
                }
              },
              "updated": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FieldHistory"
                }
              },
              "deleted": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FieldHistory"
                }
              }
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "firm_type": {
              "type": "string",
              "description": "Тип фирмы"
            },
            "firm_id": {
              "type": "integer"
            },
            "account_id": {
              "type": "string"
            },
            "full_firm_name": {
              "type": "string"
            },
            "firm_name": {
              "type": "string"
            },
            "brand": {
              "type": "string"
            },
            "location": {
              "type": "object",
              "properties": {
                "city_id": {
                  "type": "integer"
                },
                "region_id": {
                  "type": "integer"
                },
                "country_id": {
                  "type": "integer"
                },
                "full_name": {
                  "type": "string"
                },
                "short_name": {
                  "type": "string"
                },
                "is_regional_center": {
                  "type": "boolean"
                },
                "city_size": {
                  "type": "integer"
                },
                "fias_id": {
                  "type": "string"
                },
                "attributes": {
                  "type": "integer"
                },
                "city_name": {
                  "type": "string"
                },
                "region_name": {
                  "type": "string"
                },
                "country_code_name": {
                  "type": "string"
                }
              }
            },
            "passport": {
              "type": "object",
              "properties": {
                "ati_id": {
                  "type": "string"
                },
                "total_score": {
                  "type": "number",
                  "format": "float"
                },
                "ati_data_match_point": {
                  "type": "number",
                  "format": "float"
                },
                "account_lifetime_point": {
                  "type": "number",
                  "format": "float"
                },
                "business_activity_point": {
                  "type": "number",
                  "format": "float"
                },
                "round_table_point": {
                  "type": "number",
                  "format": "float"
                },
                "claim_point": {
                  "type": "number",
                  "format": "float"
                },
                "prof_activity_point": {
                  "type": "number",
                  "format": "float"
                },
                "ati_administration_point": {
                  "type": "number",
                  "format": "float"
                },
                "clones_point": {
                  "type": "number",
                  "format": "float"
                },
                "egr_point": {
                  "type": "number",
                  "format": "float"
                },
                "mass_registration_point": {
                  "type": "number",
                  "format": "float"
                },
                "mass_founder_point": {
                  "type": "number",
                  "format": "float"
                },
                "firm_lifetime_point": {
                  "type": "number",
                  "format": "float"
                },
                "guaranteed_payment_point": {
                  "type": "number",
                  "format": "float"
                },
                "virtual_account_debts_point": {
                  "type": "number",
                  "format": "float"
                },
                "bad_partner_mentions_point": {
                  "type": "number",
                  "format": "float"
                },
                "ri_users_attributes": {
                  "type": "integer"
                },
                "recommendations_count": {
                  "type": "integer"
                },
                "status": {
                  "type": "integer"
                },
                "status_description": {
                  "type": "string"
                },
                "negative_points_sum": {
                  "type": "number",
                  "format": "float"
                }
              }
            },
            "contacts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "OrderLoad": {
        "type": "object",
        "properties": {
          "ordinal_number": {
            "type": "integer"
          },
          "weight": {
            "type": "number",
            "format": "float"
          },
          "volume": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "cargo_type": {
            "type": "string",
            "description": "Тип груза. Может быть введен пользователем"
          }
        }
      },
      "OrderRouteItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Название города"
          },
          "type": {
            "type": "string",
            "enum": [
              "loading",
              "unloading"
            ],
            "description": "Тип точки"
          }
        }
      },
      "OrderPoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор точки заказа во Временных окнах"
          },
          "can_be_created": {
            "type": "boolean"
          },
          "load_number": {
            "type": "string"
          },
          "deal_id": {
            "type": "string",
            "description": "Идентификатор сделки"
          },
          "warehouse": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Идентификатор склада во Временных окнах"
              },
              "name": {
                "type": "string",
                "description": "Название склада"
              },
              "address": {
                "type": "string",
                "description": "Адрес склада"
              },
              "city_verbose": {
                "type": "string",
                "description": "Название города, в котором расположен склад"
              }
            }
          },
          "driver_name": {
            "type": "string",
            "description": "ФИО водителя"
          },
          "driver_phone": {
            "type": "string",
            "description": "Телефон водителя"
          },
          "car_number": {
            "type": "string",
            "description": "Государственный регистрационный номер автомобиля"
          },
          "car_load_capacity": {
            "type": "number",
            "format": "float"
          },
          "load_owner_contact_id": {
            "type": "integer",
            "nullable": true
          },
          "order_loads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLoad"
            }
          },
          "warehouse_owner": {
            "type": "integer",
            "description": "Идентификатор фирмы, которая владеет складом"
          },
          "order_route": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderRouteItem"
            }
          },
          "ordinal_id": {
            "type": "integer"
          },
          "point_type": {
            "type": "string"
          },
          "car_type": {
            "type": "string"
          }
        },
        "nullable": true
      },
      "SingleError": {
        "description": "Одиночная ошибка",
        "properties": {
          "error": {
            "description": "Текстовый код ошибки",
            "type": "string"
          },
          "reason": {
            "description": "Человекочитаемый текст ошибки",
            "type": "string"
          }
        }
      },
      "MultipleError": {
        "type": "object",
        "description": "Множественная ошибка",
        "properties": {
          "error": {
            "description": "Текстовый код ошибки",
            "type": "string"
          },
          "reason": {
            "description": "Человекочитаемый текст ошибки",
            "type": "string"
          },
          "error_list": {
            "description": "Список возникших ошибок",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SingleError"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}