{
  "openapi": "3.0.4",
  "info": {
    "title": "api/insurance/cargo-insurance",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/integration/v1/cargo-insurances/{insuranceId}": {
      "get": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Возвращает заявку на страхование груза для интеграционного API.",
        "description": "Выполнить действие может только страховая компания, относящаяся к заявке.",
        "operationId": "get_integration_v1_cargo-insurances__insuranceId_",
        "parameters": [
          {
            "name": "insuranceId",
            "in": "path",
            "description": "Идентификатор заявки на страхование.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CargoInsuranceIntegrationDto"
                },
                "example": {
                  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                  "ati_id": "123456",
                  "firm_name": "ООО Ромашка",
                  "account_inn": "7701234567",
                  "firm_requisites": {
                    "requisite_id": "123",
                    "legal_address": {
                      "address_id": "123456",
                      "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                    },
                    "post_address": {
                      "address_id": "123456",
                      "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                    },
                    "full_name": "ООО Ромашка",
                    "inn": "7701234567",
                    "ogrn": "1027700123456",
                    "kpp": "770101001",
                    "rs": "40702810900000000001",
                    "ks": "30101810400000000225",
                    "bik": "044525225",
                    "bank": "ПАО Сбербанк",
                    "okpo": "12345678",
                    "signees": [
                      {
                        "signee_id": 123,
                        "requisite_id": 1234,
                        "full_name": "Иванов Иван Иванович",
                        "position": "Директор",
                        "act_upon": "Устав"
                      }
                    ]
                  },
                  "change_date": "2026-05-28T10:00:00",
                  "status": "Insured",
                  "status_change_date": "2026-05-28T11:00:00",
                  "start_date": "2026-06-01",
                  "end_date": "2026-12-31",
                  "sum": 150000,
                  "tariff_sum": 3500,
                  "tariff": 2.33,
                  "franchise_sum": 10000,
                  "franchise": 5,
                  "currency": "RUB",
                  "policy_number": "POL-123456",
                  "policy_file_name": "policy.pdf",
                  "policy_file_url": "https://example.com/policy.pdf",
                  "policy_template_file_url": "https://example.com/policy-template.pdf",
                  "price_in_policy": true,
                  "cargo": {
                    "cargo_type_name": "Бытовая техника",
                    "cargo_name": "Холодильники",
                    "cargo_package_count": 10,
                    "cargo_package_type_name": "Паллеты",
                    "cargo_weight": 12000.5,
                    "cargo_attributes_description": "С хрупкими элементами",
                    "sealing_number": "PL-778899",
                    "is_groupage": false,
                    "cargo_volume": 0,
                    "is_used": false,
                    "is_perishable": false,
                    "is_secured": false,
                    "is_fragile": false,
                    "adr": false,
                    "inc_load_unload": false,
                    "is_fraud_risk": false
                  },
                  "route_vehicle": {
                    "from_city": "Москва",
                    "to_city": "Санкт-Петербург",
                    "distance": 700000,
                    "vehicle_number": "А123АА77",
                    "document_number_type": "CMR",
                    "document_number": "CMR-123456",
                    "truck_type": "Тягач",
                    "extra_points": [
                      {
                        "point_type": 1,
                        "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                        "city_name": "Казань",
                        "city_id": 0
                      }
                    ],
                    "vehicle_passport_files": [
                      {
                        "name": "policy.pdf",
                        "url": "https://example.com/policy.pdf"
                      }
                    ],
                    "driver_passport_files": [
                      {
                        "name": "policy.pdf",
                        "url": "https://example.com/policy.pdf"
                      }
                    ],
                    "driver_license_files": [
                      {
                        "name": "policy.pdf",
                        "url": "https://example.com/policy.pdf"
                      }
                    ]
                  },
                  "carrier": {
                    "carrier_inn": "7812345678",
                    "carrier_name": "ООО Перевозчик",
                    "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
                  },
                  "beneficiary": {
                    "beneficiary_inn": "7701234567",
                    "beneficiary_name": "ООО Выгодоприобретатель",
                    "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
                  },
                  "contact": {
                    "id": 12345,
                    "name": "Иван Иванов",
                    "phone": "+7 900 123-45-67",
                    "email": "ivan@example.com"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/cargo-insurances": {
      "post": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Поиск заявок на страхование грузов для страховой компании.",
        "description": "В выборку попадают только заявки страховой компании, от имени которой выполняется запрос.\nЕсли не передать значения `skip` и `take`, используются значения по умолчанию 0 и 10 соответственно.",
        "operationId": "post_integration_v1_cargo-insurances",
        "requestBody": {
          "description": "Параметры поиска заявок для страховой компании.",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SearchCargoInsurancesIntegrationRequestDto"
                  }
                ],
                "description": "Тело поиска заявок на страхование грузов (интеграционный метод для страховых)",
                "example": {
                  "skip": 0,
                  "take": 10,
                  "firms": [
                    12325
                  ],
                  "status": "Insured",
                  "from_add_date": "2026-05-28T10:00:00+00:00",
                  "to_add_date": "2026-05-29T10:00:00+00:00"
                }
              },
              "example": {
                "skip": 0,
                "take": 10,
                "firms": [
                  12325
                ],
                "status": "Insured",
                "from_add_date": "2026-05-28T10:00:00+00:00",
                "to_add_date": "2026-05-29T10:00:00+00:00"
              }
            },
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SearchCargoInsurancesIntegrationRequestDto"
                  }
                ],
                "description": "Тело поиска заявок на страхование грузов (интеграционный метод для страховых)",
                "example": {
                  "skip": 0,
                  "take": 10,
                  "firms": [
                    12325
                  ],
                  "status": "Insured",
                  "from_add_date": "2026-05-28T10:00:00+00:00",
                  "to_add_date": "2026-05-29T10:00:00+00:00"
                }
              },
              "example": {
                "skip": 0,
                "take": 10,
                "firms": [
                  12325
                ],
                "status": "Insured",
                "from_add_date": "2026-05-28T10:00:00+00:00",
                "to_add_date": "2026-05-29T10:00:00+00:00"
              }
            },
            "text/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SearchCargoInsurancesIntegrationRequestDto"
                  }
                ],
                "description": "Тело поиска заявок на страхование грузов (интеграционный метод для страховых)",
                "example": {
                  "skip": 0,
                  "take": 10,
                  "firms": [
                    12325
                  ],
                  "status": "Insured",
                  "from_add_date": "2026-05-28T10:00:00+00:00",
                  "to_add_date": "2026-05-29T10:00:00+00:00"
                }
              },
              "example": {
                "skip": 0,
                "take": 10,
                "firms": [
                  12325
                ],
                "status": "Insured",
                "from_add_date": "2026-05-28T10:00:00+00:00",
                "to_add_date": "2026-05-29T10:00:00+00:00"
              }
            },
            "application/*+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SearchCargoInsurancesIntegrationRequestDto"
                  }
                ],
                "description": "Тело поиска заявок на страхование грузов (интеграционный метод для страховых)",
                "example": {
                  "skip": 0,
                  "take": 10,
                  "firms": [
                    12325
                  ],
                  "status": "Insured",
                  "from_add_date": "2026-05-28T10:00:00+00:00",
                  "to_add_date": "2026-05-29T10:00:00+00:00"
                }
              },
              "example": {
                "skip": 0,
                "take": 10,
                "firms": [
                  12325
                ],
                "status": "Insured",
                "from_add_date": "2026-05-28T10:00:00+00:00",
                "to_add_date": "2026-05-29T10:00:00+00:00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CargoInsuranceIntegrationListDto"
                },
                "example": {
                  "total": 5,
                  "insurances": [
                    {
                      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "ati_id": "123456",
                      "firm_name": "ООО Ромашка",
                      "account_inn": "7701234567",
                      "firm_requisites": {
                        "requisite_id": "123",
                        "legal_address": {
                          "address_id": "123456",
                          "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                        },
                        "post_address": {
                          "address_id": "123456",
                          "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                        },
                        "full_name": "ООО Ромашка",
                        "inn": "7701234567",
                        "ogrn": "1027700123456",
                        "kpp": "770101001",
                        "rs": "40702810900000000001",
                        "ks": "30101810400000000225",
                        "bik": "044525225",
                        "bank": "ПАО Сбербанк",
                        "okpo": "12345678",
                        "signees": [
                          {
                            "signee_id": 123,
                            "requisite_id": 1234,
                            "full_name": "Иванов Иван Иванович",
                            "position": "Директор",
                            "act_upon": "Устав"
                          }
                        ]
                      },
                      "change_date": "2026-05-28T10:00:00",
                      "status": "Insured",
                      "status_change_date": "2026-05-28T11:00:00",
                      "start_date": "2026-06-01",
                      "end_date": "2026-12-31",
                      "sum": 150000,
                      "tariff_sum": 3500,
                      "tariff": 2.33,
                      "franchise_sum": 10000,
                      "franchise": 5,
                      "currency": "RUB",
                      "policy_number": "POL-123456",
                      "policy_file_name": "policy.pdf",
                      "policy_file_url": "https://example.com/policy.pdf",
                      "policy_template_file_url": "https://example.com/policy-template.pdf",
                      "invoice_url": "https://example.com/invoice.pdf",
                      "payment_url": "https://example.com/payment",
                      "price_in_policy": true,
                      "client_payment_date": "2026-05-29T14:30:00",
                      "insurer_payment_date": "2026-06-02T09:15:00",
                      "deflected_notice_comment": "Недостаточно документов для оформления полиса",
                      "cargo": {
                        "cargo_type_name": "Бытовая техника",
                        "cargo_name": "Холодильники",
                        "cargo_package_count": 10,
                        "cargo_package_type_name": "Паллеты",
                        "cargo_weight": 12000.5,
                        "cargo_attributes_description": "С хрупкими элементами",
                        "sealing_number": "PL-778899",
                        "is_groupage": false,
                        "cargo_volume": 0,
                        "is_used": false,
                        "is_perishable": false,
                        "is_secured": false,
                        "is_fragile": false,
                        "adr": false,
                        "inc_load_unload": false,
                        "is_fraud_risk": false
                      },
                      "route_vehicle": {
                        "from_city": "Москва",
                        "to_city": "Санкт-Петербург",
                        "distance": 700000,
                        "vehicle_number": "А123АА77",
                        "document_number_type": "CMR",
                        "document_number": "CMR-123456",
                        "truck_type": "Тягач",
                        "extra_points": [
                          {
                            "point_type": 1,
                            "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                            "city_name": "Казань",
                            "city_id": 0
                          }
                        ],
                        "vehicle_passport_files": [
                          {
                            "name": "policy.pdf",
                            "url": "https://example.com/policy.pdf"
                          }
                        ],
                        "driver_passport_files": [
                          {
                            "name": "policy.pdf",
                            "url": "https://example.com/policy.pdf"
                          }
                        ],
                        "driver_license_files": [
                          {
                            "name": "policy.pdf",
                            "url": "https://example.com/policy.pdf"
                          }
                        ]
                      },
                      "carrier": {
                        "carrier_inn": "7812345678",
                        "carrier_name": "ООО Перевозчик",
                        "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
                      },
                      "beneficiary": {
                        "beneficiary_inn": "7701234567",
                        "beneficiary_name": "ООО Выгодоприобретатель",
                        "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
                      },
                      "contact": {
                        "id": 12345,
                        "name": "Иван Иванов",
                        "phone": "+7 900 123-45-67",
                        "email": "ivan@example.com"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/cargo-insurances/{insuranceId}/process": {
      "post": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Переводит заявку страхователя из статуса «Новая» или \"Одобрена\" в «Обрабатывается» по интеграционному API.",
        "description": "Допустимы статусы: новая, одобрена.\nВыполнить действие может только страховая компания, относящаяся к заявке.",
        "operationId": "post_integration_v1_cargo-insurances__insuranceId__process",
        "parameters": [
          {
            "name": "insuranceId",
            "in": "path",
            "description": "Идентификатор заявки на страхование.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsuranceMutationIntegrationResultDto"
                },
                "example": {
                  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                  "status": "Insured",
                  "status_change_date": "2026-05-28T10:00:00+00:00",
                  "deflected_notice_comment": "Недостаточно документов"
                }
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/cargo-insurances/{insuranceId}/policy": {
      "post": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Прикрепляет файл полиса к заявке страхования груза в интеграционном API и подтверждает оплату клиента.",
        "description": "После прикрепления полиса рассчитывает кешбэк и подтверждает оплату клиента.\nВыполнить действие может только страховая компания, относящаяся к заявке.\nПолис можно прикрепить из статусов \"новая\", \"обрабатывается\" и \"одобрена\" + застрахована (без оплаты),\nа также из статуса \"застрахована\" при отсутствии платежа клиента.\nТело запроса передаётся в формате `multipart/form-data`.",
        "operationId": "post_integration_v1_cargo-insurances__insuranceId__policy",
        "parameters": [
          {
            "name": "insuranceId",
            "in": "path",
            "description": "Идентификатор заявки на страхование.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          }
        ],
        "requestBody": {
          "description": "Данные формы прикрепления полиса (поля file, policy_number, cargo_cost, policy_tariff, contact_id, additional_contact_id).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "cargo_cost",
                  "contact_id",
                  "file",
                  "policy_number",
                  "policy_tariff"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "Файл полиса.",
                    "format": "binary",
                    "example": "policy.pdf"
                  },
                  "policy_number": {
                    "type": "string",
                    "description": "Номер полиса.",
                    "example": "Полис_12345"
                  },
                  "cargo_cost": {
                    "type": "number",
                    "description": "Стоимость груза.",
                    "format": "double",
                    "example": 1
                  },
                  "policy_tariff": {
                    "type": "number",
                    "description": "Тариф полиса в процентах.",
                    "format": "double",
                    "example": 1
                  },
                  "contact_id": {
                    "type": "integer",
                    "description": "Идентификатор основного контакта страховой компании.",
                    "format": "int32",
                    "example": 0
                  },
                  "additional_contact_id": {
                    "type": "integer",
                    "description": "Идентификатор дополнительного контакта страховой компании.",
                    "format": "int32",
                    "example": 0
                  }
                },
                "example": {
                  "file": "policy.pdf",
                  "policy_number": "Полис_12345",
                  "cargo_cost": 1,
                  "policy_tariff": 1,
                  "contact_id": 0,
                  "additional_contact_id": 0
                }
              },
              "example": {
                "file": "policy.pdf",
                "policy_number": "Полис_12345",
                "cargo_cost": 1,
                "policy_tariff": 1,
                "contact_id": 0,
                "additional_contact_id": 0
              },
              "encoding": {
                "file": {
                  "style": "form"
                },
                "policy_number": {
                  "style": "form"
                },
                "cargo_cost": {
                  "style": "form"
                },
                "policy_tariff": {
                  "style": "form"
                },
                "contact_id": {
                  "style": "form"
                },
                "additional_contact_id": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/cargo-insurances/{insuranceId}/deflect": {
      "post": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Отклоняет заявку на страхование груза назначенной страховой компанией.",
        "description": "Допустимы статусы: одобрена, новая, обрабатывается.\nВыполнить действие может только страховая компания, относящаяся к заявке.",
        "operationId": "post_integration_v1_cargo-insurances__insuranceId__deflect",
        "parameters": [
          {
            "name": "insuranceId",
            "in": "path",
            "description": "Идентификатор заявки на страхование.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          }
        ],
        "requestBody": {
          "description": "Текст причины отклонения для страхователя (поле `deflected_notice_comment` в JSON).",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DeflectInsuranceRequestDto"
                  }
                ],
                "description": "Запрос на отклонение заявки на страхование.",
                "example": {
                  "deflected_notice_comment": "Недостаточно документов для оформления"
                }
              },
              "example": {
                "deflected_notice_comment": "Недостаточно документов для оформления"
              }
            },
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DeflectInsuranceRequestDto"
                  }
                ],
                "description": "Запрос на отклонение заявки на страхование.",
                "example": {
                  "deflected_notice_comment": "Недостаточно документов для оформления"
                }
              },
              "example": {
                "deflected_notice_comment": "Недостаточно документов для оформления"
              }
            },
            "text/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DeflectInsuranceRequestDto"
                  }
                ],
                "description": "Запрос на отклонение заявки на страхование.",
                "example": {
                  "deflected_notice_comment": "Недостаточно документов для оформления"
                }
              },
              "example": {
                "deflected_notice_comment": "Недостаточно документов для оформления"
              }
            },
            "application/*+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DeflectInsuranceRequestDto"
                  }
                ],
                "description": "Запрос на отклонение заявки на страхование.",
                "example": {
                  "deflected_notice_comment": "Недостаточно документов для оформления"
                }
              },
              "example": {
                "deflected_notice_comment": "Недостаточно документов для оформления"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsuranceMutationIntegrationResultDto"
                },
                "example": {
                  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                  "status": "Insured",
                  "status_change_date": "2026-05-28T10:00:00+00:00",
                  "deflected_notice_comment": "Недостаточно документов"
                }
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/cargo-insurances/confirm-payments": {
      "post": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Подтверждает оплату клиентом по списку заявок на страхование грузов от страховой компании для интеграционного АПИ.",
        "description": "Допустимы статусы: застрахована, новая, обрабатывается, одобрена.",
        "operationId": "post_integration_v1_cargo-insurances_confirm-payments",
        "requestBody": {
          "description": "Идентификаторы заявок.",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "example": [
                "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
              ]
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "example": [
                "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
              ]
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "example": [
                "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
              ]
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "example": [
                "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConfirmPaymentResultDto"
                  },
                  "example": [
                    {
                      "id": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7",
                      "status": "Insured",
                      "status_change_date": "2026-05-28T10:00:00+00:00",
                      "success": true,
                      "error_message": "Заявка не найдена",
                      "client_payment_date": "2026-05-29T14:30:00+00:00",
                      "cash_back_sum": 150,
                      "cash_back_percent": 5
                    }
                  ]
                },
                "example": [
                  {
                    "id": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7",
                    "status": "Insured",
                    "status_change_date": "2026-05-28T10:00:00+00:00",
                    "success": true,
                    "error_message": "Заявка не найдена",
                    "client_payment_date": "2026-05-29T14:30:00+00:00",
                    "cash_back_sum": 150,
                    "cash_back_percent": 5
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    },
    "/integration/v1/insurance-cargo/{insuranceId}/files": {
      "get": {
        "tags": [
          "CargoInsurance"
        ],
        "summary": "Возвращает список файлов заявки на страхование груза для интеграционного API.",
        "description": "Доступно только страховой компании, которой принадлежит заявка.",
        "operationId": "get_integration_v1_insurance-cargo__insuranceId__files",
        "parameters": [
          {
            "name": "insuranceId",
            "in": "path",
            "description": "Идентификатор заявки на страхование.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileLinkDto"
                  },
                  "example": [
                    {
                      "name": "policy.pdf",
                      "url": "https://example.com/policy.pdf"
                    }
                  ]
                },
                "example": [
                  {
                    "name": "policy.pdf",
                    "url": "https://example.com/policy.pdf"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Неверные входные данные.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "invalid_input_data",
                  "reason": "Неверные входные данные."
                }
              }
            }
          },
          "401": {
            "description": "Не авторизован",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "un_authorized",
                  "reason": "Не авторизован"
                }
              }
            }
          },
          "402": {
            "description": "Метод доступен только платным пользователям.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "payment_required",
                  "reason": "Метод доступен только платным пользователям."
                }
              }
            }
          },
          "403": {
            "description": "Отсутствует разрешение.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "forbidden",
                  "reason": "Отсутствует разрешение."
                }
              }
            }
          },
          "404": {
            "description": "Ресурс не найден",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "not_found",
                  "reason": "Ресурс не найден"
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка во время выполнения запроса.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "internal_error",
                  "reason": "Произошла ошибка во время выполнения запроса."
                }
              }
            }
          },
          "504": {
            "description": "Сервер не ответил во время.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "timeout",
                  "reason": "Сервер не ответил во время."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchCargoInsurancesIntegrationRequestDto": {
        "type": "object",
        "properties": {
          "skip": {
            "type": "integer",
            "description": "Сколько заявок пропустить",
            "format": "int32",
            "example": 0
          },
          "take": {
            "type": "integer",
            "description": "Сколько заявок вернуть",
            "format": "int32",
            "example": 10
          },
          "firms": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Список firmId страхователей",
            "nullable": true,
            "example": [
              12325
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InsuranceIntegrationStatus"
              }
            ],
            "description": "Статус заявки",
            "nullable": true,
            "example": "Insured"
          },
          "from_add_date": {
            "type": "string",
            "description": "Дата начала периода по дате создания заявки",
            "format": "date-time",
            "nullable": true,
            "example": "2026-05-28T10:00:00+00:00"
          },
          "to_add_date": {
            "type": "string",
            "description": "Дата конца периода по дате создания заявки",
            "format": "date-time",
            "nullable": true,
            "example": "2026-05-29T10:00:00+00:00"
          }
        },
        "additionalProperties": false,
        "description": "Тело поиска заявок на страхование грузов (интеграционный метод для страховых)",
        "example": {
          "skip": 0,
          "take": 10,
          "firms": [
            12325
          ],
          "status": "Insured",
          "from_add_date": "2026-05-28T10:00:00+00:00",
          "to_add_date": "2026-05-29T10:00:00+00:00"
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Код или тип ошибки.",
            "nullable": true,
            "example": "string"
          },
          "reason": {
            "type": "string",
            "description": "Подробное описание причины ошибки.",
            "nullable": true,
            "example": "string"
          }
        },
        "additionalProperties": false,
        "description": "Модель ошибки ответа API.",
        "example": {
          "error": "string",
          "reason": "string"
        }
      },
      "CargoInsuranceIntegrationListDto": {
        "type": "object",
        "properties": {
          "insurances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FoundCargoInsuranceIntegrationDto"
            },
            "description": "Заявки на страхование грузов найденных по заданным параметрам поиска.",
            "nullable": true,
            "example": [
              {
                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "ati_id": "123456",
                "firm_name": "ООО Ромашка",
                "account_inn": "7701234567",
                "firm_requisites": {
                  "requisite_id": "123",
                  "legal_address": {
                    "address_id": "123456",
                    "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                  },
                  "post_address": {
                    "address_id": "123456",
                    "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                  },
                  "full_name": "ООО Ромашка",
                  "inn": "7701234567",
                  "ogrn": "1027700123456",
                  "kpp": "770101001",
                  "rs": "40702810900000000001",
                  "ks": "30101810400000000225",
                  "bik": "044525225",
                  "bank": "ПАО Сбербанк",
                  "okpo": "12345678",
                  "signees": [
                    {
                      "signee_id": 123,
                      "requisite_id": 1234,
                      "full_name": "Иванов Иван Иванович",
                      "position": "Директор",
                      "act_upon": "Устав"
                    }
                  ]
                },
                "change_date": "2026-05-28T10:00:00",
                "status": "Insured",
                "status_change_date": "2026-05-28T11:00:00",
                "start_date": "2026-06-01",
                "end_date": "2026-12-31",
                "sum": 150000,
                "tariff_sum": 3500,
                "tariff": 2.33,
                "franchise_sum": 10000,
                "franchise": 5,
                "currency": "RUB",
                "policy_number": "POL-123456",
                "policy_file_name": "policy.pdf",
                "policy_file_url": "https://example.com/policy.pdf",
                "policy_template_file_url": "https://example.com/policy-template.pdf",
                "invoice_url": "https://example.com/invoice.pdf",
                "payment_url": "https://example.com/payment",
                "price_in_policy": true,
                "client_payment_date": "2026-05-29T14:30:00",
                "insurer_payment_date": "2026-06-02T09:15:00",
                "deflected_notice_comment": "Недостаточно документов для оформления полиса",
                "cargo": {
                  "cargo_type_name": "Бытовая техника",
                  "cargo_name": "Холодильники",
                  "cargo_package_count": 10,
                  "cargo_package_type_name": "Паллеты",
                  "cargo_weight": 12000.5,
                  "cargo_attributes_description": "С хрупкими элементами",
                  "sealing_number": "PL-778899",
                  "is_groupage": false,
                  "cargo_volume": 0,
                  "is_used": false,
                  "is_perishable": false,
                  "is_secured": false,
                  "is_fragile": false,
                  "adr": false,
                  "inc_load_unload": false,
                  "is_fraud_risk": false
                },
                "route_vehicle": {
                  "from_city": "Москва",
                  "to_city": "Санкт-Петербург",
                  "distance": 700000,
                  "vehicle_number": "А123АА77",
                  "document_number_type": "CMR",
                  "document_number": "CMR-123456",
                  "truck_type": "Тягач",
                  "extra_points": [
                    {
                      "point_type": 1,
                      "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                      "city_name": "Казань",
                      "city_id": 0
                    }
                  ],
                  "vehicle_passport_files": [
                    {
                      "name": "policy.pdf",
                      "url": "https://example.com/policy.pdf"
                    }
                  ],
                  "driver_passport_files": [
                    {
                      "name": "policy.pdf",
                      "url": "https://example.com/policy.pdf"
                    }
                  ],
                  "driver_license_files": [
                    {
                      "name": "policy.pdf",
                      "url": "https://example.com/policy.pdf"
                    }
                  ]
                },
                "carrier": {
                  "carrier_inn": "7812345678",
                  "carrier_name": "ООО Перевозчик",
                  "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
                },
                "beneficiary": {
                  "beneficiary_inn": "7701234567",
                  "beneficiary_name": "ООО Выгодоприобретатель",
                  "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
                },
                "contact": {
                  "id": 12345,
                  "name": "Иван Иванов",
                  "phone": "+7 900 123-45-67",
                  "email": "ivan@example.com"
                }
              }
            ]
          },
          "total": {
            "type": "integer",
            "description": "Общее количество заявок на страхование грузов, подходящих под фильтр.",
            "format": "int32",
            "example": 5
          }
        },
        "additionalProperties": false,
        "description": "Список заявок на страхование грузов (интеграционный API)",
        "example": {
          "total": 5,
          "insurances": [
            {
              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "ati_id": "123456",
              "firm_name": "ООО Ромашка",
              "account_inn": "7701234567",
              "firm_requisites": {
                "requisite_id": "123",
                "legal_address": {
                  "address_id": "123456",
                  "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                },
                "post_address": {
                  "address_id": "123456",
                  "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
                },
                "full_name": "ООО Ромашка",
                "inn": "7701234567",
                "ogrn": "1027700123456",
                "kpp": "770101001",
                "rs": "40702810900000000001",
                "ks": "30101810400000000225",
                "bik": "044525225",
                "bank": "ПАО Сбербанк",
                "okpo": "12345678",
                "signees": [
                  {
                    "signee_id": 123,
                    "requisite_id": 1234,
                    "full_name": "Иванов Иван Иванович",
                    "position": "Директор",
                    "act_upon": "Устав"
                  }
                ]
              },
              "change_date": "2026-05-28T10:00:00",
              "status": "Insured",
              "status_change_date": "2026-05-28T11:00:00",
              "start_date": "2026-06-01",
              "end_date": "2026-12-31",
              "sum": 150000,
              "tariff_sum": 3500,
              "tariff": 2.33,
              "franchise_sum": 10000,
              "franchise": 5,
              "currency": "RUB",
              "policy_number": "POL-123456",
              "policy_file_name": "policy.pdf",
              "policy_file_url": "https://example.com/policy.pdf",
              "policy_template_file_url": "https://example.com/policy-template.pdf",
              "invoice_url": "https://example.com/invoice.pdf",
              "payment_url": "https://example.com/payment",
              "price_in_policy": true,
              "client_payment_date": "2026-05-29T14:30:00",
              "insurer_payment_date": "2026-06-02T09:15:00",
              "deflected_notice_comment": "Недостаточно документов для оформления полиса",
              "cargo": {
                "cargo_type_name": "Бытовая техника",
                "cargo_name": "Холодильники",
                "cargo_package_count": 10,
                "cargo_package_type_name": "Паллеты",
                "cargo_weight": 12000.5,
                "cargo_attributes_description": "С хрупкими элементами",
                "sealing_number": "PL-778899",
                "is_groupage": false,
                "cargo_volume": 0,
                "is_used": false,
                "is_perishable": false,
                "is_secured": false,
                "is_fragile": false,
                "adr": false,
                "inc_load_unload": false,
                "is_fraud_risk": false
              },
              "route_vehicle": {
                "from_city": "Москва",
                "to_city": "Санкт-Петербург",
                "distance": 700000,
                "vehicle_number": "А123АА77",
                "document_number_type": "CMR",
                "document_number": "CMR-123456",
                "truck_type": "Тягач",
                "extra_points": [
                  {
                    "point_type": 1,
                    "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                    "city_name": "Казань",
                    "city_id": 0
                  }
                ],
                "vehicle_passport_files": [
                  {
                    "name": "policy.pdf",
                    "url": "https://example.com/policy.pdf"
                  }
                ],
                "driver_passport_files": [
                  {
                    "name": "policy.pdf",
                    "url": "https://example.com/policy.pdf"
                  }
                ],
                "driver_license_files": [
                  {
                    "name": "policy.pdf",
                    "url": "https://example.com/policy.pdf"
                  }
                ]
              },
              "carrier": {
                "carrier_inn": "7812345678",
                "carrier_name": "ООО Перевозчик",
                "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
              },
              "beneficiary": {
                "beneficiary_inn": "7701234567",
                "beneficiary_name": "ООО Выгодоприобретатель",
                "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
              },
              "contact": {
                "id": 12345,
                "name": "Иван Иванов",
                "phone": "+7 900 123-45-67",
                "email": "ivan@example.com"
              }
            }
          ]
        }
      },
      "ConfirmPaymentResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор заявки.",
            "format": "uuid",
            "example": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7"
          },
          "status": {
            "enum": [
              "Sent",
              "InProgress",
              "Insured",
              "Withdrawn",
              "Request",
              "Deflected",
              "Cancelled",
              "Approved"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/InsuranceIntegrationStatus"
              }
            ],
            "description": "Статус заявки в интеграционном API.",
            "example": "Insured"
          },
          "status_change_date": {
            "type": "string",
            "description": "Дата и время последнего изменения статуса заявки.",
            "format": "date-time",
            "example": "2026-05-28T10:00:00+00:00"
          },
          "success": {
            "type": "boolean",
            "description": "Успешно ли подтверждена оплата по заявке.",
            "example": true
          },
          "error_message": {
            "type": "string",
            "description": "Сообщение об ошибке, если подтверждение неуспешно",
            "nullable": true,
            "example": "Заявка не найдена"
          },
          "client_payment_date": {
            "type": "string",
            "description": "Дата оплаты страхового взноса клиентом",
            "format": "date-time",
            "nullable": true,
            "example": "2026-05-29T14:30:00+00:00"
          },
          "cash_back_sum": {
            "type": "number",
            "description": "Сумма кэшбека в атисах",
            "format": "double",
            "nullable": true,
            "example": 150
          },
          "cash_back_percent": {
            "type": "number",
            "description": "Процент кэшбека",
            "format": "double",
            "nullable": true,
            "example": 5
          }
        },
        "additionalProperties": false,
        "description": "Модель ответа на метод подтверждения оплаты клиентов",
        "example": {
          "id": "f6f9b9f4-ec4a-4fd6-9d2f-6d3a6db0a4d7",
          "status": "Insured",
          "status_change_date": "2026-05-28T10:00:00+00:00",
          "success": true,
          "error_message": "Заявка не найдена",
          "client_payment_date": "2026-05-29T14:30:00+00:00",
          "cash_back_sum": 150,
          "cash_back_percent": 5
        }
      },
      "CargoInsuranceIntegrationDto": {
        "required": [
          "currency"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор заявки",
            "format": "uuid",
            "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "ati_id": {
            "type": "string",
            "description": "Код страхователя в АТИ",
            "nullable": true,
            "example": "123456"
          },
          "firm_name": {
            "type": "string",
            "description": "Наименование страхователя",
            "nullable": true,
            "example": "ООО Ромашка"
          },
          "account_inn": {
            "type": "string",
            "description": "Инн",
            "nullable": true,
            "example": "7701234567"
          },
          "firm_requisites": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RequisiteDto"
              }
            ],
            "description": "Реквизиты страхователя",
            "nullable": true,
            "example": {
              "requisite_id": "123",
              "legal_address": {
                "address_id": "123456",
                "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
              },
              "post_address": {
                "address_id": "123456",
                "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
              },
              "full_name": "ООО Ромашка",
              "inn": "7701234567",
              "ogrn": "1027700123456",
              "kpp": "770101001",
              "rs": "40702810900000000001",
              "ks": "30101810400000000225",
              "bik": "044525225",
              "bank": "ПАО Сбербанк",
              "okpo": "12345678"
            }
          },
          "change_date": {
            "type": "string",
            "description": "Дата изменения заявки",
            "format": "date-time",
            "example": "2026-05-28T10:00:00"
          },
          "status": {
            "enum": [
              "Sent",
              "InProgress",
              "Insured",
              "Withdrawn",
              "Request",
              "Deflected",
              "Cancelled",
              "Approved"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/InsuranceIntegrationStatus"
              }
            ],
            "description": "Статус заявки в интеграционном API.",
            "example": "Insured"
          },
          "status_change_date": {
            "type": "string",
            "description": "Дата изменения статуса",
            "format": "date-time",
            "example": "2026-05-28T11:00:00"
          },
          "start_date": {
            "type": "string",
            "description": "Дата начала действия страховки",
            "format": "date",
            "example": "2026-06-01"
          },
          "end_date": {
            "type": "string",
            "description": "Дата окончания действия страховки",
            "format": "date",
            "example": "2026-12-31"
          },
          "sum": {
            "type": "number",
            "description": "Страховая сумма",
            "format": "double",
            "example": 150000
          },
          "tariff_sum": {
            "type": "number",
            "description": "Стоимость полиса",
            "format": "double",
            "nullable": true,
            "example": 3500
          },
          "tariff": {
            "type": "number",
            "description": "Процент стоимости полиса от страховой суммы",
            "format": "double",
            "nullable": true,
            "example": 2.33
          },
          "franchise_sum": {
            "type": "number",
            "description": "Франшиза",
            "format": "double",
            "nullable": true,
            "example": 10000
          },
          "franchise": {
            "type": "number",
            "description": "Франшиза в %",
            "format": "double",
            "nullable": true,
            "example": 5
          },
          "currency": {
            "type": "string",
            "description": "Валюта заявки",
            "nullable": true,
            "example": "RUB"
          },
          "policy_number": {
            "type": "string",
            "description": "Номер полиса",
            "nullable": true,
            "example": "POL-123456"
          },
          "policy_file_name": {
            "type": "string",
            "description": "Имя файла полиса",
            "nullable": true,
            "example": "policy.pdf"
          },
          "policy_file_url": {
            "type": "string",
            "description": "Ссылка на файл с полисом страхования",
            "nullable": true,
            "example": "https://example.com/policy.pdf"
          },
          "policy_template_file_url": {
            "type": "string",
            "description": "Ссылка на шаблон файла с полисом страхования",
            "nullable": true,
            "example": "https://example.com/policy-template.pdf"
          },
          "price_in_policy": {
            "type": "boolean",
            "description": "Цена в полисе",
            "example": true
          },
          "cargo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CargoDetailsDto"
              }
            ],
            "description": "Информация по грузу",
            "nullable": true,
            "example": {
              "cargo_type_name": "Бытовая техника",
              "cargo_name": "Холодильники",
              "cargo_package_count": 10,
              "cargo_package_type_name": "Паллеты",
              "cargo_weight": 12000.5,
              "cargo_attributes_description": "С хрупкими элементами",
              "sealing_number": "PL-778899",
              "is_groupage": false
            }
          },
          "route_vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RouteVehicleDto"
              }
            ],
            "description": "Маршрут и ТС",
            "nullable": true,
            "example": {
              "from_city": "Москва",
              "to_city": "Санкт-Петербург",
              "distance": 700000,
              "vehicle_number": "А123АА77",
              "document_number_type": "CMR",
              "document_number": "CMR-123456",
              "truck_type": "Тягач"
            }
          },
          "carrier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CarrierDto"
              }
            ],
            "description": "Перевозчик",
            "nullable": true,
            "example": {
              "carrier_inn": "7812345678",
              "carrier_name": "ООО Перевозчик",
              "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
            }
          },
          "beneficiary": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BeneficiaryDto"
              }
            ],
            "description": "Выгодопреобретатель",
            "nullable": true,
            "example": {
              "beneficiary_inn": "7701234567",
              "beneficiary_name": "ООО Выгодоприобретатель",
              "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
            }
          },
          "contact": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactDto"
              }
            ],
            "description": "Контакт",
            "nullable": true,
            "example": {
              "id": 12345,
              "name": "Иван Иванов",
              "phone": "+7 900 123-45-67",
              "email": "ivan@example.com"
            }
          }
        },
        "additionalProperties": false,
        "description": "Модель страхования грузов для интеграций",
        "example": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "ati_id": "123456",
          "firm_name": "ООО Ромашка",
          "account_inn": "7701234567",
          "firm_requisites": {
            "requisite_id": "123",
            "legal_address": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            },
            "post_address": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            },
            "full_name": "ООО Ромашка",
            "inn": "7701234567",
            "ogrn": "1027700123456",
            "kpp": "770101001",
            "rs": "40702810900000000001",
            "ks": "30101810400000000225",
            "bik": "044525225",
            "bank": "ПАО Сбербанк",
            "okpo": "12345678",
            "signees": [
              {
                "signee_id": 123,
                "requisite_id": 1234,
                "full_name": "Иванов Иван Иванович",
                "position": "Директор",
                "act_upon": "Устав"
              }
            ]
          },
          "change_date": "2026-05-28T10:00:00",
          "status": "Insured",
          "status_change_date": "2026-05-28T11:00:00",
          "start_date": "2026-06-01",
          "end_date": "2026-12-31",
          "sum": 150000,
          "tariff_sum": 3500,
          "tariff": 2.33,
          "franchise_sum": 10000,
          "franchise": 5,
          "currency": "RUB",
          "policy_number": "POL-123456",
          "policy_file_name": "policy.pdf",
          "policy_file_url": "https://example.com/policy.pdf",
          "policy_template_file_url": "https://example.com/policy-template.pdf",
          "price_in_policy": true,
          "cargo": {
            "cargo_type_name": "Бытовая техника",
            "cargo_name": "Холодильники",
            "cargo_package_count": 10,
            "cargo_package_type_name": "Паллеты",
            "cargo_weight": 12000.5,
            "cargo_attributes_description": "С хрупкими элементами",
            "sealing_number": "PL-778899",
            "is_groupage": false,
            "cargo_volume": 0,
            "is_used": false,
            "is_perishable": false,
            "is_secured": false,
            "is_fragile": false,
            "adr": false,
            "inc_load_unload": false,
            "is_fraud_risk": false
          },
          "route_vehicle": {
            "from_city": "Москва",
            "to_city": "Санкт-Петербург",
            "distance": 700000,
            "vehicle_number": "А123АА77",
            "document_number_type": "CMR",
            "document_number": "CMR-123456",
            "truck_type": "Тягач",
            "extra_points": [
              {
                "point_type": 1,
                "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                "city_name": "Казань",
                "city_id": 0
              }
            ],
            "vehicle_passport_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ],
            "driver_passport_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ],
            "driver_license_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ]
          },
          "carrier": {
            "carrier_inn": "7812345678",
            "carrier_name": "ООО Перевозчик",
            "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
          },
          "beneficiary": {
            "beneficiary_inn": "7701234567",
            "beneficiary_name": "ООО Выгодоприобретатель",
            "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
          },
          "contact": {
            "id": 12345,
            "name": "Иван Иванов",
            "phone": "+7 900 123-45-67",
            "email": "ivan@example.com"
          }
        }
      },
      "DeflectInsuranceRequestDto": {
        "required": [
          "deflected_notice_comment"
        ],
        "type": "object",
        "properties": {
          "deflected_notice_comment": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "description": "Причина отклонения",
            "example": "Недостаточно документов для оформления"
          }
        },
        "additionalProperties": false,
        "description": "Запрос на отклонение заявки на страхование.",
        "example": {
          "deflected_notice_comment": "Недостаточно документов для оформления"
        }
      },
      "InsuranceMutationIntegrationResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор заявки.",
            "format": "uuid",
            "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "status": {
            "enum": [
              "Sent",
              "InProgress",
              "Insured",
              "Withdrawn",
              "Request",
              "Deflected",
              "Cancelled",
              "Approved"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/InsuranceIntegrationStatus"
              }
            ],
            "description": "Статус заявки в интеграционном API.",
            "example": "Insured"
          },
          "status_change_date": {
            "type": "string",
            "description": "Дата и время последнего изменения статуса заявки.",
            "format": "date-time",
            "example": "2026-05-28T10:00:00+00:00"
          },
          "deflected_notice_comment": {
            "type": "string",
            "description": "Текст причины отклонения для страхователя (если заявка отклонена).",
            "nullable": true,
            "example": "Недостаточно документов"
          }
        },
        "additionalProperties": false,
        "description": "Краткий результат операции над заявкой в интеграционном API (идентификатор, статус и дата смены статуса).",
        "example": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "status": "Insured",
          "status_change_date": "2026-05-28T10:00:00+00:00",
          "deflected_notice_comment": "Недостаточно документов"
        }
      },
      "FileLinkDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Наименование файла.",
            "nullable": true,
            "example": "policy.pdf"
          },
          "url": {
            "type": "string",
            "description": "URL файла.",
            "nullable": true,
            "example": "https://example.com/policy.pdf"
          }
        },
        "additionalProperties": false,
        "description": "Ссылка на файл.",
        "example": {
          "name": "policy.pdf",
          "url": "https://example.com/policy.pdf"
        }
      },
      "InsuranceIntegrationStatus": {
        "enum": [
          "Sent",
          "InProgress",
          "Insured",
          "Withdrawn",
          "Request",
          "Deflected",
          "Cancelled",
          "Approved"
        ],
        "type": "string",
        "description": "Статус заявки в интеграционном API.\n- Sent (Новая)\n- InProgress (Обрабатывается)\n- Insured (Застрахована)\n- Withdrawn (Отозвана)\n- Request (Запрос)\n- Deflected (Отклонена)\n- Cancelled (Аннулирована)\n- Approved (Одобрена)",
        "x-ms-enum-flags": {
          "isFlags": false
        }
      },
      "FoundCargoInsuranceIntegrationDto": {
        "required": [
          "currency"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор заявки.",
            "format": "uuid",
            "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "ati_id": {
            "type": "string",
            "description": "Код страхователя в АТИ.",
            "nullable": true,
            "example": "123456"
          },
          "firm_name": {
            "type": "string",
            "description": "Наименование страхователя.",
            "nullable": true,
            "example": "ООО Ромашка"
          },
          "account_inn": {
            "type": "string",
            "description": "ИНН страхователя.",
            "nullable": true,
            "example": "7701234567"
          },
          "firm_requisites": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RequisiteDto"
              }
            ],
            "description": "Реквизиты страхователя.",
            "nullable": true,
            "example": {
              "requisite_id": "123",
              "legal_address": {
                "address_id": "123456",
                "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
              },
              "post_address": {
                "address_id": "123456",
                "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
              },
              "full_name": "ООО Ромашка",
              "inn": "7701234567",
              "ogrn": "1027700123456",
              "kpp": "770101001",
              "rs": "40702810900000000001",
              "ks": "30101810400000000225",
              "bik": "044525225",
              "bank": "ПАО Сбербанк",
              "okpo": "12345678"
            }
          },
          "change_date": {
            "type": "string",
            "description": "Дата изменения заявки.",
            "format": "date-time",
            "example": "2026-05-28T10:00:00"
          },
          "status": {
            "enum": [
              "Sent",
              "InProgress",
              "Insured",
              "Withdrawn",
              "Request",
              "Deflected",
              "Cancelled",
              "Approved"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/InsuranceIntegrationStatus"
              }
            ],
            "description": "Статус заявки в интеграционном API.",
            "example": "Insured"
          },
          "status_change_date": {
            "type": "string",
            "description": "Дата изменения статуса.",
            "format": "date-time",
            "example": "2026-05-28T11:00:00"
          },
          "start_date": {
            "type": "string",
            "description": "Дата начала действия страховки.",
            "format": "date",
            "example": "2026-06-01"
          },
          "end_date": {
            "type": "string",
            "description": "Дата окончания действия страховки.",
            "format": "date",
            "example": "2026-12-31"
          },
          "sum": {
            "type": "number",
            "description": "Страховая сумма.",
            "format": "double",
            "example": 150000
          },
          "tariff_sum": {
            "type": "number",
            "description": "Стоимость полиса.",
            "format": "double",
            "nullable": true,
            "example": 3500
          },
          "tariff": {
            "type": "number",
            "description": "Процент стоимости полиса от страховой суммы.",
            "format": "double",
            "nullable": true,
            "example": 2.33
          },
          "franchise_sum": {
            "type": "number",
            "description": "Сумма франшизы.",
            "format": "double",
            "nullable": true,
            "example": 10000
          },
          "franchise": {
            "type": "number",
            "description": "Франшиза в %.",
            "format": "double",
            "nullable": true,
            "example": 5
          },
          "currency": {
            "type": "string",
            "description": "Валюта заявки.",
            "nullable": true,
            "example": "RUB"
          },
          "policy_number": {
            "type": "string",
            "description": "Номер полиса.",
            "nullable": true,
            "example": "POL-123456"
          },
          "policy_file_name": {
            "type": "string",
            "description": "Имя файла полиса.",
            "nullable": true,
            "example": "policy.pdf"
          },
          "policy_file_url": {
            "type": "string",
            "description": "Ссылка на файл полиса.",
            "nullable": true,
            "example": "https://example.com/policy.pdf"
          },
          "policy_template_file_url": {
            "type": "string",
            "description": "Ссылка на шаблон полиса.",
            "nullable": true,
            "example": "https://example.com/policy-template.pdf"
          },
          "invoice_url": {
            "type": "string",
            "description": "Ссылка на счёт-фактуру.",
            "nullable": true,
            "example": "https://example.com/invoice.pdf"
          },
          "payment_url": {
            "type": "string",
            "description": "Ссылка на оплату.",
            "nullable": true,
            "example": "https://example.com/payment"
          },
          "price_in_policy": {
            "type": "boolean",
            "description": "Цена в полисе.",
            "example": true
          },
          "client_payment_date": {
            "type": "string",
            "description": "Дата оплаты клиентом.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-05-29T14:30:00"
          },
          "insurer_payment_date": {
            "type": "string",
            "description": "Дата оплаты страховщику.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-06-02T09:15:00"
          },
          "deflected_notice_comment": {
            "type": "string",
            "description": "Комментарий к отклонению.",
            "nullable": true,
            "example": "Недостаточно документов для оформления полиса"
          },
          "cargo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CargoDetailsDto"
              }
            ],
            "description": "Информация по грузу.",
            "nullable": true,
            "example": {
              "cargo_type_name": "Бытовая техника",
              "cargo_name": "Холодильники",
              "cargo_package_count": 10,
              "cargo_package_type_name": "Паллеты",
              "cargo_weight": 12000.5,
              "cargo_attributes_description": "С хрупкими элементами",
              "sealing_number": "PL-778899",
              "is_groupage": false
            }
          },
          "route_vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RouteVehicleDto"
              }
            ],
            "description": "Маршрут и ТС.",
            "nullable": true,
            "example": {
              "from_city": "Москва",
              "to_city": "Санкт-Петербург",
              "distance": 700000,
              "vehicle_number": "А123АА77",
              "document_number_type": "CMR",
              "document_number": "CMR-123456",
              "truck_type": "Тягач"
            }
          },
          "carrier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CarrierDto"
              }
            ],
            "description": "Перевозчик.",
            "nullable": true,
            "example": {
              "carrier_inn": "7812345678",
              "carrier_name": "ООО Перевозчик",
              "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
            }
          },
          "beneficiary": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BeneficiaryDto"
              }
            ],
            "description": "Выгодоприобретатель.",
            "nullable": true,
            "example": {
              "beneficiary_inn": "7701234567",
              "beneficiary_name": "ООО Выгодоприобретатель",
              "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
            }
          },
          "contact": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactDto"
              }
            ],
            "description": "Контакт.",
            "nullable": true,
            "example": {
              "id": 12345,
              "name": "Иван Иванов",
              "phone": "+7 900 123-45-67",
              "email": "ivan@example.com"
            }
          }
        },
        "additionalProperties": false,
        "description": "Модель заявки на страхование груза в списке поиска (интеграционный API).",
        "example": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "ati_id": "123456",
          "firm_name": "ООО Ромашка",
          "account_inn": "7701234567",
          "firm_requisites": {
            "requisite_id": "123",
            "legal_address": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            },
            "post_address": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            },
            "full_name": "ООО Ромашка",
            "inn": "7701234567",
            "ogrn": "1027700123456",
            "kpp": "770101001",
            "rs": "40702810900000000001",
            "ks": "30101810400000000225",
            "bik": "044525225",
            "bank": "ПАО Сбербанк",
            "okpo": "12345678",
            "signees": [
              {
                "signee_id": 123,
                "requisite_id": 1234,
                "full_name": "Иванов Иван Иванович",
                "position": "Директор",
                "act_upon": "Устав"
              }
            ]
          },
          "change_date": "2026-05-28T10:00:00",
          "status": "Insured",
          "status_change_date": "2026-05-28T11:00:00",
          "start_date": "2026-06-01",
          "end_date": "2026-12-31",
          "sum": 150000,
          "tariff_sum": 3500,
          "tariff": 2.33,
          "franchise_sum": 10000,
          "franchise": 5,
          "currency": "RUB",
          "policy_number": "POL-123456",
          "policy_file_name": "policy.pdf",
          "policy_file_url": "https://example.com/policy.pdf",
          "policy_template_file_url": "https://example.com/policy-template.pdf",
          "invoice_url": "https://example.com/invoice.pdf",
          "payment_url": "https://example.com/payment",
          "price_in_policy": true,
          "client_payment_date": "2026-05-29T14:30:00",
          "insurer_payment_date": "2026-06-02T09:15:00",
          "deflected_notice_comment": "Недостаточно документов для оформления полиса",
          "cargo": {
            "cargo_type_name": "Бытовая техника",
            "cargo_name": "Холодильники",
            "cargo_package_count": 10,
            "cargo_package_type_name": "Паллеты",
            "cargo_weight": 12000.5,
            "cargo_attributes_description": "С хрупкими элементами",
            "sealing_number": "PL-778899",
            "is_groupage": false,
            "cargo_volume": 0,
            "is_used": false,
            "is_perishable": false,
            "is_secured": false,
            "is_fragile": false,
            "adr": false,
            "inc_load_unload": false,
            "is_fraud_risk": false
          },
          "route_vehicle": {
            "from_city": "Москва",
            "to_city": "Санкт-Петербург",
            "distance": 700000,
            "vehicle_number": "А123АА77",
            "document_number_type": "CMR",
            "document_number": "CMR-123456",
            "truck_type": "Тягач",
            "extra_points": [
              {
                "point_type": 1,
                "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                "city_name": "Казань",
                "city_id": 0
              }
            ],
            "vehicle_passport_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ],
            "driver_passport_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ],
            "driver_license_files": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ]
          },
          "carrier": {
            "carrier_inn": "7812345678",
            "carrier_name": "ООО Перевозчик",
            "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
          },
          "beneficiary": {
            "beneficiary_inn": "7701234567",
            "beneficiary_name": "ООО Выгодоприобретатель",
            "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
          },
          "contact": {
            "id": 12345,
            "name": "Иван Иванов",
            "phone": "+7 900 123-45-67",
            "email": "ivan@example.com"
          }
        }
      },
      "RequisiteDto": {
        "type": "object",
        "properties": {
          "requisite_id": {
            "type": "string",
            "description": "Id реквизитов",
            "nullable": true,
            "example": "123"
          },
          "legal_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "Юр. адрес",
            "nullable": true,
            "example": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            }
          },
          "post_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "Почтовый адрес",
            "nullable": true,
            "example": {
              "address_id": "123456",
              "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
            }
          },
          "full_name": {
            "type": "string",
            "description": "Название фирмы",
            "nullable": true,
            "example": "ООО Ромашка"
          },
          "inn": {
            "type": "string",
            "description": "ИНН",
            "nullable": true,
            "example": "7701234567"
          },
          "ogrn": {
            "type": "string",
            "description": "ОГРН",
            "nullable": true,
            "example": "1027700123456"
          },
          "kpp": {
            "type": "string",
            "description": "КПП",
            "nullable": true,
            "example": "770101001"
          },
          "rs": {
            "type": "string",
            "description": "Расчётный счёт",
            "nullable": true,
            "example": "40702810900000000001"
          },
          "ks": {
            "type": "string",
            "description": "Корр. счёт",
            "nullable": true,
            "example": "30101810400000000225"
          },
          "bik": {
            "type": "string",
            "description": "БИК банка",
            "nullable": true,
            "example": "044525225"
          },
          "bank": {
            "type": "string",
            "description": "Название банка",
            "nullable": true,
            "example": "ПАО Сбербанк"
          },
          "okpo": {
            "type": "string",
            "description": "ОКПО",
            "nullable": true,
            "example": "12345678"
          },
          "signees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Signee"
            },
            "description": "Данные подписанта",
            "nullable": true,
            "example": [
              {
                "signee_id": 123,
                "requisite_id": 1234,
                "full_name": "Иванов Иван Иванович",
                "position": "Директор",
                "act_upon": "Устав"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "Реквизиты",
        "example": {
          "requisite_id": "123",
          "legal_address": {
            "address_id": "123456",
            "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
          },
          "post_address": {
            "address_id": "123456",
            "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
          },
          "full_name": "ООО Ромашка",
          "inn": "7701234567",
          "ogrn": "1027700123456",
          "kpp": "770101001",
          "rs": "40702810900000000001",
          "ks": "30101810400000000225",
          "bik": "044525225",
          "bank": "ПАО Сбербанк",
          "okpo": "12345678",
          "signees": [
            {
              "signee_id": 123,
              "requisite_id": 1234,
              "full_name": "Иванов Иван Иванович",
              "position": "Директор",
              "act_upon": "Устав"
            }
          ]
        }
      },
      "CargoDetailsDto": {
        "type": "object",
        "properties": {
          "cargo_type_name": {
            "type": "string",
            "description": "Тип груза.",
            "nullable": true,
            "example": "Бытовая техника"
          },
          "cargo_name": {
            "type": "string",
            "description": "Наименование груза.",
            "nullable": true,
            "example": "Холодильники"
          },
          "cargo_package_count": {
            "type": "number",
            "description": "Количество мест груза.",
            "format": "double",
            "nullable": true,
            "example": 10
          },
          "cargo_package_type_name": {
            "type": "string",
            "description": "Тип упаковки груза.",
            "nullable": true,
            "example": "Паллеты"
          },
          "cargo_weight": {
            "type": "number",
            "description": "Вес груза.",
            "format": "float",
            "nullable": true,
            "example": 12000.5
          },
          "cargo_volume": {
            "type": "number",
            "description": "Объём груза.",
            "format": "float",
            "nullable": true,
            "example": 0
          },
          "cargo_attributes_description": {
            "type": "string",
            "description": "Атрибуты груза.",
            "nullable": true,
            "example": "С хрупкими элементами"
          },
          "sealing_number": {
            "type": "string",
            "description": "Номер пломбы.",
            "nullable": true,
            "example": "PL-778899"
          },
          "is_groupage": {
            "type": "boolean",
            "description": "Признак сборного груза.",
            "nullable": true,
            "example": false
          },
          "is_used": {
            "type": "boolean",
            "description": "Признак груза бывшего в употреблении.",
            "nullable": true,
            "example": false
          },
          "is_perishable": {
            "type": "boolean",
            "description": "Признак скоропортящегося груза.",
            "nullable": true,
            "example": false
          },
          "is_secured": {
            "type": "boolean",
            "description": "Признак наличия охраны.",
            "nullable": true,
            "example": false
          },
          "is_fragile": {
            "type": "boolean",
            "description": "Признак груза, подверженного бою/лому.",
            "nullable": true,
            "example": false
          },
          "adr": {
            "type": "boolean",
            "description": "Опасный, класс опасности.",
            "nullable": true,
            "example": false
          },
          "inc_load_unload": {
            "type": "boolean",
            "description": "Погрузо-разгрузочные работы.",
            "nullable": true,
            "example": false
          },
          "is_fraud_risk": {
            "type": "boolean",
            "description": "Риск мошенничества.",
            "nullable": true,
            "example": false
          }
        },
        "additionalProperties": false,
        "description": "Данные о грузе.",
        "example": {
          "cargo_type_name": "Бытовая техника",
          "cargo_name": "Холодильники",
          "cargo_package_count": 10,
          "cargo_package_type_name": "Паллеты",
          "cargo_weight": 12000.5,
          "cargo_attributes_description": "С хрупкими элементами",
          "sealing_number": "PL-778899",
          "is_groupage": false,
          "cargo_volume": 0,
          "is_used": false,
          "is_perishable": false,
          "is_secured": false,
          "is_fragile": false,
          "adr": false,
          "inc_load_unload": false,
          "is_fraud_risk": false
        }
      },
      "RouteVehicleDto": {
        "type": "object",
        "properties": {
          "from_city": {
            "type": "string",
            "description": "Город погрузки.",
            "nullable": true,
            "example": "Москва"
          },
          "to_city": {
            "type": "string",
            "description": "Город выгрузки.",
            "nullable": true,
            "example": "Санкт-Петербург"
          },
          "distance": {
            "type": "integer",
            "description": "Расстояние, в м",
            "format": "int32",
            "nullable": true,
            "example": 700000
          },
          "extra_points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CargoRouteExtraPointDto"
            },
            "description": "Дополнительные точки маршрута.",
            "nullable": true,
            "example": [
              {
                "point_type": 1,
                "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
                "city_name": "Казань",
                "city_id": 0
              }
            ]
          },
          "vehicle_number": {
            "type": "string",
            "description": "Государственный номер транспортного средства.",
            "nullable": true,
            "example": "А123АА77"
          },
          "document_number_type": {
            "type": "string",
            "description": "Тип транспортного документа.",
            "nullable": true,
            "example": "CMR"
          },
          "document_number": {
            "type": "string",
            "description": "Номер документа.",
            "nullable": true,
            "example": "CMR-123456"
          },
          "truck_type": {
            "type": "string",
            "description": "Тип транспортного средства.",
            "nullable": true,
            "example": "Тягач"
          },
          "vehicle_passport_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileLinkDto"
            },
            "description": "Файлы СТС или ПТС транспортного средства.",
            "nullable": true,
            "example": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ]
          },
          "driver_passport_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileLinkDto"
            },
            "description": "Файлы паспорта водителя.",
            "nullable": true,
            "example": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ]
          },
          "driver_license_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileLinkDto"
            },
            "description": "Файлы водительского удостоверения.",
            "nullable": true,
            "example": [
              {
                "name": "policy.pdf",
                "url": "https://example.com/policy.pdf"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "Данные о маршруте и транспортном средстве.",
        "example": {
          "from_city": "Москва",
          "to_city": "Санкт-Петербург",
          "distance": 700000,
          "vehicle_number": "А123АА77",
          "document_number_type": "CMR",
          "document_number": "CMR-123456",
          "truck_type": "Тягач",
          "extra_points": [
            {
              "point_type": 1,
              "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
              "city_name": "Казань",
              "city_id": 0
            }
          ],
          "vehicle_passport_files": [
            {
              "name": "policy.pdf",
              "url": "https://example.com/policy.pdf"
            }
          ],
          "driver_passport_files": [
            {
              "name": "policy.pdf",
              "url": "https://example.com/policy.pdf"
            }
          ],
          "driver_license_files": [
            {
              "name": "policy.pdf",
              "url": "https://example.com/policy.pdf"
            }
          ]
        }
      },
      "CarrierDto": {
        "type": "object",
        "properties": {
          "carrier_inn": {
            "type": "string",
            "description": "ИНН перевозчика.",
            "nullable": true,
            "example": "7812345678"
          },
          "carrier_name": {
            "type": "string",
            "description": "Наименование перевозчика.",
            "nullable": true,
            "example": "ООО Перевозчик"
          },
          "carrier_address": {
            "type": "string",
            "description": "Адрес перевозчика.",
            "nullable": true,
            "example": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
          }
        },
        "additionalProperties": false,
        "description": "Данные перевозчика.",
        "example": {
          "carrier_inn": "7812345678",
          "carrier_name": "ООО Перевозчик",
          "carrier_address": "Россия, г. Санкт-Петербург, Невский пр., д. 1"
        }
      },
      "BeneficiaryDto": {
        "type": "object",
        "properties": {
          "beneficiary_inn": {
            "type": "string",
            "description": "ИНН выгодоприобретателя.",
            "nullable": true,
            "example": "7701234567"
          },
          "beneficiary_name": {
            "type": "string",
            "description": "Наименование выгодоприобретателя.",
            "nullable": true,
            "example": "ООО Выгодоприобретатель"
          },
          "beneficiary_address": {
            "type": "string",
            "description": "Адрес выгодоприобретателя.",
            "nullable": true,
            "example": "Россия, г. Москва, ул. Пушкина, д. 10"
          }
        },
        "additionalProperties": false,
        "description": "Данные выгодоприобретателя.",
        "example": {
          "beneficiary_inn": "7701234567",
          "beneficiary_name": "ООО Выгодоприобретатель",
          "beneficiary_address": "Россия, г. Москва, ул. Пушкина, д. 10"
        }
      },
      "ContactDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id контакта",
            "format": "int32",
            "example": 12345
          },
          "name": {
            "type": "string",
            "description": "Имя контакта",
            "nullable": true,
            "example": "Иван Иванов"
          },
          "phone": {
            "type": "string",
            "description": "Телефон контакта",
            "nullable": true,
            "example": "+7 900 123-45-67"
          },
          "email": {
            "type": "string",
            "description": "Email контакта",
            "nullable": true,
            "example": "ivan@example.com"
          }
        },
        "additionalProperties": false,
        "description": "Контакт страхователя",
        "example": {
          "id": 12345,
          "name": "Иван Иванов",
          "phone": "+7 900 123-45-67",
          "email": "ivan@example.com"
        }
      },
      "Address": {
        "type": "object",
        "properties": {
          "address_id": {
            "type": "string",
            "description": "Id адреса",
            "nullable": true,
            "example": "123456"
          },
          "formatted_text": {
            "type": "string",
            "description": "Строка адреса",
            "nullable": true,
            "example": "Россия, г. Москва, ул. Ленина, д. 1"
          }
        },
        "additionalProperties": false,
        "description": "Адрес",
        "example": {
          "address_id": "123456",
          "formatted_text": "Россия, г. Москва, ул. Ленина, д. 1"
        }
      },
      "Signee": {
        "type": "object",
        "properties": {
          "signee_id": {
            "type": "string",
            "description": "id подписанта",
            "nullable": true,
            "example": 123
          },
          "requisite_id": {
            "type": "string",
            "description": "id реквизитов",
            "nullable": true,
            "example": 1234
          },
          "full_name": {
            "type": "string",
            "description": "ФИО",
            "nullable": true,
            "example": "Иванов Иван Иванович"
          },
          "position": {
            "type": "string",
            "description": "Должность",
            "nullable": true,
            "example": "Директор"
          },
          "act_upon": {
            "type": "string",
            "description": "Действует на основании ...",
            "nullable": true,
            "example": "Устав"
          }
        },
        "additionalProperties": false,
        "description": "Подписант",
        "example": {
          "signee_id": 123,
          "requisite_id": 1234,
          "full_name": "Иванов Иван Иванович",
          "position": "Директор",
          "act_upon": "Устав"
        }
      },
      "CargoRouteExtraPointDto": {
        "type": "object",
        "properties": {
          "point_type": {
            "type": "integer",
            "description": "Тип точки (погрузка/выгрузка).",
            "format": "int32",
            "example": 1
          },
          "address": {
            "type": "string",
            "description": "Адрес точки.",
            "nullable": true,
            "example": "Россия, г. Казань, ул. Кремлевская, д. 5"
          },
          "city_id": {
            "type": "integer",
            "description": "Идентификатор города.",
            "format": "int32",
            "nullable": true,
            "example": 0
          },
          "city_name": {
            "type": "string",
            "description": "Наименование города.",
            "nullable": true,
            "example": "Казань"
          }
        },
        "additionalProperties": false,
        "description": "Дополнительная точка маршрута груза.",
        "example": {
          "point_type": 1,
          "address": "Россия, г. Казань, ул. Кремлевская, д. 5",
          "city_name": "Казань",
          "city_id": 0
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}