customer/openapi.yaml

794 lines
25 KiB
YAML
Raw Normal View History

2023-05-14 21:47:40 +00:00
openapi: 3.0.1
info:
title: Customer - сервис для управления клиентами
description: |-
Область ответственности сервиса - предоставление пользователю функционала корзины и кошелька.
version: 1.0.0
2023-05-17 03:39:29 +00:00
2023-05-14 21:47:40 +00:00
tags:
- name: account
description: аккаунт
- name: currency
description: доступные валюты
- name: cart
description: корзина
- name: wallet
description: кошелёк
- name: history
description: история
2023-05-17 03:39:29 +00:00
2023-05-14 21:47:40 +00:00
paths:
/account:
get:
tags:
- account
summary: Получение текущего аккаунта юзера
2023-05-17 03:39:29 +00:00
description: Используется при заходе юзера в систему. Айдишник юзера получает из токена, который передаётся в заголовке authorization
2023-05-14 21:47:40 +00:00
operationId: getAccount
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
responses:
'200':
description: успешное получение
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
'404':
description: Такого пользователя нет
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
post:
tags:
- account
2023-05-17 03:39:29 +00:00
summary: Создать новый аккаунт
description: Создаёт новый аккаунт для юзера, если такого ещё не было
2023-05-14 21:47:40 +00:00
operationId: addAccount
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
responses:
2023-05-17 03:39:29 +00:00
'200':
description: успешное создание аккаунта
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-27 18:13:29 +00:00
patch:
tags:
- account
summary: Отредактировать аккаунт
description: Изменяет имя и название организации пользователя
operationId: changeAccount
security:
- Bearer: []
requestBody:
description: Модель имени
content:
application/json:
schema:
$ref: '#/components/schemas/Name'
2023-05-27 18:13:29 +00:00
responses:
'200':
description: успешное создание аккаунта
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
'401':
description: Неавторизован
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
delete:
tags:
- account
summary: удалить собственный аккаунт
description: помечает аккаунт удалённым
operationId: deleteAccount
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
responses:
'200':
description: успешное удаление аккаунта
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
2023-05-14 21:47:40 +00:00
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
/accounts:
get:
tags:
- account
summary: списко аккаунтов с пагинацией
description: получает список аккаунтов на указанной странице + общее количество аккаунтов
operationId: paginationAccounts
parameters:
2023-05-17 03:39:29 +00:00
- name: page
2023-05-14 21:47:40 +00:00
in: query
2023-05-17 03:39:29 +00:00
description: Номер страницы, начиная с 1
2023-05-14 21:47:40 +00:00
required: false
explode: false
schema:
type: integer
2023-05-17 03:39:29 +00:00
default: 1
- name: limit
2023-05-14 21:47:40 +00:00
in: query
description: размер страницы
required: false
explode: false
schema:
type: integer
2023-05-17 03:39:29 +00:00
default: 100
2023-05-14 21:47:40 +00:00
responses:
'200':
description: успешное получение страницы аккаунтов
content:
application/json:
schema:
type: object
properties:
2023-05-17 03:39:29 +00:00
totalPages:
2023-05-14 21:47:40 +00:00
type: integer
example: 11
2023-05-17 03:39:29 +00:00
accounts:
2023-05-14 21:47:40 +00:00
type: array
items:
$ref: "#/components/schemas/Account"
2023-05-17 03:39:29 +00:00
2023-05-17 20:27:09 +00:00
/account/{userId}:
2023-05-14 21:47:40 +00:00
get:
tags:
- account
2023-05-17 20:27:09 +00:00
summary: Получить аккаунт по ID пользователя системы единой авторизации
2023-05-17 03:39:29 +00:00
description: Метод необходимый в основном только менеджерам, для получения данных о клиенте
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
operationId: getDirectAccount
parameters:
2023-05-17 20:27:09 +00:00
- name: userId
2023-05-14 21:47:40 +00:00
in: path
2023-05-17 20:27:09 +00:00
description: ID аккаунта
2023-05-14 21:47:40 +00:00
required: true
2023-05-15 16:41:04 +00:00
schema:
type: string
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Успешное получение аккаунта
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-17 03:39:29 +00:00
$ref: '#/components/schemas/Account'
2023-05-14 21:47:40 +00:00
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
'404':
description: Нет такого пользователя
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
patch:
tags:
- account
2023-05-30 12:10:03 +00:00
summary: Выставление статуса верификации
description: Используется сервисом верификации для выставления статуса верификации, является ли юзер НКО, Юр Лицом или Физ Лицом
operationId: setStatus
parameters:
- name: userId
in: path
description: ID аккаунта
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum: ["no", "nko", "org"]
2023-05-30 12:10:03 +00:00
responses:
'200':
description: Успешное выставление статуса
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
'404':
description: Нет такого пользователя
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
delete:
tags:
- account
2023-05-17 03:39:29 +00:00
summary: Удалить аккаунт по айди
description: Метод необходимый в основном только менеджерам, для удаления клиента
2023-05-14 21:47:40 +00:00
operationId: deleteDirectAccount
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
parameters:
2023-05-17 20:27:09 +00:00
- name: userId
2023-05-14 21:47:40 +00:00
in: path
2023-05-17 03:39:29 +00:00
description: ID аккаунта
2023-05-14 21:47:40 +00:00
required: true
2023-05-15 16:41:04 +00:00
schema:
type: string
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Успешное удаление аккаунта
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
2023-05-14 21:47:40 +00:00
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
'404':
description: Нет такого пользователя
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
/currencies:
get:
tags:
- currency
summary: получить список одобренных валют
operationId: getCurrencies
responses:
'200':
description: успешное получение списка валют
content:
application/json:
schema:
type: array
example:
- "RUB"
- "USD"
- "CAD"
items:
type: string
2023-05-17 03:39:29 +00:00
put:
2023-05-14 21:47:40 +00:00
tags:
- currency
summary: обновляет список одобренных валют
operationId: updateCurrencies
2023-05-17 20:27:09 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
requestBody:
content:
application/json:
schema:
type: array
example:
- "RUB"
- "USD"
- "CAD"
items:
type: string
responses:
2023-05-17 03:39:29 +00:00
'200':
description: успешное обновление списка валют
content:
application/json:
schema:
type: array
example:
- "RUB"
- "USD"
- "CAD"
items:
type: string
2023-05-14 21:47:40 +00:00
'401':
description: Uanuthorized
2023-05-17 20:27:09 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-17 03:39:29 +00:00
2023-05-14 21:47:40 +00:00
/cart:
2023-05-17 03:39:29 +00:00
patch:
2023-05-14 21:47:40 +00:00
tags:
- cart
2023-05-17 03:39:29 +00:00
summary: Добавляем в корзину тариф
description: Необходимо проверить, что такой тариф существует
2023-05-14 21:47:40 +00:00
operationId: add2cart
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-19 09:08:15 +00:00
parameters:
- name: id
in: query
required: true
schema:
type: string
example: "807f1f77bcf81cd799439011"
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Добавлено в корзину
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
2023-05-14 21:47:40 +00:00
'401':
2023-05-17 03:39:29 +00:00
description: Неавторизован
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
'404':
2023-05-17 03:39:29 +00:00
description: Не найден такой тариф
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
delete:
tags:
- cart
2023-05-17 03:39:29 +00:00
summary: Удаляем из корзины тариф
2023-05-14 21:47:40 +00:00
operationId: removeFromCart
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
parameters:
- name: id
in: query
required: true
schema:
type: string
example: "807f1f77bcf81cd799439011"
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Удалено из корзины
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
2023-05-14 21:47:40 +00:00
'401':
2023-05-17 03:39:29 +00:00
description: Неавторизован
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-14 21:47:40 +00:00
'404':
2023-05-17 03:39:29 +00:00
description: Не найден такой тариф
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-15 16:41:04 +00:00
/cart/pay:
2023-05-14 21:47:40 +00:00
post:
tags:
2023-05-15 16:41:04 +00:00
- cart
summary: оплатить козину
operationId: payCart
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-06-13 12:19:51 +00:00
description: Запрос на проведение оплаты корзины
2023-05-14 21:47:40 +00:00
requestBody:
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
type: object
2023-05-17 20:27:09 +00:00
required: [userId]
2023-05-15 16:41:04 +00:00
properties:
2023-06-13 12:19:51 +00:00
userId:
2023-05-15 16:41:04 +00:00
type: string
2023-05-17 03:39:29 +00:00
description: ID для того, чтобы указать сервису оплаты, какой юзер оплатил
2023-05-15 16:41:04 +00:00
example: "807f1f77bcf81cd799439011"
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-15 16:41:04 +00:00
description: успешная оплата корзины
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-17 03:39:29 +00:00
$ref: '#/components/schemas/Account'
2023-05-15 16:41:04 +00:00
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-15 16:41:04 +00:00
/wallet:
patch:
2023-05-14 21:47:40 +00:00
tags:
2023-05-15 16:41:04 +00:00
- wallet
2023-05-17 03:39:29 +00:00
summary: Изменить валюту кошелька
2023-05-15 16:41:04 +00:00
operationId: changeCurrency
2023-05-17 03:39:29 +00:00
description: >-
При запросе необходимо:
- Отвалидировать, что такая валюта одобрена
2023-05-17 20:27:09 +00:00
- Получить данные из сервиса cbrf (выдам задачу на него чуть позднее)
2023-05-17 03:39:29 +00:00
2023-05-17 20:27:09 +00:00
- Перевести валюту кошелька в новую валюту. Кошелёк нарочно целочисленный, чтобы не было претензий к точности с плавающей точкой, поэтому, например долларовый счёт считается в центах
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-15 16:41:04 +00:00
requestBody:
content:
application/json:
schema:
type: object
2023-05-17 20:27:09 +00:00
required: [currency]
2023-05-15 16:41:04 +00:00
properties:
currency:
type: string
example: "USD"
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Успешная смена валюты кошелька
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
$ref: "#/components/schemas/Account"
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
2023-05-14 21:47:40 +00:00
'400':
2023-05-15 16:41:04 +00:00
description: Такая валюта не одобрена
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
'404':
description: Пользователь не найден
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
2023-05-14 21:47:40 +00:00
tags:
2023-05-15 16:41:04 +00:00
- wallet
2023-05-17 03:39:29 +00:00
summary: Зачислить деньги на кошелёк
description: "Прибавляем полученное значение к cash и при необходимости приводим к валюте кошелька"
2023-05-15 16:41:04 +00:00
operationId: putMoney
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
requestBody:
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
type: object
2023-05-17 20:27:09 +00:00
required: [cash, currency, userId]
2023-05-15 16:41:04 +00:00
properties:
cash:
2023-05-22 16:42:15 +00:00
type: integer
format: int64
2023-05-15 16:41:04 +00:00
example: 10000
currency:
type: string
example: "USD"
2023-05-17 03:39:29 +00:00
userId:
2023-05-15 16:41:04 +00:00
type: string
example: "807f1f77bcf81cd799439011"
2023-05-14 21:47:40 +00:00
responses:
2023-05-15 16:41:04 +00:00
'200':
description: успешное внесение денег на кошелёк
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
$ref: "#/components/schemas/Account"
'400':
description: Такая валюта не одобрена
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
'404':
description: Аккаунт не найден
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
get:
2023-05-14 21:47:40 +00:00
tags:
2023-05-15 16:41:04 +00:00
- wallet
2023-05-17 03:39:29 +00:00
summary: Запрос на получение ссылки на оплату
2023-05-15 16:41:04 +00:00
operationId: requestMoney
2023-05-17 03:39:29 +00:00
description: >-
- Формируем запрос к сервису оплаты, с необходимыми постбэками
- Получаем ответ от сервиса оплаты с ссылкой на оплату, которую надо передать пользователю
security:
- Bearer: []
parameters:
- name: cash
in: query
2023-05-17 20:27:09 +00:00
description: Количество денег
2023-05-17 03:39:29 +00:00
required: true
schema:
type: integer
default: 10000
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Успешный запрос денег
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
type: object
properties:
link:
type: string
example: "https://google.ru"
'500':
2023-05-17 03:39:29 +00:00
description: Сервис оплаты вернул ошибку
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-15 16:41:04 +00:00
/history:
2023-05-14 21:47:40 +00:00
get:
tags:
2023-05-15 16:41:04 +00:00
- history
2023-05-17 03:39:29 +00:00
summary: Получение лога событий связанных с аккаунтом
2023-05-15 16:41:04 +00:00
operationId: getHistory
2023-05-17 03:39:29 +00:00
security:
- Bearer: []
2023-05-14 21:47:40 +00:00
parameters:
2023-05-17 20:27:09 +00:00
- name: page
2023-05-14 21:47:40 +00:00
in: query
2023-05-17 03:39:29 +00:00
description: Номер страницы, начиная с 1
2023-05-14 21:47:40 +00:00
required: false
2023-05-15 16:41:04 +00:00
explode: false
2023-05-14 21:47:40 +00:00
schema:
2023-05-15 16:41:04 +00:00
type: integer
2023-05-17 20:27:09 +00:00
default: 1
- name: limit
2023-05-14 21:47:40 +00:00
in: query
2023-05-17 03:39:29 +00:00
description: Размер страницы
2023-05-14 21:47:40 +00:00
required: false
2023-05-15 16:41:04 +00:00
explode: false
2023-05-14 21:47:40 +00:00
schema:
2023-05-15 16:41:04 +00:00
type: integer
2023-05-17 03:39:29 +00:00
default: 100
2023-05-14 21:47:40 +00:00
responses:
'200':
2023-05-17 03:39:29 +00:00
description: Успешное получение событий
2023-05-14 21:47:40 +00:00
content:
application/json:
schema:
2023-05-15 16:41:04 +00:00
type: object
properties:
2023-05-17 03:39:29 +00:00
totalPages:
2023-05-15 16:41:04 +00:00
type: integer
example: 11
2023-05-17 03:39:29 +00:00
records:
2023-05-15 16:41:04 +00:00
type: array
items:
2023-05-17 03:39:29 +00:00
$ref: '#/components/schemas/History'
2023-05-15 16:41:04 +00:00
'401':
description: Неавторизован
2023-05-17 03:39:29 +00:00
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2023-05-15 16:41:04 +00:00
post:
2023-05-14 21:47:40 +00:00
tags:
2023-05-15 16:41:04 +00:00
- history
2023-05-17 03:39:29 +00:00
summary: Публикация лога в истории
2023-05-15 16:41:04 +00:00
operationId: add2history
2023-05-14 21:47:40 +00:00
requestBody:
content:
application/json:
schema:
2023-05-23 15:24:52 +00:00
type: object
2023-05-24 11:20:35 +00:00
required: [userId, type, comment, rawDetails]
2023-05-23 15:24:52 +00:00
properties:
userId:
type: string
example: "807f1f77bcf81cd799439011"
type:
$ref: '#/components/schemas/HistoryType'
comment:
type: string
example: "я это сделал потому что 42"
rawDetails:
type: string
example: '{"tariffs":["807f1f77bcf81cd799439011","807f1f77bcf81cd799439011"]}'
2023-05-14 21:47:40 +00:00
responses:
2023-05-15 16:41:04 +00:00
'200':
2023-05-17 03:39:29 +00:00
description: Успешная публикация лога
content:
application/json:
schema:
$ref: "#/components/schemas/History"
'500':
description: Ошибка при публикации
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
2023-05-14 21:47:40 +00:00
components:
schemas:
2023-05-17 03:39:29 +00:00
2023-05-14 21:47:40 +00:00
Account:
type: object
2023-05-31 21:28:35 +00:00
required: [_id, userId, cart, wallet, name, status, deleted, createdAt, updatedAt]
2023-05-14 21:47:40 +00:00
properties:
_id:
type: string
example: "807f1f77bcf81cd799439011"
userId:
type: string
example: "807f1f77bcf81cd799439011"
2023-05-27 18:13:29 +00:00
name:
$ref: '#/components/schemas/Name'
2023-05-14 21:47:40 +00:00
cart:
2023-05-17 03:39:29 +00:00
type: array
items:
type: string
example:
- "807f1f77bcf81cd799439011"
- "807f1f77bcf81cd799439012"
2023-05-14 21:47:40 +00:00
wallet:
$ref: "#/components/schemas/Wallet"
2023-05-30 12:10:03 +00:00
status:
type: string
2023-06-01 11:38:53 +00:00
enum: ["no", "org", "nko"]
default: "no"
2023-05-17 03:39:29 +00:00
deleted:
2023-05-14 21:47:40 +00:00
type: boolean
example: false
2023-05-17 03:39:29 +00:00
createdAt:
type: string
format: "date-time"
updatedAt:
type: string
format: "date-time"
deletedAt:
type: string
format: "date-time"
2023-05-30 12:12:50 +00:00
2023-05-27 18:13:29 +00:00
Name:
type: object
properties:
2023-05-31 21:28:35 +00:00
firstname:
2023-05-27 18:13:29 +00:00
type: string
example: Иван
secondname:
type: string
example: Иванов
lastname:
type: string
example: Иванович
orgname:
type: string
example: ООО \"Моя Оборона\"
2023-05-17 03:39:29 +00:00
2023-05-14 21:47:40 +00:00
Wallet:
type: object
2023-05-31 21:28:35 +00:00
required: [currency, cash, money, purchasesAmount, spent]
2023-05-14 21:47:40 +00:00
properties:
currency:
2023-05-17 20:27:09 +00:00
description: Текущий курс валюты
2023-05-14 21:47:40 +00:00
type: string
example: "RUB"
cash:
2023-05-17 20:27:09 +00:00
description: Сумма money переведённая на текущий курс
2023-05-22 16:42:15 +00:00
type: integer
format: int64
2023-05-14 21:47:40 +00:00
example: 10701
2023-05-31 21:28:35 +00:00
purchasesAmount:
type: integer
format: int64
description: Общая сумма денег, которые внёс пользователь
2023-05-26 13:39:51 +00:00
spent:
type: integer
format: int64
2023-05-31 21:28:35 +00:00
description: Общая сумма потраченных денег за всё время существования аккаунта
2023-05-15 16:41:04 +00:00
money:
2023-05-22 16:42:15 +00:00
type: integer
format: int64
2023-05-17 20:27:09 +00:00
description: >-
Деньги на счету в копейках. Чтобы при перессчётах не
возникало денег изниоткуда. фиксируемся к одной валюте,
она будет внутренней, никому её не покажем
2023-05-22 16:42:15 +00:00
example: 10701
2023-05-17 03:39:29 +00:00
History:
2023-05-14 21:47:40 +00:00
type: object
2023-05-17 20:27:09 +00:00
required: [id, userId, type, deleted, createdAt, updatedAt, comment, subject]
2023-05-14 21:47:40 +00:00
properties:
id:
type: string
2023-05-15 16:41:04 +00:00
example: "807f1f77bcf81cd799439011"
userId:
2023-05-14 21:47:40 +00:00
type: string
2023-05-15 16:41:04 +00:00
example: "807f1f77bcf81cd799439011"
type:
2023-05-23 15:24:52 +00:00
$ref: '#/components/schemas/HistoryType'
2023-05-17 03:39:29 +00:00
deleted:
type: boolean
example: false
2023-05-15 16:41:04 +00:00
createdAt:
2023-05-14 21:47:40 +00:00
type: string
2023-05-17 03:39:29 +00:00
format: "date-time"
updatedAt:
type: string
format: "date-time"
deletedAt:
type: string
format: "date-time"
2023-05-15 16:41:04 +00:00
comment:
2023-05-14 21:47:40 +00:00
type: string
2023-05-15 16:41:04 +00:00
example: "я это сделал потому что 42"
2023-05-23 15:24:52 +00:00
rawDetails:
2023-05-14 21:47:40 +00:00
type: string
2023-05-17 03:39:29 +00:00
description: >-
2023-05-17 20:27:09 +00:00
Я пока не могу предположить, какие будут фильтры по
истории, поэтому предлагаю в это
поле просто класть строку с json.
Ибо для каждого типа записи она своя.
2023-05-23 10:52:27 +00:00
example: '{"tariffs":["807f1f77bcf81cd799439011","807f1f77bcf81cd799439011"]}'
2023-05-17 03:39:29 +00:00
2023-05-23 15:24:52 +00:00
HistoryType:
type: string
enum: ["successfulPayment", "declinedPayment", "timeoutPayment", "buyCart", "subsriptionEnd"]
2023-06-13 12:19:51 +00:00
PaymentType:
type: string
enum: ["bankCard", "tinkoffBank", "qiwi", "sberbank", "yoomoney", "mobile", "installments", "cash", "sbp", "b2bSberbank", "alfabank"]
2023-05-17 03:39:29 +00:00
Error:
type: object
2023-05-17 20:27:09 +00:00
required: [code, message]
2023-05-17 03:39:29 +00:00
properties:
statusCode:
type: integer
format: int64
example: 404
message:
type: string
example: user not found
securitySchemes:
Bearer: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT
description: >-
Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".
2023-06-13 12:19:51 +00:00