openapi: 3.0.1
info:
  title: loader_openapi
  description: Спецификация Стандартного загрузчика
  version: '1.0'

tags:
  - name: information-systems
    description: Информационные системы
  - name: sources
    description: Источники данных
  - name: tasks-pull
    description: Задания на загрузку
  - name: schedules
    description: Расписания
  - name: deployers
    description: Деплоеры
  - name: components
    description: Компоненты
  - name: configs
    description: Конфигурации
  - name: compare-tasks
    description: Задачи сверки
  - name: compare-schedules
    description: Расписания сверки
  - name: sessions
    description: Сеансы
  - name: events
    description: События
  - name: compare-sessions
    description: Сеансы сверки
  - name: compare-results
    description: Результаты сверки
  - name: correction-attempts
    description: Попытки исправления
  - name: correction-exceptions
    description: Исключения исправления
  - name: compare-events
    description: События сверки
  - name: stable-differences
    description: Постоянные различия

paths:
  # Information Systems endpoints
  /api/v1/information-systems:
    get:
      tags:
        - information-systems
      summary: Получить список Информационных систем
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/informationSystemCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - information-systems
      summary: Создать Информационную систему
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/informationSystemBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/information-systems/{mnemonic}:
    put:
      tags:
        - information-systems
      summary: Обновить Информационную систему
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/informationSystemBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/informationSystemBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - information-systems
      summary: Удалить Информационную систему
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Sources endpoints

  /api/v1/sources:
    get:
      tags:
        - sources
      summary: Получить список Источников данных
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/sourceTypeFilter'
        - $ref: '#/components/parameters/isMnemonicFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sourceCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - sources
      summary: Создать Источник данных
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/sourceBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/sources/{mnemonic}:
    put:
      tags:
        - sources
      summary: Обновить Источник данных
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sourceBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/sourceBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - sources
      summary: Удалить Источник данных
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Pull Tasks endpoints
  /api/v1/tasks-pull:
    get:
      tags:
        - tasks-pull
      summary: Получить список Заданий на загрузку
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/actionFilter'
        - $ref: '#/components/parameters/sourceMnemonicFilter'
        - $ref: '#/components/parameters/targetTypeFilter'
        - $ref: '#/components/parameters/targetDatamartFilter'
        - $ref: '#/components/parameters/targetTableFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/taskPullCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - tasks-pull
      summary: Создать Задание на загрузку
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/taskPullBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/tasks-pull/{mnemonic}:
    put:
      tags:
        - tasks-pull
      summary: Обновить Задание на загрузку
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/taskPullBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/taskPullBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - tasks-pull
      summary: Удалить Задание на загрузку
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Schedules endpoints
  /api/v1/schedules:
    get:
      tags:
        - schedules
      summary: Получить список Расписаний
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/enabledFilter'
        - $ref: '#/components/parameters/taskMnemonicFilter'
        - $ref: '#/components/parameters/oneTimeFilter'
        - $ref: '#/components/parameters/overlapModeFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scheduleCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - schedules
      summary: Создать Расписание
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/scheduleBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/schedules/{mnemonic}:
    put:
      tags:
        - schedules
      summary: Обновить Расписание
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/scheduleBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/scheduleBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - schedules
      summary: Удалить Расписание
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Deployers endpoints
  /api/v1/deployers:
    get:
      tags:
        - deployers
      summary: Получить список Деплоеров
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/isMnemonicFilter'
        - $ref: '#/components/parameters/enabledFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deployerCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - deployers
      summary: Создать Деплоер
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/deployerBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/deployers/{mnemonic}:
    put:
      tags:
        - deployers
      summary: Обновить Деплоер
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/deployerBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/deployerBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - deployers
      summary: Удалить Деплоер
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Components endpoints
  /api/v1/components:
    get:
      tags:
        - components
      summary: Получить список Компонентов
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/deployerMnemonicFilter'
        - $ref: '#/components/parameters/componentTypeFilter'
        - $ref: '#/components/parameters/dataFlowTypeFilter'
        - $ref: '#/components/parameters/sourceTypeFilter'
        - $ref: '#/components/parameters/enabledFilter'
        - $ref: '#/components/parameters/configMnemonicFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/componentCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - components
      summary: Создать Компонент
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/componentBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/components/{mnemonic}:
    put:
      tags:
        - components
      summary: Обновить Компонент
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/componentBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/componentBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - components
      summary: Удалить Компонент
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Configs endpoints
  /api/v1/configs:
    get:
      tags:
        - configs
      summary: Получить список Конфигураций
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - configs
      summary: Создать Конфигурацию
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/configBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/configs/{mnemonic}:
    put:
      tags:
        - configs
      summary: Обновить Конфигурацию
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/configBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - configs
      summary: Удалить Конфигурацию
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/components/{component-mnemonic}/config:
    get:
      tags:
        - configs
      summary: Получить Конфигурацию для Компонента
      parameters:
        - $ref: '#/components/parameters/componentMnemonic'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/configBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Compare Tasks endpoints
  /api/v1/compare-tasks:
    get:
      tags:
        - compare-tasks
      summary: Получить список Задач сверки
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/originalSourceMnemonicFilter'
        - $ref: '#/components/parameters/datamartSourceMnemonicFilter'
        - $ref: '#/components/parameters/correctionTargetDatamartFilter'
        - $ref: '#/components/parameters/correctionTargetTableFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/compareTaskCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - compare-tasks
      summary: Создать Задачу сверки
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/compareTaskBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/compare-tasks/{mnemonic}:
    put:
      tags:
        - compare-tasks
      summary: Обновить Задачу сверки
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/compareTaskBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/compareTaskBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - compare-tasks
      summary: Удалить Задачу сверки
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Compare Schedules endpoints
  /api/v1/compare-schedules:
    get:
      tags:
        - compare-schedules
      summary: Получить список Расписаний сверки
      parameters:
        - $ref: '#/components/parameters/mnemonicFilter'
        - $ref: '#/components/parameters/compareTaskMnemonicFilter'
        - $ref: '#/components/parameters/enabledFilter'
        - $ref: '#/components/parameters/oneTimeFilter'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/compareScheduleCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    post:
      tags:
        - compare-schedules
      summary: Создать Расписание сверки
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/compareScheduleBase'
                - $ref: '#/components/schemas/mnemonic'
      responses:
        '201':
          description: Created
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  /api/v1/compare-schedules/{mnemonic}:
    put:
      tags:
        - compare-schedules
      summary: Обновить Расписание сверки
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/compareScheduleBase'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/compareScheduleBase'
                  - $ref: '#/components/schemas/mnemonic'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - compare-schedules
      summary: Удалить Расписание сверки
      parameters:
        - $ref: '#/components/parameters/mnemonic'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Sessions endpoints
  /api/v1/sessions:
    get:
      tags:
        - sessions
      summary: Получить список Сеансов с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/actionFilter'
        - $ref: '#/components/parameters/flkModeFilter'
        - $ref: '#/components/parameters/componentMnemonicFilter'
        - $ref: '#/components/parameters/targetDatamartFilter'
        - $ref: '#/components/parameters/targetTableFilter'
        - $ref: '#/components/parameters/scheduleMnemonicFilter'
        - $ref: '#/components/parameters/statusFilter'
        - $ref: '#/components/parameters/errorCodeFilter'
        - $ref: '#/components/parameters/createTsFilter'
        - $ref: '#/components/parameters/finishTsFilter'
        - $ref: '#/components/parameters/sourceMnemonicFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/isFileDeletedFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sessionCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Events endpoints
  /api/v1/events:
    get:
      tags:
        - events
      summary: Получить список Событий с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/codeFilter'
        - $ref: '#/components/parameters/sessionIdFilter'
        - $ref: '#/components/parameters/componentMnemonicFilter'
        - $ref: '#/components/parameters/componentInstanceIdFilter'
        - $ref: '#/components/parameters/eventTsFilter'
        - $ref: '#/components/parameters/errorCodeFilter'
        - $ref: '#/components/parameters/statusFromFilter'
        - $ref: '#/components/parameters/statusToFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/eventCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Compare sessions endpoints
  /api/v1/compare-sessions:
    get:
      tags:
        - compare-sessions
      summary: Получить список Сеансов сверки с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/compareScheduleMnemonicFilter'
        - $ref: '#/components/parameters/createTsFilter'
        - $ref: '#/components/parameters/componentMnemonicFilter'
        - $ref: '#/components/parameters/componentInstanceIdFilter'
        - $ref: '#/components/parameters/finishTsFilter'
        - $ref: '#/components/parameters/statusFilter'
        - $ref: '#/components/parameters/errorCodeFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/compareSessionCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Compare results endpoints
  /api/v1/compare-results:
    get:
      tags:
        - compare-results
      summary: Получить список Результатов сверки с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/pkCortegeFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/differenceTypeFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/compareResultCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Correction attempts endpoints
  /api/v1/correction-attempts:
    get:
      tags:
        - correction-attempts
      summary: Получить список Попыток исправления с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/pkCortegeFilter'
        - $ref: '#/components/parameters/createTsFilter'
        - $ref: '#/components/parameters/differenceTypeFilter'
        - $ref: '#/components/parameters/sessionIdFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/correctionAttemptCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Correction exceptions endpoints
  /api/v1/correction-exceptions:
    get:
      tags:
        - correction-exceptions
      summary: Получить список Исключений исправления с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/pkCortegeFilter'
        - $ref: '#/components/parameters/originalSourceMnemonicFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/compareTaskMnemonicFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/correctionExceptionCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'
    delete:
      tags:
        - correction-exceptions
      summary: Удалить список Исключений исправления
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/compareTaskMnemonicFilter'

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/correctionExceptionCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '404':
          description: Not Found
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Compare events endpoints
  /api/v1/compare-events:
    get:
      tags:
        - compare-events
      summary: Получить список Событий сверки с сортировкой по идентификатору
      parameters:
        - $ref: '#/components/parameters/idFilter'
        - $ref: '#/components/parameters/codeFilter'
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/componentMnemonicFilter'
        - $ref: '#/components/parameters/componentInstanceIdFilter'
        - $ref: '#/components/parameters/eventTsFilter'
        - $ref: '#/components/parameters/errorCodeFilter'
        - $ref: '#/components/parameters/statusFromFilter'
        - $ref: '#/components/parameters/statusToFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/compareEventCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

  # Stable differences endpoints
  /api/v1/stable-differences:
    get:
      tags:
        - stable-differences
      summary: Получить список Постоянных различий с сортировкой по идентификаторам Сеансов сверки (текущей и предыдущей) и кортежу первичных ключей
      parameters:
        - $ref: '#/components/parameters/compareSessionIdFilter'
        - $ref: '#/components/parameters/compareTaskMnemonicFilter'
        - $ref: '#/components/parameters/pkCortegeFilter'
        - $ref: '#/components/parameters/differenceTypeFilter'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/reverseOrder'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stableDifferenceCollection'
        '400':
          $ref: '#/components/responses/commonBadRequest'
        '500':
          $ref: '#/components/responses/commonInternalServerError'

