{
  "openapi": "3.0.1",
  "info": {
    "title": "api/insurance/attach-policy",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/gw/insurance/v1/insurances/attach-policy": {
      "post": {
        "tags": [
          "Insurance"
        ],
        "summary": "Прикрепление полиса к страховке",
        "description": "Операция доступна только для страховок страховой компании, указанной в заявке.\r\nПосле успешной загрузки статус заявки обновится, пользователю будет начислен кешбэк.",
        "operationId": "AttachPolicyToInsurance",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPolicyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPolicyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPolicyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPolicyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Client Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AttachPolicyRequest": {
        "required": [
          "file",
          "policy_number"
        ],
        "type": "object",
        "properties": {
          "policy_number": {
            "minLength": 1,
            "type": "string"
          },
          "file": {
            "$ref": "#/components/schemas/FileBase64Dto"
          }
        },
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FileBase64Dto": {
        "required": [
          "file_base64"
        ],
        "type": "object",
        "properties": {
          "file_base64": {
            "minLength": 1,
            "type": "string"
          },
          "content_type": {
            "type": "string",
            "nullable": true
          },
          "file_name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}