From 33160486cd7616f4b2a0498e072d979db862d6d0 Mon Sep 17 00:00:00 2001 From: ruslan Date: Mon, 21 Jul 2025 10:26:26 +0300 Subject: [PATCH] kedo --- v2/swagger.yaml | 916 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 806 insertions(+), 110 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index a87386e..119906b 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -59,6 +59,8 @@ tags: description: Methods for working with corporate shop. Требуется право доступа shop-usage "Магазин". - name: workflow description: Methods for working with workflow. + - name: kedo + description: Методы для работы с КЭДО. paths: /mobile/bind/{id}/{token}: @@ -544,7 +546,7 @@ paths: content: application/json: schema: - #/components/schemas/orgEmployment + #/components/schemas/orgEmployment 401: description: Unauthorized request 403: @@ -622,15 +624,15 @@ paths: format: uuid - name: org_employment_file_type_id in: query - description: - Document type (enum: see documentation) + description: > + Document type enum: see documentation required: false schema: $ref: '#/components/schemas/orgEmploymentFileType' - name: org_employment_file_status_id in: query - description: - Document status (enum: see documentation) + description: > + Document status enum: see documentation required: false schema: $ref: '#/components/schemas/orgEmploymentFileStatus' @@ -3565,7 +3567,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/type' + $ref: '#/components/schemas/typeIdInteger' 401: description: Unauthorized. 403: @@ -3585,7 +3587,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/type' + $ref: '#/components/schemas/typeIdInteger' 401: description: Unauthorized. 403: @@ -4587,7 +4589,7 @@ paths: example: "0b6a186a-95b8-4c89-8e69-6b49f12d1474" - name: use_category_recursion in: query - description: Если true - то теги будут выбраны для всех вложенных категорий, начиная с указанного Category_id, в ином случае будут показаны теги только для Category_id + description: Если true - то теги будут выбраны для всех вложенных категорий, начиная с указанного Category_id, в ином случае будут показаны теги только для Category_id schema: type: boolean format: true @@ -4700,7 +4702,7 @@ paths: example: "0b6a186a-95b8-4c89-8e69-6b49f12d1474" - name: use_category_recursion in: query - description: Если true - то теги будут выбраны для всех вложенных категорий, начиная с указанного Category_id, в ином случае будут показаны теги только для Category_id + description: Если true - то теги будут выбраны для всех вложенных категорий, начиная с указанного Category_id, в ином случае будут показаны теги только для Category_id schema: type: boolean format: true @@ -5359,7 +5361,7 @@ paths: tags: - goal summary: Привязать цели - operationId: /goal/bind + operationId: /goal/bind parameters: - name: id in: query @@ -5433,9 +5435,9 @@ paths: minItems: 2 maxItems: 2 description: Массив из двух дат, начала и конца периода - searchInAllSubDepartments: + searchInAllSubDepartments: type: integer - enum: [0, 1] + enum: [ 0, 1 ] description: Поиск по всем вложенным отделам user_id: type: array @@ -5445,11 +5447,11 @@ paths: description: Сотрудник, можно список через запятую type: type: string - enum: [result, rating] + enum: [ result, rating ] description: Переод отчета period: type: string - enum: [month, quarter, half_year, year] + enum: [ month, quarter, half_year, year ] description: Переод отчета responses: 200: @@ -5549,7 +5551,439 @@ paths: example: 9f7063d1-959e-4c32-b186-313576375739 description: ID сотрудников "Куратор", можно перечислять через запятую responses: - $ref: '#/components/responses/GoalActionResponse' + 200: + description: Описание + content: + application/json: + schema: + $ref: '#/components/responses/GoalActionResponse' + 422: + description: Bad Request + 403: + description: Unauthorized + 500: + description: Server Error + + /enum/document-type: + get: + tags: + - kedo + summary: Тип документа + operationId: /enum/document-type + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/typeIdString' + 401: + description: Unauthorized + 403: + description: Unauthorized + 500: + description: Server Error + + /enum/sign-request-slot-type: + get: + tags: + - kedo + summary: Тип слота + operationId: /enum/sign-request-slot-type + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/typeIdInteger' + 401: + description: Unauthorized + 403: + description: Unauthorized + 500: + description: Server Error + + /enum/sign-request-status: + get: + tags: + - kedo + summary: Статус запроса на подпись документа + operationId: /enum/sign-request-status + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/status' + 401: + description: Unauthorized + 403: + description: Unauthorized + 500: + description: Server Error + + /document/index: + get: + tags: + - kedo + summary: Список запросов на подпись документа для текущего пользователя + operationId: /document/index + parameters: + - name: id + in: query + description: Идентификатор запроса на подпись. Можно передать несколько идентификаторов разделенные запятой. + schema: + type: string + format: uuid + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + - name: created_at + in: query + description: Дата создания + schema: + type: string + example: 2025-01-01|2025-01-01 + - name: deadline_at + in: query + description: Дата дедлайна запроса на подпись + schema: + type: string + example: 2025-01-01|2025-01-01 + - name: cancelled_at + in: query + description: Дата отмены запроса на подпись + schema: + type: string + example: 2025-01-01|2025-01-01 + - name: sign_request_status_id + in: query + description: Статус запроса на подпись. Можно передать несколько идентификаторов разделенные запятой. + schema: + type: string + example: '1' + - name: org_employment_file_type_id + in: query + description: Тип документа. Можно передать несколько идентификаторов разделенные запятой. + schema: + type: string + example: example + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/kedoDocumentIndex' + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' + 400: + description: Bad Request + 401: + description: Unauthorized + 403: + description: Unauthorized + 500: + description: Server Error + + /document/view: + get: + tags: + - kedo + summary: Запрос на подпись документа + operationId: /document/view + parameters: + - name: id + in: query + description: Идентификатор запроса на подпись + schema: + type: string + required: true + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/kedoDocumentView' + 400: + description: Bad Request + 401: + description: Unauthorized + 403: + description: Unauthorized + 404: + description: Not found + 500: + description: Server Error + + /sign-request/create: + post: + tags: + - kedo + summary: Создание запроса на подпись документа + operationId: /sign-request/create + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/kedoSignRequestCreateRequestBody' + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/kedoSignRequestCreateResponse' + 401: + description: Unauthorized + 500: + description: Server Error + + /sign-request/cancel: + post: + tags: + - kedo + summary: Отмена запроса на подпись документа + operationId: /sign-request/cancel + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/kedoSignRequestCancelRequestBody' + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/kedoSignRequestCancelResponse' + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not found + 500: + description: Server Error + + /instance/index: + get: + tags: + - kedo + summary: Список экземпляров на подпись документа + operationId: /instance/index + parameters: + - name: kedo_document_id + in: query + description: Идентификатор запроса на подпись + required: true + schema: + type: string + format: uuid + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/kedoInstanceIndex' + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' + 400: + description: Bad Request + 401: + description: Unauthorized + 403: + description: Forbidden + 500: + description: Server Error + + /instance/view: + get: + tags: + - kedo + summary: Просмотр экземпляра на подпись документа + operationId: /instance/view + parameters: + - name: id + in: query + description: Идентификатор экземпляра + required: true + schema: + type: string + format: uuid + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/kedoInstanceView' + 400: + description: Bad Request + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not found + 500: + description: Server Error + + /instance/sign: + post: + tags: + - kedo + summary: Подписание документа + operationId: /instance/sign + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/kedoInstanceSignRequestBody' + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/kedoInstanceSignResponse' + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not found + 500: + description: Server Error + + /instance/reject: + post: + tags: + - kedo + summary: Отклонить подписание документа + operationId: /instance/reject + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/kedoInstanceRejectRequestBody' + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/kedoInstanceRejectResponse' + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not found + 500: + description: Server Error + + /instance/download-sign: + get: + tags: + - kedo + summary: Скачать подпись *.p7s + operationId: /instance/download-sign + parameters: + - name: id + in: query + description: Идентификатор экземпляра + required: true + schema: + type: string + format: uuid + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: OK + content: + application/pkcs7-signature: + schema: + type: string + format: binary + 400: + description: Bad Request + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not found + 500: + description: Server Error + + /instance/stamp: + get: + tags: + - kedo + summary: Скачать штамп подписи + operationId: /instance/stamp + parameters: + - name: id + in: query + description: Идентификатор экземпляра + required: true + schema: + type: string + format: uuid + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: OK + content: + image/png: + schema: + type: string + format: binary + 400: + description: Bad Request + 401: + description: Unauthorized + 404: + description: Not found + 500: + description: Server Error components: securitySchemes: @@ -5745,84 +6179,135 @@ components: - '53f2d03c-303a-4a3c-b57f-f7fb62fee538' - '42862a16-affa-4ba5-86c5-61376f46d695' - type: - description: Type model. - type: object - properties: - id: - description: Type ID. - type: integer - example: 1 - name: - description: Type name (localized). - type: string - example: Type name + typeIdInteger: + description: Types with integer ID + type: array + items: + description: Types list + type: object + properties: + id: + description: Type ID + type: integer + example: 1 + name: + description: Type name (localized) + type: string + example: Type name + + typeIdString: + description: Types with string ID + type: array + items: + description: Types list + type: object + properties: + id: + description: Type ID + type: string + example: example + name: + description: Type name (localized) + type: string + example: Type name status: - description: Status. - type: object - properties: - id: - description: Status ID. - type: integer - example: 1 - name: - description: Status name (localized). - type: string - example: Status name + description: Status + type: array + items: + description: Statuses list + type: object + properties: + id: + description: Status ID + type: integer + example: 1 + name: + description: Status name (localized) + type: string + example: Status name userInfo: - description: User info. + description: User info type: object properties: id: - description: User ID. + description: User ID type: string format: uuid example: a91fe4d9-b486-4e94-9114-18589aad7c7e name: - description: User's full name. + description: User's full name type: string example: FirstName LastName iconUrl: - description: User profile face image URL. + description: User profile face image URL type: string example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg + fileObject: + type: object + properties: + id: + description: File ID + type: string + format: uuid + example: 96cf98ed-2762-4f6b-9a5b-3eca76c56477 + url: + description: File URL + type: string + example: https://hrenot.hrbox.io/file/open/96cf98ed-2762-4f6b-9a5b-3eca76c56477.jpg + file_ype: + description: File type + type: string + enum: + - image + - video + - document + - archive + - other + - encrypted + example: image + ext: + description: File extension + type: string + example: jpg + name: + description: File name + type: string + example: image.jpg + + file: + description: Attached file + $ref: '#/components/schemas/fileObject' + files: - description: Attached files. + description: Attached files type: array items: - type: object - properties: - id: - description: File ID. - type: string - format: uuid - example: 96cf98ed-2762-4f6b-9a5b-3eca76c56477 - url: - description: File URL. - type: string - example: https://hrenot.hrbox.io/file/open/96cf98ed-2762-4f6b-9a5b-3eca76c56477.jpg - file_ype: - description: File type. - type: string - enum: - - image - - video - - document - - archive - - other - - encrypted - example: image - ext: - description: File extension. - type: string - example: jpg - name: - description: File name. - type: string - example: image.jpg + $ref: '#/components/schemas/fileObject' + + responseObject: + type: object + properties: + success: + description: Result status + type: boolean + example: true + message: + description: Message displayed to user (localized) + type: string + default: null + example: Expamle text + errors: + description: Array of validation errors + type: array + default: null + data: + description: Model data + type: object + default: null + accountSecret: type: object @@ -9564,10 +10049,10 @@ components: orgEmploymentFileType: type: string description: > - Тип документа: - * `payslip` - Расчетный лист (PAYSLIP). - * `ndfl2` - 2НДФЛ (NDFL2). - * `custom` - Кастомный тип (CUSTOM). + Тип документа: + * `payslip` - Расчетный лист (PAYSLIP). + * `ndfl2` - 2НДФЛ (NDFL2). + * `custom` - Кастомный тип (CUSTOM). enum: - payslip - ndfl2 @@ -9584,7 +10069,228 @@ components: - 1 - 2 - 3 - + + # КЭДО --> + + kedoDocument: + type: object + properties: + id: + description: Идентификатор запроса на подпись + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + created_at: + description: Дата создания + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + sign_request_status_id: + description: Статус запроса на подпись + type: integer + example: 1 + deadline_at: + description: Дедлайн подписания + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + cancelled_at: + description: Дата отмены запроса на подпись + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + comment: + description: Комментарий + type: string + example: Текст комментария + org_employment_file_type_id: + description: Тип документа + type: string + example: example + file: + $ref: '#/components/schemas/file' + user: + $ref: '#/components/schemas/userInfo' + isCurrentUserSigned: + description: Текущий пользователь подписал документ + type: boolean + example: true + + kedoDocumentIndex: + $ref: '#/components/schemas/kedoDocument' + + kedoDocumentView: + $ref: '#/components/schemas/kedoDocument' + + kedoSignRequestCreateRequestBody: + type: object + properties: + file_id: + description: Идентификатор файла + required: true + type: string + format: uuid + document_type_id: + description: Тип документа + required: true + type: number + example: 1 + deadline_at: + description: Дата дедлайна подписания документа + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + comment: + description: Комментарий + type: string + format: 'date-time' + example: Example text + request_users: + description: Подписанты + required: true + type: array + items: + type: object + properties: + users: + description: Идентификаторы слотов из /enum/sign-request-slot-type + type: array + items: + type: integer + example: + - 1 + - 2 + - 3 + key: + description: Идентификаторы user_list_key виджета выбора структуры + type: array + items: + type: string + example: + - 'a83fc7ec-db7c-49b3-b0db-4ad4cba2c69b' + - '5db5ee50-75f9-44f3-bc46-ccfa566563eb' + - 'd968f01a-0151-4685-8104-c496e4e8946b' + + kedoSignRequestCreateResponse: + $ref: '#/components/schemas/responseObject' + properties: + data: + $ref: '#/components/schemas/kedoDocument' + + kedoSignRequestCancelRequestBody: + type: object + properties: + id: + description: Идентификатор запроса на подпись + required: true + type: string + format: uuid + + kedoSignRequestCancelResponse: + $ref: '#/components/schemas/responseObject' + + kedoInstanceIndex: + type: object + properties: + id: + description: Идентификатор экземпляра + type: string + format: uuid + example: 073f11ed-3329-4c95-9966-f25b15846ea2 + kedo_document_id: + description: Идентификатор запроса на подпись + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + mainSignerUser: + $ref: '#/components/schemas/userInfo' + signersCount: + description: Количество подписантов + type: string + format: integer + example: 5 + signedCount: + description: Количество подписавших + type: string + format: integer + example: 2 + + kedoInstanceView: + type: object + properties: + id: + description: Идентификатор экземпляра + type: string + format: uuid + example: 073f11ed-3329-4c95-9966-f25b15846ea2 + kedo_document_id: + description: Идентификатор запроса на подпись + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + signersCount: + description: Количество подписантов + type: string + format: integer + example: 5 + signedCount: + description: Количество подписавших + type: string + format: integer + example: 2 + isSigned: + description: Документ подписан + type: boolean + example: true + signers: + description: Список подписантов экземпляра + type: array + items: + type: object + properties: + user: + $ref: '#/components/schemas/userInfo' + signed_at: + description: Дата подписания + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + rejected_at: + description: Дата отклонения подписания + type: string + format: 'date-time' + example: 2025-01-01 00:00:00 + kedoDocument: + $ref: '#/components/schemas/kedoDocument' + + kedoInstanceSignRequestBody: + type: object + properties: + id: + description: Идентификатор экземпляра + required: true + type: string + format: uuid + example: 073f11ed-3329-4c95-9966-f25b15846ea2 + + kedoInstanceSignResponse: + $ref: '#/components/schemas/responseObject' + + kedoInstanceRejectRequestBody: + type: object + properties: + id: + description: Идентификатор экземпляра + required: true + type: string + format: uuid + example: 073f11ed-3329-4c95-9966-f25b15846ea2 + + kedoInstanceRejectResponse: + $ref: '#/components/schemas/responseObject' + + # КЭДО <-- + GoalItem: type: object properties: @@ -9606,7 +10312,7 @@ components: $ref: '#/components/parameters/goalStatusId' goal_result_type_id: type: number - description: > + description: > Тип результата: * `1` - Да/нет * `2` - Процент @@ -9778,7 +10484,7 @@ components: in: query schema: type: integer - enum: [1, 2, 3, 4] + enum: [ 1, 2, 3, 4 ] description: Квартал завершения цели goalYear: name: goal_year @@ -9834,36 +10540,26 @@ components: description: Server Error. GoalActionResponse: - 200: - description: Goal object - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - deleted: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые были удалены - updated: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые были обновлены - skipped: - type: array - items: - $ref: '#/components/schemas/GoalItem' - description: Цели которые не были обработаны - 422: - description: Bad Request - 403: - description: Unauthorized - 500: - description: Server Error + description: Goal object + type: object + properties: + success: + type: boolean + deleted: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были удалены + updated: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были обновлены + skipped: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые не были обработаны security: - SessionAuth: [ ]