openapi: 3.0.3 info: title: VRt.Agro [AG] version: 6.20.2252 license: name: Proprietary url: https://veeroute.ru/ contact: name: Veeroute Support Team email: servicedesk@veeroute.com x-logo: url: ../images/agro.svg backgroundColor: '#FAFAFA' altText: VRt.Agro description: 'Программный интерфейс для Veeroute Agro. # Описание Сервис предназначен для расчета плана работ производственных объектов. ## Общая схема ![objects](../images/agro_objects.svg) ### Поле - производит определенную сельскохозяйственную культуру определенной влажности - продукция с поля может перемещаться только на Элеватор или Завод ### Элеватор (Ток) - состоит из Ворот, Сушилок, краткосрочных и долгосрочных мест хранения - сушит зерно (если влажность культуры больше допустимой) - хранит сухое зерно в краткосрочных местах хранения (складах), при этом допускается выгрузка и загрузка зерна в рамках одних суток - хранит сухое зерно в долгосрочных местах хранения (рукавах, траншеях, курганах) - при хранении в одном хранилище может находится только один вид культуры - продает излишки зерна на Рынок - производственные процессы внутри объекта: сушка, загрузка/выгрузка в место хранения, хранение ### Завод - состоит из Ворот, Сушилок, Бункеров, Потребителей - [если присутствует сушка] сушит зерно (если влажность культуры больше допустимой) - хранит сухое зерно в Бункерах (краткосрочное хранилище, привязанное к определенной культуре) - поддерживает в Бункерах минимальный запас зерна для потребления - потребляет зерно из Бункеров - закупает недостающее зерно с Рынка - производственные процессы внутри объекта: сушка, загрузка/выгрузка в место хранения, хранение, потребление ### Рынок - закупает зерно у Элеваторов - продает зерно Заводам ## Проект Проект отражает запланированную последовательность операций над сельскохозяйственными культурами, ниже описаны типы операций. ### HARVEST Уборка сельскохозяйственной культуры: - между производственными объектами (Полем и Элеватором или Заводом) - операция происходит внутри одного дня - на Поле происходит определение влажности зерна | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Поле | - | | Назначение (destination) | Элеватор или Завод | Ворота | ### DRY Сушка культуры: - внутри производственного объекта (Элеватора или Завода) - длительность операции - сутки - в процессе сушки меняется масса и тип влажности (WET -> DRY) - в источнике указывается масса сырой культуры - в назначении указывается полученная масса сухой культуры | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Элеватор или Завод | Ворота | | Назначение (destination) | Элеватор или Завод | Сушилка | ### LOAD Загрузка культуры с Ворот в Место хранения (долгосрочное, краткосрочное, бункер): - между частями одного производственного объекта (Элеватора или Завода) - операция происходит внутри одного дня | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|------------------------------------------------------| | Источник (source) | Элеватор или Завод | Ворота или Сушилка | | Назначение (destination) | Элеватор или Завод | Место хранения (долгосрочное, краткосрочное, бункер) | ### UNLOAD Выгрузка культуры из места хранения на Ворота: - между частями одного производственного объекта (Элеватора) - операция происходит внутри одного дня | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|------------------------------------------------------------------| | Источник (source) | Элеватор | Место хранения (долгосрочное, краткосрочное, бункер) или Сушилка | | Назначение (destination) | Элеватор | Ворота | ### STORE Хранение культуры: - место хранения не меняется - длительность операции - сутки - операция происходит через ночь | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|------------------------------------------------------| | Источник (source) | Элеватор или Завод | Место хранения (долгосрочное, краткосрочное, бункер) | | Назначение (destination) | Элеватор или Завод | То же самое место хранения | ### RELOCATE Перевозка между производственными объектами: - между производственными объектами (Элеватором и Заводом) - операция происходит внутри одного дня | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Элеватор | Ворота | | Назначение (destination) | Завод | Ворота | ### CONSUMPTION Потребление культуры заводом: - между частями одного производственного объекта (Завода) - операция происходит внутри одного дня - потребление идет из Бункера - дополнительно можем потреблять прямо с Ворот или Сушилки без закладки в Бункер | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Завод | Бункер или Ворота или Сушилка | | Назначение (destination) | Завод | Потребитель | ### SELL Продажа культуры: - между производственными объектами (Элеватором и Рынком) - операция происходит внутри одного дня | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Элеватор | Ворота | | Назначение (destination) | Рынок | Контракт | ### BUY Покупка культуры: - между производственными объектами (Рынком и Заводом) - операция происходит внутри одного дня | | Объект (target_key) | Подобъект (target_detail_key) | |--------------------------|---------------------|-------------------------------| | Источник (source) | Рынок | Контракт | | Назначение (destination) | Завод | Ворота | ## Диаграмма сущностей ![erd](../uml/agro.svg) ' servers: - url: https://api.edge.veeroute.tech description: Окружение для интеграции и ознакомления с новой функциональностью - url: https://api.prod.veeroute.com description: Основное окружение security: - ApiKeyAuth: [] tags: - name: Plan description: "Расчет производственного плана. \n" - name: System description: 'Системные функции. Вспомогательный функционал, общий для всех сервисов. ' externalDocs: description: Основной сайт url: https://veeroute.ru/ paths: /agro/plan/calculation: post: tags: - Plan summary: Планирование (SYNC) description: Расчет оптимального производственного плана. operationId: run_plan_calculation requestBody: description: Данные для расчета. required: true content: application/json: schema: $ref: '#/components/schemas/plan_task' examples: PlanTaskSmall: $ref: '#/components/examples/PlanTaskSmall' responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/plan_result' examples: PlanResultSmall: $ref: '#/components/examples/PlanResultSmall' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' x-codeSamples: - lang: Python source: 'from vrt_lss_agro import * from vrt_lss_agro.apis import * from vrt_lss_agro.models import * # settings HOST = ''https://api.edge.veeroute.tech'' # production env https://api.prod.veeroute.com'' TOKEN = ''PASTETOKENHERE'' # create client configuration = Configuration() configuration.host = HOST configuration.access_token = TOKEN client = ApiClient(configuration) # create api instances system_api = SystemApi(client) agro_api = PlanApi(client) # run check check_response = system_api.check() print(check_response) # run sync calculation task = PlanApi(...) result = agro_api.plan(task) print(result)' /agro/plan/calculation_async: post: tags: - Plan summary: Планирование (ASYNC) description: 'Получение результата производится с помощью метода [result](#operation/read_plan_result), а удаление - с помощью [delete](#operation/delete_plan_result). ' operationId: run_plan_calculation_async requestBody: description: Данные для расчета. required: true content: application/json: schema: $ref: '#/components/schemas/plan_task' examples: PlanTaskSmall: $ref: '#/components/examples/PlanTaskSmall' responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/calculation_async_result' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/plan/calculation_async/{id}: parameters: - $ref: '#/components/parameters/result_id' get: tags: - Plan summary: Состояние расчета description: Получение состояния расчета по идентификатору расчета. operationId: read_plan_calculation_state responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/calculation_state' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' delete: tags: - Plan summary: Отмена расчета description: Отмена процесса планирования по идентификатору расчета. operationId: cancel_plan_calculation responses: '204': description: Успешное выполнение - планирование отменено '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/plan/result/{id}: parameters: - $ref: '#/components/parameters/result_id' get: tags: - Plan summary: Получение результата description: Получение результата расчета по идентификатору расчета. operationId: read_plan_result responses: '200': description: Успешное выполнение - расчет завершен. content: application/json: schema: $ref: '#/components/schemas/plan_result' examples: PlanResultSmall: $ref: '#/components/examples/PlanResultSmall' '202': description: Расчет в процессе. content: application/json: schema: $ref: '#/components/schemas/plan_result' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' delete: tags: - Plan summary: Удаление результата description: Удаление результата по идентификатору расчета. operationId: delete_plan_result responses: '204': description: Успешное выполнение - планирование удалено '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/plan/validation: post: tags: - Plan summary: Валидация данных description: Проверка данных перед отправкой на расчет. operationId: run_plan_validation requestBody: description: Данные для расчета. required: true content: application/json: schema: $ref: '#/components/schemas/plan_task' examples: PlanTaskSmall: $ref: '#/components/examples/PlanTaskSmall' responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/validate_result' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/plan/clip/{clip_key}: post: tags: - Plan summary: Обрезка (SYNC) description: Получение подзадачи из полной задачи на расчет. operationId: run_plan_clip parameters: - $ref: '#/components/parameters/clip_key' - $ref: '#/components/parameters/clip_strategy' requestBody: description: Данные для обрезки. required: true content: application/json: schema: $ref: '#/components/schemas/plan_task' examples: PlanTaskSmall: $ref: '#/components/examples/PlanTaskSmall' responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/plan_task' examples: PlanTaskSmall: $ref: '#/components/examples/PlanTaskSmall' '400': $ref: '#/components/responses/400_with_errors_and_warnings' '401': $ref: '#/components/responses/401' '402': $ref: '#/components/responses/402' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/system/check: get: tags: - System summary: Проверка доступности description: Проверка доступности сервиса. operationId: check security: [] responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/check_result' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/system/version: get: tags: - System summary: Получение версии сервиса description: Получение версии сервиса. operationId: version security: [] responses: '200': description: Успешное выполнение content: application/json: schema: $ref: '#/components/schemas/version_result' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' /agro/file/{filename}: parameters: - $ref: '#/components/parameters/filename' get: tags: - System summary: Получение документации description: Получение файла с документацией на этот сервис. operationId: file security: [] responses: '200': description: Успешное выполнение content: text/html: schema: $ref: '#/components/schemas/file_html' text/plain: schema: $ref: '#/components/schemas/file_json' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '429': $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' '501': $ref: '#/components/responses/501' '502': $ref: '#/components/responses/502' '503': $ref: '#/components/responses/503' '504': $ref: '#/components/responses/504' default: $ref: '#/components/responses/503' components: securitySchemes: ApiKeyAuth: description: "Для [аутентификации](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)\ \ клиента \nиспользуется [JWT токен](https://ru.wikipedia.org/wiki/JSON_Web_Token),\ \ \nкоторый необходимо указывать в заголовке для каждого запроса в формате:\n\ \n`Authorization: Bearer `.\n\nУникальный токен для пользовательского\ \ аккаунта необходимо получить с помощью VRt.Account API.\n" type: http scheme: bearer bearerFormat: JWT schemas: humidity: description: Влажность сельскохозяйственной культуры, в промилле (‰). type: integer format: int32 minimum: 1 maximum: 999 example: 180 compatible_storage_types: description: 'Список совместимых типов краткосрочных мест хранения. ' type: array minItems: 0 maxItems: 10 uniqueItems: true items: description: Тип краткосрочного места хранения. type: string minLength: 1 maxLength: 256 example: - granary compatible_silo_types: description: 'Список совместимых типов долгосрочных мест хранения. ' type: array minItems: 0 maxItems: 10 uniqueItems: true items: description: Тип долгосрочного места хранения. type: string minLength: 1 maxLength: 256 example: - trench attribute: description: Атрибут. type: object additionalProperties: false properties: key: description: Ключ атрибута. type: string minLength: 1 maxLength: 100 example: attribute_name value: description: Значение атрибута. type: string minLength: 0 maxLength: 2000 example: X51 required: - key - value attributes: description: Атрибуты. Используются для указания служебной информации. type: array minItems: 0 maxItems: 1000 uniqueItems: true default: [] items: $ref: '#/components/schemas/attribute' crop: description: 'Сельскохозяйственная культура. ' type: object additionalProperties: false properties: key: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 base_humidity: $ref: '#/components/schemas/humidity' description: 'Базовая влажность в промилле (‰). Если влажность зерна выше базовой - его необходимо сушить. ' compatible_storage_types: $ref: '#/components/schemas/compatible_storage_types' compatible_silo_types: $ref: '#/components/schemas/compatible_silo_types' attributes: $ref: '#/components/schemas/attributes' required: - key - base_humidity date_window: description: Временное окно между датами. type: object additionalProperties: false properties: from: description: Дата начала временного окна в формате YYYY-MM-DD. type: string format: date example: '2024-02-15' to: description: Дата окончания (включительно) временного окна в формате YYYY-MM-DD. type: string format: date example: '2024-02-22' required: - from - to capacity_forecast_element: description: Прогнозное значение на определенное временное окно. type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' capacity: description: Максимальное количество тонн зерна, которое возможно обработать за каждый день внутри указанного временного окна. type: integer format: int32 minimum: 0 maximum: 10000000 example: 2000 required: - date_window - capacity capacity_forecast: description: Прогнозная мощность. type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/capacity_forecast_element' humidity_forecast_element: description: 'Прогноз по влажности зерна на поле, в промилле (‰). Если на определенный день влажность не указана - она считается базовой (т.е. зерно не нуждается в сушке) для данной культуры. ' type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' humidity: $ref: '#/components/schemas/humidity' description: 'Прогноз по влажности зерна, в промилле (‰). Данный прогноз указывается на каждый день внутри временного окна. ' required: - date_window - humidity humidity_forecast: description: 'Прогноз по влажности зерна на поле. Если влажность для конкретного дня не указана - то для этого для используется базовая влажность культуры. ' type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/humidity_forecast_element' field: description: 'Поле - производитель зерна. ' type: object additionalProperties: false properties: key: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: field_key_1 crop_key: description: Ключ культуры, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 amount: description: Суммарное количество зерна (в тоннах), которое необходимо собрать с поля. type: integer format: int32 minimum: 0 maximum: 10000000 example: 200 capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по максимальному количеству зерна (в тоннах), которое возможно собрать с поля в каждый день внутри указанного временного окна. Если на конкретный день прогноз не указан - уборка в этот день не осуществляется. ' humidity_forecast: $ref: '#/components/schemas/humidity_forecast' attributes: $ref: '#/components/schemas/attributes' required: - key - crop_key - amount - capacity_forecast cost_forecast_element: description: Прогнозная стоимость на указанную временное окно. type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' cost: description: Суммарная стоимость в условных денежных единицах в каждый день внутри указанного временного окна. type: integer format: int32 minimum: 0 maximum: 1000000 example: 100 required: - date_window - cost cost_forecast: description: Прогноз стоимости. type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/cost_forecast_element' gate: description: 'Ворота, которые обеспечивают процесс приемки\отгрузки зерна. ' type: object additionalProperties: false properties: key: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: gate_key_1 input_capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по доступным мощностям приемки (в тоннах на конкретный день). Если на конкретный день мощность не указана - приемка в этот день не осуществляется. ' input_cost_forecast: $ref: '#/components/schemas/cost_forecast' description: 'Прогноз по стоимости процесса приемки - в условных денежных единицах за 1 тонну зерна. Если стоимость для конкретного дня не указана - процесс считается бесплатным в этот день. ' output_capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по доступным мощностям отгрузки (в тоннах на конкретный день). Если на конкретный день мощность не указана - отгрузка в этот день не осуществляется. ' output_cost_forecast: $ref: '#/components/schemas/cost_forecast' description: 'Прогноз по стоимости процесса отгрузки - в условных денежных единицах за 1 тонну зерна. Если стоимость для конкретного дня не указана - процесс считается бесплатным в этот день. ' attributes: $ref: '#/components/schemas/attributes' required: - key - input_capacity_forecast - output_capacity_forecast productivity_forecast_element: description: Прогнозное значение на определенное временное окно. type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' productivity: description: Производительность процесса обработки зерна. type: number format: double minimum: 0 maximum: 10000000 example: 200 required: - date_window - productivity productivity_forecast: description: Прогнозная производительность. type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/productivity_forecast_element' chamber: description: 'Сушильная камера - определяет параметры процесса сушки сельскохозяйственной культуры. ' type: object additionalProperties: false properties: crop_key: description: Ключ культуры, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: Прогноз по максимальному количеству культуры (в тоннах на конкретный день), которое может вместить сушилка. productivity_forecast: $ref: '#/components/schemas/productivity_forecast' description: Прогноз по максимальному количеству культуры (в тоннах-% на конкретный день), для которого сушилка может за 1 день уменьшить влажность на 1 процент (10 промилле). cost_forecast: $ref: '#/components/schemas/cost_forecast' description: Прогноз по стоимости процесса сушки - в условных денежных единицах за 1 процент (10 промилле) уменьшения влажности. required: - crop_key - capacity_forecast - productivity_forecast dryer: description: 'Место сушки сельскохозяйственной культуры. ' type: object additionalProperties: false properties: key: description: Ключ сушилки, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: dryer_key_1 chamber_variants: description: 'Список возможных вариантов использования сушилки (прогноз по мощностям сушки в зависимости от культуры). В каждый расчетный день может быть использован только один вариант. ' type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/chamber' attributes: $ref: '#/components/schemas/attributes' required: - key - chamber_variants storage: description: "Место краткосрочного хранения совместимой сельскохозяйственной\ \ культуры. В один день хранилище может работать и на загрузку и на выгрузку.\ \ \n" type: object additionalProperties: false properties: key: description: Ключ хранилища, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: storage_key_1 type: description: Тип краткосрочного места хранения. type: string minLength: 1 maxLength: 256 example: granary capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по доступным мощностям хранения (в тоннах на конкретный день). Если на конкретный день мощность не указана - хранение в этот день не осуществляется. ' cost_forecast: $ref: '#/components/schemas/cost_forecast' description: 'Прогноз по стоимости процесса хранения - в условных денежных единицах за 1 тонну зерна. Если стоимость для конкретного дня не указана - процесс считается бесплатным в этот день. ' attributes: $ref: '#/components/schemas/attributes' required: - key - type - capacity_forecast silo: description: 'Место долговременного хранения совместимой сельскохозяйственной культуры. Выгрузка из хранилища не возможна пока не закончилась загрузка. Загрузка из хранилища не возможна пока не закончилась выгрузка. ' type: object additionalProperties: false properties: key: description: Ключ хранилища, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: silo_key_1 type: description: Тип долгосрочного места хранения. type: string minLength: 1 maxLength: 256 example: trench capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по доступным мощностям хранения (в тоннах на конкретный день). Если на конкретный день мощность не указана - хранение в этот день не осуществляется. ' cost_forecast: $ref: '#/components/schemas/cost_forecast' description: 'Прогноз по стоимости процесса хранения - в условных денежных единицах за 1 тонну зерна. Если стоимость для конкретного дня не указана - процесс считается бесплатным в этот день. ' deployment_cost: description: 'Стоимость разового развертывания хранилища, в условных денежных единицах. ' type: integer format: int32 minimum: 0 maximum: 1000000 default: 0 example: 100 collapse_cost: description: 'Стоимость разового свертывания хранилища, в условных денежных единицах. ' type: integer format: int32 minimum: 0 maximum: 1000000 default: 0 example: 100 attributes: $ref: '#/components/schemas/attributes' required: - key - type - capacity_forecast elevator: description: 'Производственный объект, который осуществляет операции по подготовке\хранению зерна. ' type: object additionalProperties: false properties: key: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: elevator_key_1 gate: $ref: '#/components/schemas/gate' description: Ворота и весовая, обеспечивают процесс приемки и отгрузки зерна. dryers: description: Список мест для сушки зерна. type: array uniqueItems: true minItems: 0 maxItems: 501 nullable: false items: $ref: '#/components/schemas/dryer' storages: description: 'Список мест краткосрочного хранения зерна. В каждый расчетный день могут быть использованы все указанные хранилища. ' type: array uniqueItems: true minItems: 0 maxItems: 501 nullable: false items: $ref: '#/components/schemas/storage' silos: description: 'Список мест долгосрочного хранения зерна. ' type: array uniqueItems: true minItems: 0 maxItems: 501 nullable: false items: $ref: '#/components/schemas/silo' attributes: $ref: '#/components/schemas/attributes' required: - key - gate bunker: description: 'Место хранения одной сельскохозяйственной культуры для потребления. ' type: object additionalProperties: false properties: key: description: Ключ бункера, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: bunker_key_1 capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по доступным мощностям хранения (в тоннах на конкретный день). Если на конкретный день мощность не указана - хранение в этот день не осуществляется. ' cost_forecast: $ref: '#/components/schemas/cost_forecast' description: 'Прогноз по стоимости процесса хранения - в условных денежных единицах за 1 тонну зерна. Если стоимость для конкретного дня не указана - процесс считается бесплатным в этот день. ' attributes: $ref: '#/components/schemas/attributes' required: - key - capacity_forecast stock_forecast_element: description: Прогноз требований к гарантированному остатку запасов в бункере на каждый день внутри указанного временного периода. type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' min_stock_days: description: 'Минимальный запас времени - на сколько дней вперед необходимо поддерживать наличие культуры в бункерах, для обеспечения непрерывности процесса потребления. Потребление в текущий день не включается в данный параметр. ' type: integer format: int32 minimum: 0 maximum: 365 example: 14 required: - date_window - min_stock_days stock_forecast: description: Прогноз требований к гарантированному остатку. type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/stock_forecast_element' consumer: description: 'Потребитель зерна - производственная линия переработки определенной культуры. ' type: object additionalProperties: false properties: key: description: Ключ потребителя, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: consumer_key_1 crop_key: description: Ключ культуры, которая участвует в процессе, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 consumption_forecast: $ref: '#/components/schemas/capacity_forecast' description: Прогноз по потреблению, в тоннах на конкретный день. stock_forecast: $ref: '#/components/schemas/stock_forecast' required: - key - crop_key - consumption_forecast - stock_forecast factory: description: 'Производственный объект, который осуществляет операции по подготовке\хранению\потреблению зерна. ' type: object additionalProperties: false properties: key: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: factory_key_1 gate: $ref: '#/components/schemas/gate' description: Ворота и весовая, обеспечивают процесс приемки и отгрузки зерна. dryers: description: Список мест для сушки зерна. type: array uniqueItems: true minItems: 0 maxItems: 501 nullable: false items: $ref: '#/components/schemas/dryer' bunkers: description: Список бункеров - мест хранения зерна и источника для потребления. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/bunker' consumers: description: Список потребителей, которые перерабатывают зерно. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/consumer' attributes: $ref: '#/components/schemas/attributes' required: - key - gate - bunkers - consumers contract_type: description: "Тип контракта:\n * `SELL_WITH_DELIVERY` - Контракт на продажу\ \ зерна рынком с доставкой до клиента (цена перемещения от рынка включена\ \ в стоимость).\n * `SELL` - Контракт на продажу зерна рынком без доставки\ \ (цена перемещения от рынка не включена в стоимость).\n * `BUY_WITH_DELIVERY`\ \ - Контракт на покупку зерна рынком с доставкой от клиента (цена перемещения\ \ до рынка включена в стоимость).\n * `BUY` - Контракт на покупку зерна\ \ рынком без доставки (цена перемещения до рынка не включена в стоимость).\n" type: string enum: - SELL_WITH_DELIVERY - SELL - BUY_WITH_DELIVERY - BUY example: SELL contract_target_keys: description: 'Список ключей производственных объектов. ' type: array minItems: 1 maxItems: 100 uniqueItems: true items: description: Ключ объекта, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: - factory_1 price_forecast_element: description: Прогноз цены на зерно на указанную дату. type: object additionalProperties: false properties: date_window: $ref: '#/components/schemas/date_window' price: description: Цена на указанную дату. type: integer format: int32 minimum: 0 maximum: 10000000 example: 2000 required: - date_window - price price_forecast: description: Цены, привязанные к датам, по которой рынок покупает\продает указанную культуру. type: array minItems: 0 maxItems: 3653 uniqueItems: false items: $ref: '#/components/schemas/price_forecast_element' pricelist: description: 'Прогноз цен на определенную культуру. ' type: object additionalProperties: false properties: crop_key: description: Ключ культуры, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 price_forecast: $ref: '#/components/schemas/price_forecast' description: 'Прогноз цен на указанную культуру (за тонну), по которым рынок покупает или продает (в зависимости от типа контракта). ' capacity_forecast: $ref: '#/components/schemas/capacity_forecast' description: 'Прогноз по ограничениям на максимальное количество зерна, которое рынок может купить или продать (в зависимости от типа контракта) в указанные даты. Если не указан на конкретный день - ограничений на покупку и продажу нет. ' required: - crop_key - price_forecast contract: description: 'Контракт - определяет список цен на покупку и продажу для определенной группы продавцов и покупателей. ' type: object additionalProperties: false properties: key: description: Ключ контракта, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: contract_key_1 type: $ref: '#/components/schemas/contract_type' target_keys: $ref: '#/components/schemas/contract_target_keys' pricelist: description: 'Список цен на покупку и продажу сельскохозяйственных культур. ' type: array uniqueItems: false minItems: 0 maxItems: 50 nullable: false items: $ref: '#/components/schemas/pricelist' attributes: $ref: '#/components/schemas/attributes' required: - key - type - target_keys - pricelist market: description: 'Рынок - позволяет покупать и продавать сельскохозяйственные культуры. ' type: object additionalProperties: false properties: key: description: Ключ рынка, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: market_key_1 contracts: description: 'Список контрактов. ' type: array uniqueItems: false minItems: 0 maxItems: 50 nullable: false items: $ref: '#/components/schemas/contract' attributes: $ref: '#/components/schemas/attributes' required: - key - contracts movement_matrix_element: description: Матрица расстояний и времен. type: object additionalProperties: false properties: source_key: description: Ключ объекта-источника, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: source_key_1 destination_key: description: Ключ объекта-назначения, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: destination_key_1 distance: description: Суммарная протяжённость пути между источником и назначением, в километрах. type: integer format: int32 minimum: 0 maximum: 40000 example: 20 cost_per_transport: description: 'Суммарная стоимость использования 1 транспорта между источником и назначением, в условных денежных единицах. Вместимость транспорта определяется в настройках (transport_capacity). ' type: integer format: int32 minimum: 0 maximum: 100000000 default: 0 example: 5000 required: - source_key - destination_key - distance movement_matrix: description: 'Матрица описывающая стоимость (в километрах и денежных единицах) перемещения зерна между объектами (в обе стороны). Если между объектами нет соответствующей записи в матрице - перемещение зерна между ними считается невозможным. ' type: array uniqueItems: true minItems: 1 maxItems: 8040402 items: $ref: '#/components/schemas/movement_matrix_element' leftover: description: 'Остаток зерна на объекте. Если остаток не указан для поля - поле считается полностью неубранным. Если остаток не указан для производственного объекта - объект считается полностью пустым. ' type: object additionalProperties: false properties: crop_key: description: Ключ культуры остатка, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 humidity: $ref: '#/components/schemas/humidity' target_key: description: Ключ целевого объекта (поля, тока или завода), где находится остаток, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: target_key_1 target_detail_key: description: Ключ целевого места нахождения (хранилища, бункера или сушки) зерна у целевого объекта, уникальный идентификатор. type: string nullable: true minLength: 1 maxLength: 1024 example: storage_key_1 default: null amount: description: Масса оставшегося зерна, в тоннах. type: integer format: int32 minimum: 0 maximum: 10000000 example: 250 required: - crop_key - humidity - target_key - amount project_configuration: description: "Тип целевой функции:\n * `OPTIMIZE_DISTANCE` - оптимизировать\ \ расстояние\n * `OPTIMIZE_COST` - оптимизировать суммарную стоимость\n" type: string enum: - OPTIMIZE_DISTANCE - OPTIMIZE_COST default: OPTIMIZE_DISTANCE example: OPTIMIZE_DISTANCE project_settings: description: Настройки логики расчета. type: object additionalProperties: false properties: configuration: $ref: '#/components/schemas/project_configuration' start_date: description: Дата начала расчета в формате YYYY-MM-DD. type: string format: date example: '2023-06-15' end_date: description: Дата окончания расчета в формате YYYY-MM-DD. type: string format: date example: '2023-06-22' transport_capacity: description: Вместимость одного транспорта - единицы перемещения зерна между объектами, в тоннах. type: integer format: int32 minimum: 1 maximum: 80 default: 23 example: 12 required: - start_date - end_date calculation_settings: description: Настройки процесса расчета. type: object additionalProperties: false properties: max_calculation_time: description: 'Максимальное время расчета. Старт отсчета начинается от времени завершения загрузки данных на сервер и начала расчета. ' type: string format: duration x-custom-format: duration pattern: ^P(?!$)((\d+Y)|(\d+\.\d+Y$))?((\d+M)|(\d+\.\d+M$))?((\d+W)|(\d+\.\d+W$))?((\d+D)|(\d+\.\d+D$))?(T(?=\d)((\d+H)|(\d+\.\d+H$))?((\d+M)|(\d+\.\d+M$))?(\d+(\.\d+)?S)?)??$ minLength: 3 maxLength: 16 default: PT20M example: PT4M30S max_waiting_time: description: 'Максимальное время нахождения расчета в очереди. Старт отсчета начинается от времени завершения загрузки данных на сервер. ' type: string format: duration x-custom-format: duration pattern: ^P(?!$)((\d+Y)|(\d+\.\d+Y$))?((\d+M)|(\d+\.\d+M$))?((\d+W)|(\d+\.\d+W$))?((\d+D)|(\d+\.\d+D$))?(T(?=\d)((\d+H)|(\d+\.\d+H$))?((\d+M)|(\d+\.\d+M$))?(\d+(\.\d+)?S)?)??$ minLength: 3 maxLength: 16 default: PT20M example: PT2H result_ttl: description: 'Время жизни результата расчета. Старт отсчета начинается от времени завершения расчета. ' type: string format: duration x-custom-format: duration pattern: ^P(?!$)((\d+Y)|(\d+\.\d+Y$))?((\d+M)|(\d+\.\d+M$))?((\d+W)|(\d+\.\d+W$))?((\d+D)|(\d+\.\d+D$))?(T(?=\d)((\d+H)|(\d+\.\d+H$))?((\d+M)|(\d+\.\d+M$))?(\d+(\.\d+)?S)?)??$ minLength: 3 maxLength: 16 default: PT20M example: PT4M30S result_timezone: description: 'Временная зона, в которой возвращается результат расчета. ' type: integer format: int32 minimum: -12 maximum: 12 default: 0 example: 3 treat_warnings_as_errors: description: 'Относится к предупреждениям как к ошибкам и не запускать расчет если хотя бы одна сущность содержит невалидные данные. ' type: boolean default: false example: true precision: description: 'Указание точности полей типа double в порядковом номере знака после запятой. По умолчанию 2, т.е. точность 0.01. ' type: integer format: int32 minimum: 0 maximum: 6 default: 2 example: 3 plan_settings: description: Настройки планирования. type: object additionalProperties: false properties: project_settings: $ref: '#/components/schemas/project_settings' calculation_settings: $ref: '#/components/schemas/calculation_settings' required: - project_settings plan_task: description: Исходная задача. type: object additionalProperties: false properties: crops: description: Список сельскохозяйственных культур. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/crop' fields: description: Список полей, на которых произрастают сельскохозяйственные культуры. type: array uniqueItems: true minItems: 1 maxItems: 20001 nullable: false items: $ref: '#/components/schemas/field' elevators: description: Список токов - производственных объектов по подготовке и хранению зерна. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/elevator' factories: description: Список заводов - потребителей зерна. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/factory' markets: description: Список рынков. type: array uniqueItems: true minItems: 1 maxItems: 501 nullable: false items: $ref: '#/components/schemas/market' movement_matrix: $ref: '#/components/schemas/movement_matrix' leftovers: description: Остатки зерна на текущий момент - в полях, хранилищах, сушилках. type: array uniqueItems: false minItems: 0 maxItems: 25001 nullable: false items: $ref: '#/components/schemas/leftover' plan_settings: $ref: '#/components/schemas/plan_settings' required: - crops - fields - factories - markets - movement_matrix - plan_settings service_name: description: Название сервиса. type: string enum: - UNIVERSAL - ROUTING - ACCOUNT - ADMIN - STUDIO - MONITOR - PACKER - AGRO - STOCK - LONGHAUL - CLUSTER - CARGOTIMETABLE example: UNIVERSAL operation_id: description: Идентификатор операции. type: string minLength: 3 maxLength: 256 example: run_plan_calculation tracedata: description: Данные используемые для трассировки запросов. type: object additionalProperties: false properties: code: description: 'Уникальный идентификатор процесса. Если запущен асинхронный процесс, то код для него будет одинаковый, хотя другие поля могут отличаться. ' type: string format: uuid example: 11111111-2222-3333-4444-555555555555 client: description: 'Уникальный идентификатор клиента (`company_key` + `_|_` + `username`), который совершил запрос. ' type: string pattern: \w+ minLength: 2 maxLength: 256 example: company_|_username server: description: Уникальный идентификатор сервера. type: string pattern: \w+ minLength: 2 maxLength: 256 example: server_name service: $ref: '#/components/schemas/service_name' operation: $ref: '#/components/schemas/operation_id' time: description: Дата и время вызова метода сервиса в соответствии с [ISO 8601](https://tools.ietf.org/html/rfc3339#section-5.6). type: string format: date-time example: '2024-02-21T09:30:00+03:00' required: - code - client - server - service - operation - time operation_type: description: "Тип [операции](#section/Opisanie/Proekt):\n * `HARVEST` - Уборка\ \ сельскохозяйственной культуры с поля на производственный объект\n * `STORE`\ \ - Хранение культуры в месте хранения\n * `DRY` - Сушка культуры\n * `RELOCATE`\ \ - Перевозка между производственными объектами (между воротами)\n * `CONSUMPTION`\ \ - Потребление культуры заводом (из бункера, ворот или сушки)\n * `LOAD`\ \ - Загрузка культуры в место хранения\n * `UNLOAD` - Выгрузка культуры из\ \ места хранения\n * `SELL` - Продажа культуры с элеватора на рынок (по конкретному\ \ контракту)\n * `BUY` - Покупка культуры с рынка на завод (по конкретному\ \ контракту)\n" type: string enum: - HARVEST - STORE - DRY - RELOCATE - CONSUMPTION - LOAD - UNLOAD - SELL - BUY example: HARVEST object_type: description: "Тип объекта:\n * `FIELD` - поле\n * `ELEVATOR` - элеватор\\\ ток\n * `FACTORY` - завод\n * `MARKET` - рынок\n" type: string enum: - FIELD - ELEVATOR - FACTORY - MARKET example: FIELD crop_type: description: "Тип зерна:\n * `DRY` - сухое (влажность зерна не превышает целевую)\n\ \ * `WET` - влажное (влажность зерна выше целевой)\n" type: string enum: - DRY - WET example: DRY operation_target: description: 'Целевой объект операции. ' type: object additionalProperties: false properties: date: description: Дата в формате YYYY-MM-DD. type: string format: date example: '2024-02-05' target_key: description: Ключ объекта, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: key_1 target_type: $ref: '#/components/schemas/object_type' target_detail_key: description: 'Ключ части объекта, если он существует для данной операции - [подробнее](#section/Opisanie/Proekt). ' type: string nullable: true minLength: 1 maxLength: 1024 example: storage_1 default: null crop_type: $ref: '#/components/schemas/crop_type' humidity: $ref: '#/components/schemas/humidity' mass: description: Масса зерна, в тоннах. type: number format: double minimum: 0 maximum: 10000000.1 example: 1200.1 attributes: $ref: '#/components/schemas/attributes' required: - date - target_key - target_type - crop_type - humidity - mass operation_measurements: description: 'Параметры операции. ' type: object additionalProperties: false properties: distance: description: Протяжённость пути между источником и назначением, в километрах. type: integer format: int32 minimum: 0 maximum: 40000 example: 200 cost: description: Суммарная стоимость операции, в условных денежных единицах. type: number format: double minimum: -1000000000000 maximum: 1000000000000 example: 200 required: - distance - cost operation: description: 'Операция по обработке зерна. ' type: object additionalProperties: false properties: type: $ref: '#/components/schemas/operation_type' crop_key: description: Ключ культуры, над которой производится операция, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 source: $ref: '#/components/schemas/operation_target' description: Описание состояния объекта-источника (откуда). destination: $ref: '#/components/schemas/operation_target' description: Описание состояния объекта-назначения (куда). measurements: $ref: '#/components/schemas/operation_measurements' required: - type - crop_key - source - destination - measurements project: description: 'Производственный план. Последовательность выполнения работ. ' type: array uniqueItems: false minItems: 0 maxItems: 1000001 items: $ref: '#/components/schemas/operation' plan_statistics: description: 'Общая статистика. ' type: object additionalProperties: false properties: days_count: description: Количество запланированных дней. type: integer format: int32 minimum: 0 maximum: 3653 example: 365 crops_count: description: Суммарное количество запланированных культур. type: integer format: int32 minimum: 0 maximum: 501 example: 8 fields_count: description: Суммарное количество полностью убранных полей. type: integer format: int32 minimum: 0 maximum: 20001 example: 217 fields_part_count: description: Суммарное количество частично убранных полей. type: integer format: int32 minimum: 0 maximum: 20001 example: 222 elevators_count: description: Суммарное количество запланированных токов. type: integer format: int32 minimum: 0 maximum: 501 example: 12 factory_count: description: Суммарное количество запланированных заводов. type: integer format: int32 minimum: 0 maximum: 501 example: 25 markets_count: description: Суммарное количество запланированных рынков. type: integer format: int32 minimum: 0 maximum: 501 example: 4 total_distance: description: Суммарный пробег по всем операциям, в км. type: integer format: int32 minimum: 0 maximum: 10000000000 example: 129000 total_cost: description: Суммарная стоимость по всем операциям, в условных денежных единицах. type: number format: double minimum: -1000000000000 maximum: 1000000000000 example: 2788900 unplanned_crops_count: description: Суммарное количество не запланированных культур. type: integer format: int32 minimum: 0 maximum: 501 example: 222 unplanned_fields_count: description: Суммарное количество полностью не убранных полей. type: integer format: int32 minimum: 0 maximum: 20001 example: 2111 unplanned_elevators_count: description: Суммарное количество не запланированных элеваторов. type: integer format: int32 minimum: 0 maximum: 10001 example: 7333 unplanned_factories_count: description: Суммарное количество не запланированных заводов. type: integer format: int32 minimum: 0 maximum: 501 example: 231 unplanned_markets_count: description: Суммарное количество не запланированных рынков. type: integer format: int32 minimum: 0 maximum: 501 example: 123 required: - days_count - crops_count - fields_count - fields_part_count - elevators_count - factory_count - markets_count - total_distance - total_cost - unplanned_crops_count - unplanned_fields_count - unplanned_elevators_count - unplanned_factories_count - unplanned_markets_count entity_warning_type: description: "Тип предупрежения:\n * `NO_COMPATIBLE_STORAGE` - отсутствуют\ \ совместимые места хранения\n * `NO_AVAILABLE_MOVEMENT` - объект отсутствует\ \ в матрице перемещений\n * `NO_AVAILABLE_CONSUMER` - для данного вида культуры\ \ отсутствует потребитель\n" type: string enum: - NO_COMPATIBLE_STORAGE - NO_AVAILABLE_MOVEMENT - NO_AVAILABLE_CONSUMER example: NO_COMPATIBLE_STORAGE entity_type: description: Тип сущности. type: string enum: - TASK - SETTINGS - CROP - FIELD - ELEVATOR - FACTORY - MARKET - STORAGE - SILO - BUNKER - DRYER - GATE - CONSUMER - LEFTOVER - FORECAST_ELEMENT example: TASK entity_path: description: 'Описание сущности и путь до нее. ' type: object additionalProperties: false nullable: true properties: entity_key: description: Ключ целевой сущности. type: string nullable: true maxLength: 1024 example: order_0001 entity_type: $ref: '#/components/schemas/entity_type' child_entity: $ref: '#/components/schemas/entity_path' required: - entity_key - entity_type entity_warning: description: Описание результата проверки входных данных. type: object additionalProperties: false properties: type: $ref: '#/components/schemas/entity_warning_type' info: description: Информация о предупреждении. type: string nullable: true minLength: 0 maxLength: 2048 example: entity warning entities: description: Список сущностей, которые относятся к предупреждению. type: array uniqueItems: false minItems: 0 maxItems: 100001 items: $ref: '#/components/schemas/entity_path' required: - type - entities entity_warning_list: description: "Список предупреждений. В зависимости от флага `calculation_settings.treat_warnings_as_errors`\ \ - сработавшие проверки интерпретируются как ошибки или приводят к удалению\ \ некорректных данных из расчета. \n" type: array uniqueItems: false minItems: 0 maxItems: 100001 items: $ref: '#/components/schemas/entity_warning' example: [] unplanned_items: description: Список незапланированных сущностей. type: object additionalProperties: false properties: crop_keys: description: Список ключей незапланированных культур. type: array uniqueItems: true minItems: 0 maxItems: 501 items: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 field_keys: description: Список ключей незапланированных полей. type: array uniqueItems: true minItems: 0 maxItems: 20001 items: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: field_key_1 elevator_keys: description: Список ключей незапланированных элеваторов. type: array uniqueItems: true minItems: 0 maxItems: 501 items: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: elevator_key_1 factory_keys: description: Список ключей незапланированных заводов. type: array uniqueItems: true minItems: 0 maxItems: 501 items: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: factory_key_1 market_keys: description: Список ключей незапланированных рынков. type: array uniqueItems: true minItems: 0 maxItems: 501 items: description: Ключ, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: market_key_1 calculation_progress: description: 'Прогресс расчета в процентах. Прогресс отражает текущее количество завершенных шагов. ' type: integer format: int32 default: 0 minimum: 0 maximum: 100 example: 52 calculation_status: description: "Статус расчета:\n * `WAITING` - расчет ожидает запуска.\n *\ \ `IN_PROGRESS` - расчет в процессе.\n * `FINISHED_IN_TIME` - расчет завершился\ \ раньше указанного времени на планирование.\n * `FINISHED_OUT_OF_TIME` -\ \ расчет завершился, так как закончилось указанное время на планирование,\ \ при этом полученные маршруты могут не соответствовать целям планирования\ \ (при этом они гарантированно валидные).\n * `CANCELED` - расчет был отменен,\ \ так как была получена команда на отмену.\n * `CANCELED_BY_TIMEOUT` - расчет\ \ был отменен автоматически, так как превышено время ожидания в очереди.\n\ \ * `FAILED` - расчет завершился с ошибкой.\n" type: string enum: - WAITING - IN_PROGRESS - FINISHED_IN_TIME - FINISHED_OUT_OF_TIME - CANCELED - CANCELED_BY_TIMEOUT - FAILED example: FINISHED_IN_TIME time_duration: description: 'Продолжительность временного отрезка в формате [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). ' type: string format: duration x-custom-format: duration pattern: ^P(?!$)((\d+Y)|(\d+\.\d+Y$))?((\d+M)|(\d+\.\d+M$))?((\d+W)|(\d+\.\d+W$))?((\d+D)|(\d+\.\d+D$))?(T(?=\d)((\d+H)|(\d+\.\d+H$))?((\d+M)|(\d+\.\d+M$))?(\d+(\.\d+)?S)?)??$ minLength: 3 maxLength: 16 default: PT0S example: P1Y1M1DT2H12M34.3S calculation_info: description: Информация о расчете. type: object additionalProperties: false properties: status: $ref: '#/components/schemas/calculation_status' result_version: description: Версия текущего результата расчета. type: integer format: int32 minimum: 0 maximum: 1000000 example: 133 preparing_time: description: Время подготовки к расчету (конвертация данных), формат [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). $ref: '#/components/schemas/time_duration' business_validation_time: description: Время бизнес-проверки данных, формат [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). $ref: '#/components/schemas/time_duration' math_validation_time: description: Время математической проверки данных, формат [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). $ref: '#/components/schemas/time_duration' waiting_time: description: Время ожидания расчета в очереди, формат [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). $ref: '#/components/schemas/time_duration' calculation_time: description: Время фактического расчета, формат [ISO 8601 duration](https://ru.wikipedia.org/wiki/ISO_8601#Durations). $ref: '#/components/schemas/time_duration' required: - status - result_version - preparing_time - business_validation_time - math_validation_time - waiting_time - calculation_time plan_result: description: Результат планирования. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' project: $ref: '#/components/schemas/project' statistics: $ref: '#/components/schemas/plan_statistics' warnings: $ref: '#/components/schemas/entity_warning_list' unplanned_items: $ref: '#/components/schemas/unplanned_items' progress: $ref: '#/components/schemas/calculation_progress' info: $ref: '#/components/schemas/calculation_info' required: - tracedata - project - statistics - progress - info schema_error: description: Ошибка по схеме. type: object additionalProperties: false properties: entity: description: Идентификатор целевой сущности. type: string nullable: true maxLength: 1024 example: order_0001 message: description: Сообщение об ошибке. type: string example: bad input data required: - entity - message schema_error_list: description: Список ошибок. type: array uniqueItems: false minItems: 0 maxItems: 15001 items: $ref: '#/components/schemas/schema_error' example: [] entity_error_type: description: "Тип ошибки:\n * `UNIQUE_IDS_VIOLATION` - все идентификаторы должны\ \ быть уникальными\n * `INCONSISTENT_REFERENCE` - ссылка на несуществующую\ \ сущность\n * `INVALID_TIMELINE` - пересечение временных окон\n * `INVALID_DATEWINDOW`\ \ - окно заканчивается раньше чем начинается\n * `INVALID_LEFTOVER_AMOUNT`\ \ - количество зерна, указанное в остатке, превышает допустимый размер места\ \ нахождения зерна (поле, место хранения, сушилка, бункер) на указанную дату\n\ \ * `INVALID_LEFTOVER_PER_ONE_TARGET` - для одного места нахождения зерна\ \ указано больше одного остатка\n * `INVALID_CHAMBER_VARIANTS` - для одной\ \ культуры задано больше одного варианта работы сушилки\n" type: string enum: - UNIQUE_IDS_VIOLATION - INCONSISTENT_REFERENCE - INVALID_TIMELINE - INVALID_DATEWINDOW - INVALID_LEFTOVER_AMOUNT - INVALID_LEFTOVER_PER_ONE_TARGET - INVALID_CHAMBER_VARIANTS example: UNIQUE_IDS_VIOLATION entity_error: description: Описание ошибки во входных данных. type: object additionalProperties: false properties: type: $ref: '#/components/schemas/entity_error_type' info: description: Информация об ошибке. type: string nullable: true minLength: 0 maxLength: 2048 example: entity error entities: description: Список сущностей, которые вызвали ошибку. type: array uniqueItems: false minItems: 0 maxItems: 100001 items: $ref: '#/components/schemas/entity_path' required: - type - entities entity_error_list: description: 'Список ошибок в исходных данных, из-за которых запуск расчета невозможен. ' type: array uniqueItems: false minItems: 0 maxItems: 100001 items: $ref: '#/components/schemas/entity_error' custom_400_with_errors_and_warnings: description: Детализация по ошибке 400. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' message: description: Сообщение об ошибке. type: string nullable: true example: bad task data schema_errors: $ref: '#/components/schemas/schema_error_list' logical_errors: $ref: '#/components/schemas/entity_error_list' warnings: $ref: '#/components/schemas/entity_warning_list' required: - tracedata general_401: description: Детализация по ошибке 401. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' message: description: Сообщение об ошибке. type: string nullable: true example: Unauthorized required: - tracedata general_402: description: Детализация по ошибке 402. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' message: description: Сообщение об ошибке. type: string nullable: true example: Payment Required required: - tracedata general_404: description: Детализация по ошибке 404. type: object additionalProperties: false properties: resource_id: description: Идентификатор ресурса. type: string nullable: true default: null example: resource_id detail: description: Детализация по ресурсу. type: object additionalProperties: false nullable: true properties: tracedata: $ref: '#/components/schemas/tracedata' required: - tracedata general_429: description: Детализация по ошибке 429. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' message: description: Сообщение об ошибке. type: string nullable: true example: Too many requests required: - tracedata general_500: description: Детализация по ошибке 500. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' message: description: Сообщение об ошибке. type: string nullable: true example: Internal Server Error required: - tracedata calculation_id: description: Идентификатор расчета. type: string format: uuid example: 11111111-2222-3333-4444-555555555555 calculation_async_result: description: Результат запуска асинхронного расчета. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' id: $ref: '#/components/schemas/calculation_id' required: - id - tracedata calculation_state: description: Текущее состояние расчета. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' progress: $ref: '#/components/schemas/calculation_progress' info: $ref: '#/components/schemas/calculation_info' required: - tracedata - progress - info validate_result: description: Результат проверки данных. type: object additionalProperties: false properties: tracedata: $ref: '#/components/schemas/tracedata' warnings: $ref: '#/components/schemas/entity_warning_list' required: - tracedata - warnings clip_strategy: description: Стратегия обрезки входных данных. type: string example: CROP_WITH_TRANSIT_ELEVATORS check_result: description: Результат проверки работоспособности сервиса. type: object additionalProperties: false properties: health: description: "Текущий показатель здоровья сервиса. \n0 означает неготовность\ \ сервиса выполнять задачи. \n1 означает полную готовность сервиса\ \ для выполнения задач.\n" type: number format: double minimum: 0 maximum: 1 example: 0.999 required: - health version_result: description: Версия сервиса. type: object additionalProperties: false properties: major: description: "Версия продукта.\nВ рамках одной версии гарантируется совместимость\ \ общих структур данных между сервисами. \nИзменение версии указывает\ \ на несовместимые с предыдущими версиями продукта (и, соответственно,\ \ всех сервисов) изменения.\n" type: integer format: int32 minimum: 1 maximum: 100 example: 4 minor: description: 'Минорная версия сервиса. Изменение версии указывает на новую функциональность. Обновление имеет обратную совместимость в рамках мажорной версии сервиса. ' type: integer format: int32 minimum: 0 maximum: 111 example: 4 build: description: "Версия сборки. \nИзменяется при обновлении документации\ \ и исправлении ошибок.\n" type: string minLength: 1 maxLength: 64 example: 1754RC required: - major - minor - build file_html: description: Файл с данными в формате [HTML](https://html.spec.whatwg.org/). type: string file_json: description: Файл с данными в формате [JSON](https://www.json.org/). type: string examples: PlanTaskSmall: summary: 1 поле value: crops: - key: bean base_humidity: 180 compatible_storage_types: - granary compatible_silo_types: [] attributes: - key: full_name value: Бобы сои fields: - key: field_1 crop_key: bean capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-05' capacity: 1000 humidity_forecast: - date_window: from: '2023-01-01' to: '2023-01-03' humidity: 220 - date_window: from: '2023-01-04' to: '2023-01-05' humidity: 170 amount: 5000 attributes: - key: full_number value: 57-4-6-130-227 elevators: - key: elevator_1 gate: key: gate_1 input_capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 100 output_capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 100 dryers: - key: dryer_1 chamber_variants: - crop_key: bean capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 15000 productivity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' productivity: 5000 storages: - key: storage_1 type: granary capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-05' capacity: 5000 - date_window: from: '2023-01-06' to: '2023-01-10' capacity: 4100 silos: - key: silo_1 type: trench deployment_cost: 1888 capacity_forecast: - date_window: from: '2023-01-01' to: '2023-07-15' capacity: 50000 attributes: [] factories: - key: factory_1 gate: key: factory_gate_1 input_capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 2000 output_capacity_forecast: [] dryers: - key: factory_dryer_1 chamber_variants: - crop_key: bean capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 17000 productivity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' productivity: 2700 bunkers: - key: bunker_1 capacity_forecast: - date_window: from: '2023-01-01' to: '2023-01-10' capacity: 5000 consumers: - key: factory_line_1 crop_key: bean consumption_forecast: - date_window: from: '2023-01-05' to: '2023-01-11' capacity: 500 - date_window: from: '2023-01-12' to: '2023-01-15' capacity: 20 stock_forecast: - date_window: from: '2023-01-01' to: '2023-01-12' min_stock_days: 2 attributes: [] markets: - key: market_1 contracts: - key: contract_1 type: BUY target_keys: - elevator_1 pricelist: - crop_key: bean price_forecast: - date_window: from: '2023-01-01' to: '2023-01-15' price: 280 - key: contract_2 type: SELL target_keys: - factory_1 pricelist: - crop_key: bean price_forecast: - date_window: from: '2023-01-01' to: '2023-01-15' price: 320 attributes: [] movement_matrix: - source_key: field_1 destination_key: factory_1 distance: 100 cost_per_transport: 5000 - source_key: field_1 destination_key: elevator_1 distance: 70 cost_per_transport: 5000 - source_key: elevator_1 destination_key: factory_1 distance: 40 cost_per_transport: 5000 - source_key: elevator_1 destination_key: market_1 distance: 5 cost_per_transport: 5000 - source_key: factory_1 destination_key: market_1 distance: 5 cost_per_transport: 5000 leftovers: - crop_key: bean humidity: 50 target_key: field_1 target_detail_key: null amount: 4990 plan_settings: project_settings: configuration: OPTIMIZE_DISTANCE start_date: '2023-01-01' end_date: '2023-01-15' transport_capacity: 23 calculation_settings: result_ttl: PT20M treat_warnings_as_errors: false PlanResultSmall: summary: 1 поле value: tracedata: code: 69c507e4-7c2a-46fd-a862-a503cf27b1a3 client: veeroute_|_example server: Agro:client service: AGRO operation: run_plan_calculation time: '2024-02-21T16:55:35.370332Z' project: - type: RELOCATE crop_key: bean source: date: '2023-09-15' target_key: field_1 target_type: FIELD crop_type: DRY mass: 100 humidity: 15 destination: date: '2023-09-15' target_key: factory_1 target_type: FACTORY crop_type: DRY mass: 100 humidity: 15 measurements: distance: 50 cost: 4500 statistics: days_count: 1 crops_count: 1 fields_count: 1 fields_part_count: 0 elevators_count: 1 factory_count: 1 markets_count: 1 total_distance: 1888 total_cost: 100.1 unplanned_crops_count: 0 unplanned_fields_count: 0 unplanned_elevators_count: 0 unplanned_factories_count: 0 unplanned_markets_count: 0 progress: 100 info: status: FINISHED_IN_TIME result_version: 142 preparing_time: PT1M10S business_validation_time: PT1M10S math_validation_time: PT1M10S waiting_time: PT15S calculation_time: PT1M10S warnings: [] Result400: summary: Ошибка в данных value: tracedata: code: 11111111-2222-3333-4444-555555555555 client: veeroute_|_example server: server_name service: AGRO operation: run_plan_calculation time: '2024-02-21T09:30:00+03:00' message: bad task data schema_errors: [] logical_errors: [] warnings: [] responses: '401': description: 'Ошибка доступа - токен отсутствует или невалиден ' content: application/json: schema: $ref: '#/components/schemas/general_401' '402': description: Необходима оплата content: application/json: schema: $ref: '#/components/schemas/general_402' '404': description: Запрашиваемая сущность не найдена content: application/json: schema: $ref: '#/components/schemas/general_404' '405': description: 'Метод запрещен для данного ресурса, проверьте указанный метод (POST, GET, ...) ' '406': description: 'Клиент не способен обработать формат ответа, проверьте заголовки ' '415': description: 'Неприемлемый формат запроса, проверьте заголовки ' '429': description: Превышено количество запросов content: application/json: schema: $ref: '#/components/schemas/general_429' '500': description: Внутренняя ошибка сервера content: application/json: schema: $ref: '#/components/schemas/general_500' '501': description: Функциональность не доступна для использования '502': description: Неверный шлюз '503': description: Сервис не доступен '504': description: Шлюз не отвечает 400_with_errors_and_warnings: description: Неверный запрос - данные содержат ошибки content: application/json: schema: $ref: '#/components/schemas/custom_400_with_errors_and_warnings' examples: Result400: $ref: '#/components/examples/Result400' parameters: result_id: name: id in: path description: Идентификатор расчета. required: true schema: $ref: '#/components/schemas/calculation_id' clip_key: name: clip_key description: Ключ целевой сущности. in: path required: true schema: description: Ключ сущности, уникальный идентификатор. type: string minLength: 1 maxLength: 1024 example: crop_key_1 clip_strategy: name: clip_strategy description: "Стратегия обрезки входных данных:\n * `CROP_WITH_ALL_ELEVATORS`\ \ - из target_key берется ключ культуры, отфильтровываются все объекты (поля,\ \ элеваторы, заводы и остатки), которые могут принимать участие в обработке\ \ данной культуры\n * `CROP_WITH_TRANSIT_ELEVATORS` - аналогично CROP_WITH_ALL_ELEVATORS,\ \ но остаются только те элеваторы, от которых есть путь проезда одновременно\ \ до поля и до завода\n" in: query required: false schema: $ref: '#/components/schemas/clip_strategy' filename: name: filename description: Название файла. in: path required: true schema: description: Название файла. type: string minLength: 6 maxLength: 128 example: file_en.html