components:
  schemas:
    informationSystemCollection:
      type: object
      required:
        - information_systems
      properties:
        information_systems:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/informationSystemBase'
              - $ref: '#/components/schemas/mnemonic'

    sourceCollection:
      type: object
      required:
        - sources
      properties:
        sources:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/sourceBase'
              - $ref: '#/components/schemas/mnemonic'

    taskPullCollection:
      type: object
      required:
        - pull_tasks
      properties:
        pull_tasks:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/taskPullBase'
              - $ref: '#/components/schemas/mnemonic'

    scheduleCollection:
      type: object
      required:
        - schedules
      properties:
        schedules:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/scheduleBase'
              - $ref: '#/components/schemas/mnemonic'

    deployerCollection:
      type: object
      required:
        - deployers
      properties:
        deployers:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/deployerBase'
              - $ref: '#/components/schemas/mnemonic'

    componentCollection:
      type: object
      required:
        - components
      properties:
        components:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/componentBase'
              - $ref: '#/components/schemas/mnemonic'

    configCollection:
      type: object
      required:
        - configs
      properties:
        configs:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/configBase'
              - $ref: '#/components/schemas/mnemonic'

    compareTaskCollection:
      type: object
      required:
        - compare_tasks
      properties:
        compare_tasks:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/compareTaskBase'
              - $ref: '#/components/schemas/mnemonic'

    compareScheduleCollection:
      type: object
      required:
        - compare_schedules
      properties:
        compare_schedules:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/compareScheduleBase'
              - $ref: '#/components/schemas/mnemonic'

    sessionCollection:
      type: object
      required:
        - sessions
        - pagination_meta
      properties:
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/session'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    eventCollection:
      type: object
      required:
        - events
        - pagination_meta
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/event'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    compareSessionCollection:
      type: object
      required:
        - compare_sessions
        - pagination_meta
      properties:
        compare_sessions:
          type: array
          items:
            $ref: '#/components/schemas/compareSession'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    compareResultCollection:
      type: object
      required:
        - compare_results
        - pagination_meta
      properties:
        compare_results:
          type: array
          items:
            $ref: '#/components/schemas/compareResult'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    correctionAttemptCollection:
      type: object
      required:
        - correction_attempts
        - pagination_meta
      properties:
        correction_attempts:
          type: array
          items:
            $ref: '#/components/schemas/correctionAttempt'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    correctionExceptionCollection:
      type: object
      required:
        - correction_exceptions
        - pagination_meta
      properties:
        correction_exceptions:
          type: array
          items:
            $ref: '#/components/schemas/correctionException'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    compareEventCollection:
      type: object
      required:
        - compare_events
        - pagination_meta
      properties:
        compare_events:
          type: array
          items:
            $ref: '#/components/schemas/compareEvent'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    stableDifferenceCollection:
      type: object
      required:
        - stable_differences
        - pagination_meta
      properties:
        stable_differences:
          type: array
          items:
            $ref: '#/components/schemas/stableDifference'
        pagination_meta:
          $ref: '#/components/schemas/paginationMeta'

    # Пагинация
    page:
      type: integer
      description: Текущая страница
      example: 3
      default: 1
      minimum: 1

    pageSize:
      type: integer
      description: Размер страницы
      example: 20
      default: 100
      minimum: 1
      maximum: 10000

    paginationMeta:
      type: object
      required:
        - page
        - page_size
        - total_elements
        - total_pages
      properties:
        page:
          $ref: "#/components/schemas/page"
        page_size:
          $ref: "#/components/schemas/pageSize"
        total_elements:
          type: integer
          description: Общее количество элементов
          example: 150
        total_pages:
          type: integer
          description: Общее количество страниц
          example: 8

    informationSystemBase:
      type: object
      properties:
        description:
          type: string
          description: Человекочитаемое название ИС Источника
          example: "ЭЖД региона 777"

    # Базовые схемы без мнемоник для операций обновления
    sourceBase:
      type: object
      required:
        - is_mnemonic
        - type
        - source_connect
      properties:
        description:
          type: string
          description: Человекочитаемое название Источника данных
          example: "База данных ЭЖД"
        is_mnemonic:
          type: string
          description: Ссылка на мнемонику ИС Источника
          example: "EGD777"
        type:
          $ref: "#/components/schemas/sourceType"
        source_connect:
          $ref: "#/components/schemas/sourceConnect"

    taskPullBase:
      type: object
      required:
        - action
        - source_mnemonic
        - request
        - target_type
        - target_datamart
        - target_table
      properties:
        action:
          $ref: "#/components/schemas/actionType"
        source_mnemonic:
          type: string
          description: Мнемоника Источника
          example: "pgEGD777"
        request:
          $ref: "#/components/schemas/taskPullRequest"
        target_type:
          $ref: "#/components/schemas/targetType"
        target_datamart:
          type: string
          description: Целевая витрина данных
          example: "demo_dev"
        target_table:
          type: string
          description: Целевая таблица
          example: "students"
        description:
          type: string
          description: Человекочитаемое описание задачи
          example: "Выгрузка учеников"

    scheduleBase:
      type: object
      required:
        - description
        - enabled
        - task_mnemonic
        - cron
        - one_time
        - overlap_mode
      properties:
        description:
          type: string
          description: Описание расписания
          example: "Выгрузка студентов каждый час"
        enabled:
          type: boolean
          description: Флаг активности расписания
          example: true
        task_mnemonic:
          type: string
          description: Ссылка на задание на загрузку
          example: "upload_students"
        cron:
          type: string
          description: Выражение CRON
          example: "1 * * * *"
        one_time:
          type: boolean
          description: Флаг однократного выполнения
          example: false
        overlap_mode:
          $ref: "#/components/schemas/overlapMode"

    deployerBase:
      type: object
      required:
        - is_mnemonic
        - enabled
      properties:
        is_mnemonic:
          type: string
          description: Ссылка на мнемонику Информационной системы
          example: "EGD777"
        enabled:
          type: boolean
          description: Флаг активности Деплоера
          example: true

    componentBase:
      type: object
      required:
        - deployer_mnemonic
        - component_type
        - data_flow_type
        - source_type
        - enabled
        - config_mnemonic
      properties:
        deployer_mnemonic:
          type: string
          description: Ссылка на деплоер
          example: "deployer_egd"
        component_type:
          $ref: "#/components/schemas/componentType"
        data_flow_type:
          $ref: "#/components/schemas/dataFlowType"
        source_type:
          $ref: "#/components/schemas/sourceType"
        enabled:
          type: boolean
          description: Флаг активности компонента
          example: true
        config_mnemonic:
          type: string
          description: Ссылка на конфигурацию
          example: "config1"

    configBase:
      type: object
      required:
        - config
      properties:
        config:
          type: string
          description: Конфигурация в формате YAML
          example: |
            reader:
              type: jdbc
              source: "DB_EGD"
              chunk_size: 10000

    compareTaskBase:
      type: object
      required:
        - original_source_mnemonic
        - datamart_source_mnemonic
        - original_request
        - datamart_request
        - сorrection_load_request
        - сorrection_delete_request
        - target_datamart
        - target_table
        - description
      properties:
        original_source_mnemonic:
          type: string
          description: Мнемоника Источника мастер данных
          example: "EGD777"
        datamart_source_mnemonic:
          type: string
          description: Мнемоника Источника Витрины данных
          example: "datamart_EGD777"
        original_request:
          $ref: "#/components/schemas/jdbcRequest"
        datamart_request:
          $ref: "#/components/schemas/jdbcRequest"
        сorrection_load_request:
          $ref: "#/components/schemas/jdbcRequest"
        сorrection_delete_request:
          $ref: "#/components/schemas/jdbcRequest"
        target_datamart:
          type: string
          description: Целевой датамарт для выравнивания
        target_table:
          type: string
          description: Целевая таблица для выравнивания"
        description:
          type: string
          description: Описание сверки
          example: "Сверка важных атрибутов, создал Петров Петр Петрович 1 октября 2025 года, чтобы спать спокойно"

    compareScheduleBase:
      type: object
      required:
        - compare_task_mnemonic
        - cron
        - enabled
        - one_time
        - description
      properties:
        compare_task_mnemonic:
          type: string
          description: Мнемоника Задачи сверки
          example: "Compare1"
        cron:
          type: string
          description: CRON-выражение
          example: "0 0 1 * * ?"
        enabled:
          type: boolean
          description: Признак активности расписания
          example: true
        one_time:
          type: boolean
          description: Признак однократного запуска
          example: false
        description:
          type: string
          description: Комментарий к расписанию
          example: "Ежедневная сверка"

    session:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Уникальный идентификатор Сеанса
          example: 1025
        source_mnemonic:
          type: string
          description: Мнемоника источника
          example: "abs5"
        action:
          $ref: "#/components/schemas/actionType"
        flk_mode:
          $ref: "#/components/schemas/flkMode"
        component_mnemonic:
          type: string
          description: Мнемоника компонента, обрабатывающего Сеанс
          example: "reader_jdbc_1"
        component_instance_id:
          type: string
          format: uuid
          description: Идентификатор экземпляра компонента
        target_datamart:
          type: string
          description: Целевая витрина
          example: "demo_dev"
        target_table:
          type: string
          description: Целевая таблица
          example: "students"
        source_connect:
          $ref: "#/components/schemas/sourceConnect"
        schedule_mnemonic:
          type: string
          description: Ссылка на Расписание, которое создало Сеанс
        file_sz:
          type: integer
          description: Размер файла в байтах
          example: 1532
        offset:
          type: integer
          format: int64
          description: Смещение для чтения данных
          example: 1
        status_code:
          type: integer
          description: Текущий статус Сеанса
        error_code:
          type: integer
          description: Код ошибки в случае неудачи
          example: 5001
        error_message:
          type: string
          description: Текстовое описание ошибки
          example: "Ошибка подключения к источнику"
        create_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        finish_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        for_system_time:
          allOf:
            - $ref: "#/components/schemas/prostoreTimeStamp"
            - description: Метка времени для удаления истории операций
        compare_session_id:
          type: integer
          format: int64
          description: Cсылка на идентификатор Сеанса сверки
        is_file_deleted:
          type: boolean
          description: Признак удаления файла из буфера
          example: true

    event:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Уникальный идентификатор события
          example: 50178
        code:
          type: integer
          description: Код события
          example: 5001
        session_id:
          type: integer
          format: int64
          description: Ссылка на идентификатор Сеанса
          example: 1025
        component_mnemonic:
          type: string
          description: Ссылка на Компонент, создавший событие
          example: "reader_jdbc_1"
        component_instance_id:
          type: string
          description: Идентификатор экземпляра
        event_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        message:
          type: string
          description: Сообщение события
          example: "Компонент назначен"
        error_code:
          type: integer
          description: Код ошибки в случае неудачи
        error_message:
          type: string
          description: Дополнительные данные в формате JSON или yaml
        status_code_from:
          type: integer
          description: Статус, в котором был сеанс до события
        status_code_to:
          type: integer
          description: Статус, в который перешел сеанс после события
        payload:
          type: object
          description: Прикладные данные для Менеджера
          example: {offset: 0}

    compareSession:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Идентификатор Сеанса
          example: 12345
        compare_schedule_mnemonic:
          type: string
          description: Мнемоника расписания сверки
          example: "CompareSchedule1"
        create_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        component_mnemonic:
          type: string
          description: Мнемоника компаратора, исполняющего сверку
        component_instance_id:
          type: string
          description: Идентификатор компаратора исполняющего сверку
        finish_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        status_code:
          type: integer
          description: Статус Сеанса
        error_code:
          type: integer
          description: Код ошибки в случае неудачи
        error_message:
          type: string
          description: Текстовое описание ошибки

    compareResult:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Идентификатор записи
        pk_cortege:
          type: string
          description: кортеж PK прикладной записи, сериализованный в склейку через разделитель
        compare_session_id:
          type: integer
          format: int64
          description: Идентификатор Сеанса сравнения
          example: 12345
        difference_type:
          $ref: "#/components/schemas/differenceType"
        hash_original:
          type: integer
          format: int64
          description: хеш мастер записи
          example: 123456789

    correctionAttempt:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Идентификатор попытки исправления
          example: 12345
        compare_session_id:
          type: integer
          format: int64
          description: Идентификатор экземпляра задачи сравнения
        pk_cortege:
          type: string
          description: Кортеж первичных ключей
        create_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        session_id:
          type: integer
          format: int64
          description: Идентификатор Сеанса загрузки, в рамках которого корректировался кортеж первичных ключей
          example: 654
        difference_type:
          $ref: "#/components/schemas/differenceType"

    correctionException:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Идентификатор исключения
          example: "4f968837-add7-4a59-9e65-293c6325b32d"
        pk_cortege:
          type: string
          description: Кортеж первичного ключа исключения
        original_source_mnemonic:
          type: string
          description: Мнемоника источника мастер данных
          example: "EGD777"
        compare_session_id:
          type: integer
          format: int64
          description: Идентификатор сеанса сверки в рамках которого выявлено исключение
        compare_task_mnemonic:
          type: string
          description: Мнемоника задания сверки

    compareEvent:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Уникальный идентификатор события
          example: 50178
        code:
          type: integer
          description: Код события
          example: 5001
        compare_session_id:
          type: integer
          format: int64
          description: Ссылка на идентификатор Сеанса сверки
          example: 1234
        component_mnemonic:
          type: string
          description: Ссылка на Компонент, создавший событие
          example: "reader_jdbc_1"
        component_instance_id:
          type: string
          description: Идентификатор экземпляра
        event_ts:
          $ref: "#/components/schemas/prostoreTimeStamp"
        message:
          type: string
          description: Сообщение события
          example: "Компонент назначен"
        error_code:
          type: integer
          description: Код ошибки в случае неудачи
        error_message:
          type: string
          description: Дополнительные данные в формате JSON или yaml
        status_code_from:
          type: integer
          description: Статус, в котором был сеанс до события
        status_code_to:
          type: integer
          description: Статус, в который перешел сеанс после события
        payload:
          type: object
          description: Прикладные данные для Менеджера
          example: {offset: 0}

    stableDifference:
      type: object
      properties:
        compare_session_id:
          type: integer
          format: int64
          description: Идентификатор текущего сеанса сверки
          example: 125
        compare_session_prev_id:
          type: integer
          format: int64
          description: Идентификатор предыдущего сеанса сверки
          example: 123
        pk_cortege:
          type: string
          description: кортеж PK прикладной записи, сериализованный в склейку через разделитель
          example: "1"
        difference_type:
          $ref: "#/components/schemas/differenceType"
        compare_task_mnemonic:
          type: string
          description: Мнемоника задания сверки

    # представление в виде строки является временным
    # в дальнейшем планируется создать детальные схемы для подключений
    jdbcRequest:
      type: string
      description: Запрос к Источнику типа JDBC

    restRequest:
      type: object
      description: Запрос к Источнику типа REST
      required:
        - rest
      properties:
        rest:
          type: object
          required:
            - method
            - path
          properties:
            method:
              type: string
              enum: [GET, POST]
              example: "GET"
            path:
              type: string
              example: "/student/:id"
            body:
              type: object
            parameters:
              type: object
              example: {"id": "12345"}

    error:
      type: object
      required:
        - error
      properties:
        error:
          description: Объект, содержащий информацию об ошибке
          type: object
          required:
            - code
            - message
          properties:
            code:
              enum:
                - INTERNAL_SERVER_ERROR
            message:
              description: Сообщение об ошибке
              type: string

    mnemonic:
      type: object
      required:
        - mnemonic
      properties:
        mnemonic:
          description: 'Мнемоника объекта'
          type: string

    sourceType:
      type: string
      enum: [jdbc, rest, folder]
      description: Тип Источника
      example: "jdbc"

    actionType:
      type: string
      enum: [upsert, delete, truncate, modify]
      description: Тип операции
      example: "upsert"

    targetType:
      type: string
      enum: [application-database, service-database]
      description: Тип целевой базы данных
      example: "application-database"

    overlapMode:
      type: string
      enum: [skip, wait, run]
      description: Режим обработки пересекающихся запусков
      example: "skip"

    componentType:
      type: string
      enum: [reader, transform, flk, uploader, buffer]
      description: Тип компонента
      example: "reader"

    dataFlowType:
      type: string
      enum: [pull, push]
      description: Тип потока данных
      example: "pull"

    flkMode:
      description: Режим ФЛК для данного Сеанса
      type: string
      enum: [off, warning, skip_string, skip_file, skip_on_first_error, skip_string_except_last]
      example: "warning"

    # представление в виде строки является временным
    # в дальнейшем планируется создать детальные схемы для подключений
    sourceConnect:
      type: string
      description: Параметры подключения к Источнику

    # представление в виде строки является временным
    # в дальнейшем планируется создать детальные схемы для подключений
    taskPullRequest:
      type: string
      description: Запрос к Источнику

    differenceType:
      type: integer
      description: |
        Код различия: 
        1 - хеш суммы данных в Источнике и Витрине не совпадают, 
        2 - данных нет в Витрине, 
        3 - данных нет в Источнике
      enum: [1, 2, 3]
      example: 1

    prostoreTimeStamp:
      type: string
      description: "Дата и временя в формате Prostore: YYYY-MM-DD hh:mm:ss[.SSSSSS]"
      example: "2019-12-23 15:15:14.736193"

  parameters:
    mnemonic:
      name: mnemonic
      in: path
      description: 'Мнемоника объекта'
      required: true
      schema:
        type: string

    componentMnemonic:
      name: component-mnemonic
      in: path
      description: 'Мнемоника компонента'
      required: true
      schema:
        type: string

    # Filters
    mnemonicFilter:
      name: mnemonic
      in: query
      description: Фильтр по мнемонике объекта
      required: false
      schema:
        type: string

    sourceTypeFilter:
      name: type
      in: query
      description: Фильтр по типу Источника
      required: false
      schema:
        $ref: '#/components/schemas/sourceType'

    isMnemonicFilter:
      name: is_mnemonic
      in: query
      description: Фильтр по мнемонике Информационной системы
      required: false
      schema:
        type: string

    actionFilter:
      name: action
      in: query
      description: Фильтр по типу операции
      required: false
      schema:
        $ref: '#/components/schemas/actionType'

    sourceMnemonicFilter:
      name: source_mnemonic
      in: query
      description: Фильтр по мнемонике Источника
      required: false
      schema:
        type: string

    targetTypeFilter:
      name: target_type
      in: query
      description: Фильтр по типу целевой БД
      required: false
      schema:
        $ref: '#/components/schemas/targetType'

    targetDatamartFilter:
      name: target_datamart
      in: query
      description: Фильтр по целевой Витрине данных
      required: false
      schema:
        type: string

    targetTableFilter:
      name: target_table
      in: query
      description: Фильтр по целевой таблице
      required: false
      schema:
        type: string

    enabledFilter:
      name: enabled
      in: query
      description: Фильтр по активности
      required: false
      schema:
        type: boolean

    taskMnemonicFilter:
      name: task_mnemonic
      in: query
      description: Фильтр по мнемонике задания
      required: false
      schema:
        type: string

    oneTimeFilter:
      name: one_time
      in: query
      description: Фильтр по признаку однократного запуска
      required: false
      schema:
        type: boolean

    overlapModeFilter:
      name: overlap_mode
      in: query
      description: Фильтр по режиму обработки пересечений
      required: false
      schema:
        $ref: '#/components/schemas/overlapMode'

    deployerMnemonicFilter:
      name: deployer_mnemonic
      in: query
      description: Фильтр по мнемонике Деплоера
      required: false
      schema:
        type: string

    componentTypeFilter:
      name: component_type
      in: query
      description: Фильтр по типу компонента
      required: false
      schema:
        $ref: '#/components/schemas/componentType'

    dataFlowTypeFilter:
      name: data_flow_type
      in: query
      description: Фильтр по типу потока данных
      required: false
      schema:
        $ref: '#/components/schemas/dataFlowType'

    configMnemonicFilter:
      name: config_mnemonic
      in: query
      description: Фильтр по мнемонике конфигурации
      required: false
      schema:
        type: string

    originalSourceMnemonicFilter:
      name: original_source_mnemonic
      in: query
      description: Фильтр по мнемонике Источника мастер-данных
      required: false
      schema:
        type: string

    datamartSourceMnemonicFilter:
      name: datamart_source_mnemonic
      in: query
      description: Фильтр по мнемонике Источника Витрины данных
      required: false
      schema:
        type: string

    compareTaskMnemonicFilter:
      name: compare_task_mnemonic
      in: query
      description: Фильтр по мнемонике Задачи сверки
      required: false
      schema:
        type: string

    # New filters for sessions and events
    idFilter:
      name: id
      in: query
      description: Фильтр по идентификатору
      required: false
      schema:
        type: integer
        format: int64

    flkModeFilter:
      name: flk_mode
      in: query
      description: Фильтр по режиму ФЛК
      required: false
      schema:
        $ref: '#/components/schemas/flkMode'

    componentMnemonicFilter:
      name: component_mnemonic
      in: query
      description: Фильтр по мнемонике компонента
      required: false
      schema:
        type: string

    scheduleMnemonicFilter:
      name: schedule_mnemonic
      in: query
      description: Фильтр по мнемонике Расписания
      required: false
      schema:
        type: string

    statusFilter:
      name: status_code
      in: query
      description: Фильтр по статусу
      required: false
      schema:
        type: integer

    errorCodeFilter:
      name: error_code
      in: query
      description: Фильтр по коду ошибки
      required: false
      schema:
        type: integer

    createTsFilter:
      name: create_ts
      in: query
      description: Фильтр по времени создания
      required: false
      schema:
        $ref: "#/components/schemas/prostoreTimeStamp"

    finishTsFilter:
      name: finish_ts
      in: query
      description: Фильтр по времени завершения
      required: false
      schema:
        $ref: "#/components/schemas/prostoreTimeStamp"

    codeFilter:
      name: code
      in: query
      description: Фильтр по коду События
      required: false
      schema:
        type: integer

    sessionIdFilter:
      name: session_id
      in: query
      description: Фильтр по идентификатору Сеанса загрузки
      required: false
      schema:
        type: integer
        format: int64

    eventTsFilter:
      name: event_ts
      in: query
      description: Фильтр по временной метке события
      required: false
      schema:
        $ref: "#/components/schemas/prostoreTimeStamp"

    statusFromFilter:
      name: status_code_from
      in: query
      description: Фильтр по исходному статусу
      required: false
      schema:
        type: integer

    statusToFilter:
      name: status_code_to
      in: query
      description: Фильтр по целевому статусу
      required: false
      schema:
        type: integer

    compareScheduleMnemonicFilter:
      name: compare_schedule_mnemonic
      in: query
      description: Фильтр по мнемонике Расписания сверки
      required: false
      schema:
        type: string

    componentInstanceIdFilter:
      name: component_instance_id
      in: query
      description: Фильтр по идентификатору компонента
      required: false
      schema:
        type: string

    pkCortegeFilter:
      name: pk_cortege
      in: query
      description: Фильтр по кортежу первичных ключей
      required: false
      schema:
        type: string

    differenceTypeFilter:
      name: difference_type
      in: query
      description: Фильтр по типу различия
      required: false
      schema:
        $ref: "#/components/schemas/differenceType"

    compareSessionIdFilter:
      name: compare_session_id
      in: query
      description: Фильтр по идентификатору Сеанса сверки
      required: false
      schema:
        type: integer
        format: int64

    isFileDeletedFilter:
      name: is_file_deleted
      in: query
      description: Фильтр по признаку удаления файла из буфера
      required: false
      schema:
        type: boolean

    correctionTargetDatamartFilter:
      name: target_datamart
      in: query
      description: Фильтр по целевому датамарту для выравнивания
      required: false
      schema:
        type: string

    correctionTargetTableFilter:
      name: target_table
      in: query
      description: Фильтр по целевой таблице для выравнивания
      required: false
      schema:
        type: string

    # Pagination parameters
    page:
      name: page
      in: query
      description: Номер страницы данных
      required: false
      schema:
        $ref: '#/components/schemas/page'

    pageSize:
      name: page_size
      in: query
      description: Размер страницы данных
      required: false
      schema:
        $ref: '#/components/schemas/pageSize'

    reverseOrder:
      name: reverse_order
      in: query
      description: "Признак обратной сортировки возвращаемых объектов"
      required: false
      schema:
        type: boolean
        default: false

  responses:
    commonBadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/error"
    commonInternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/error"