verification/docs/openapi.yaml
2024-07-12 17:36:55 +03:00

165 lines
6.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

openapi: 3.0.3
info:
title: Сервис логики верификации аккаунта пользователя
description: |-
Область отвественности сервиса - получить на вход набор файлов необходимый для подтверждения статуса пользователя, оповещение менеджера для обработки поступившей заявки и оповещение польовательского сервиса о подтверждении статуса верификации пользователя
version: 1.0.0
tags:
- name: verification
paths:
/verification/{userId}:
get:
description: метод для получения текущего статуса верификации текущего пользователя
parameters:
- name: userId
in: path
required: true
schema:
type: string
tags:
- verification
responses:
"200":
description: успешное получение данных
content:
application/json:
schema:
$ref: "#/components/schemas/Verification"
"401":
description: Неавторизован
/verification:
get:
description: метод для получения текущего статуса верификации текущего пользователя
tags:
- verification
responses:
"200":
description: успешное получение данных
content:
application/json:
schema:
$ref: "#/components/schemas/Verification"
"401":
description: Неавторизован
post:
description: метод подания запроса на верификацию. При получении запроса отправить сообщение в канал телеграмма. Айдишник канала и токен бота передавать через переменные окружения. Файл с шаблоном сообщения встраивать в приложение. В тексте сообщения должно быть место для вставки урла для получения страницы админки с этим запросом, вида https://admin.pena.digital/user/{Id}/verification
tags:
- verification
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/Status"
inn:
type: string
format: base64
rule:
type: string
format: base64
certificate:
type: string
description: только для status == nko
format: base64
responses:
"200":
description: успешный запрос на верификацию
content:
application/json:
schema:
$ref: "#/components/schemas/Verification"
"401":
description: Неавторизован
patch:
description: метод подтверждения или отклонения верификации. При подтверждении надо передать статус верификации в customer сервис. Эндпоинт для этого получить из переменных окружения. Документация для этого эндпоинта - https://penahub.gitlab.yandexcloud.net/pena-services/customer/-/blob/dev/openapi.yaml PATCH /account/{userId}. Слать запрос туда лучше через воркер, сохраняя задачи на отправку запросов в базу, чтобы не потерялись при перезагрузке сервиса.
tags:
- verification
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: айдишник юзера
status:
$ref: "#/components/schemas/Status"
comment:
type: string
accepted:
type: boolean
taxnumber:
type: string
description: ИНН пользователя
example: "987654321098"
responses:
"200":
description: успешное подтверждение или отклонение верификации
"401":
description: Неавторизован
/verification/file:
patch:
description: "метод для обновления файла/файлов верификации"
tags:
- verification
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
inn:
type: string
format: base64
rule:
type: string
format: base64
certificate:
type: string
description: только для status == nko
format: base64
responses:
"200":
description: успешно
"401":
description: Неавторизован
components:
schemas:
Verification:
type: object
properties:
_id:
type: string
description: айдишник юзера, который запросил верификацию
accepted:
type: boolean
status:
$ref: "#/components/schemas/Status"
updated_at:
type: string
format: "date-time"
comment:
type: string
files:
type: array
items:
$ref: "#/components/schemas/File"
File:
type: object
properties:
name:
type: string
url:
type: string
Status:
type: string
description: только no, nko или org
example: nko
enum:
- no
- nko
- org