docs(swagger): actualize /cart/pay, get /wallet

This commit is contained in:
Kirill 2023-06-13 16:57:23 +03:00
parent 657db37ff6
commit 3005c87ccf

@ -1,4 +1,4 @@
openapi: 3.0.1 openapi: 3.1.0
info: info:
title: Customer - сервис для управления клиентами title: Customer - сервис для управления клиентами
description: |- description: |-
@ -396,17 +396,6 @@ paths:
security: security:
- Bearer: [] - Bearer: []
description: Запрос на проведение оплаты корзины description: Запрос на проведение оплаты корзины
requestBody:
content:
application/json:
schema:
type: object
required: [userId]
properties:
userId:
type: string
description: ID для того, чтобы указать сервису оплаты, какой юзер оплатил
example: "807f1f77bcf81cd799439011"
responses: responses:
'200': '200':
description: успешная оплата корзины description: успешная оплата корзины
@ -473,70 +462,40 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
post:
tags:
- wallet
summary: Зачислить деньги на кошелёк
description: "Прибавляем полученное значение к cash и при необходимости приводим к валюте кошелька"
operationId: putMoney
security:
- Bearer: []
requestBody:
content:
application/json:
schema:
type: object
required: [cash, currency, userId]
properties:
cash:
type: integer
format: int64
example: 10000
currency:
type: string
example: "USD"
userId:
type: string
example: "807f1f77bcf81cd799439011"
responses:
'200':
description: успешное внесение денег на кошелёк
content:
application/json:
schema:
$ref: "#/components/schemas/Account"
'400':
description: Такая валюта не одобрена
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
'404':
description: Аккаунт не найден
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
get: get:
tags: tags:
- wallet - wallet
summary: Запрос на получение ссылки на оплату summary: Запрос на получение ссылки на оплату
operationId: requestMoney operationId: requestMoney
description: >-
- Формируем запрос к сервису оплаты, с необходимыми постбэками
- Получаем ответ от сервиса оплаты с ссылкой на оплату, которую надо передать пользователю
security: security:
- Bearer: [] - Bearer: []
parameters: description: >-
- name: cash - Формируем запрос к сервису оплаты, с необходимыми постбэками
in: query - Получаем ответ от сервиса оплаты с ссылкой на оплату, которую надо передать пользователю
description: Количество денег requestBody:
required: true content:
schema: application/json:
type: integer schema:
default: 10000 type: object
required: [type, currency, amount]
properties:
type:
$ref: '#/components/schemas/PaymentType'
currency:
type: string
description: "ISO-4217 формат"
example: "RUB"
amount:
type: integer
example: 15020
bankCard:
$ref: '#/components/schemas/BankCard'
phoneNumber:
type: string
example: "79000000000"
login:
type: string
example: "login_test"
responses: responses:
'200': '200':
description: Успешный запрос денег description: Успешный запрос денег
@ -696,6 +655,31 @@ components:
type: string type: string
example: ООО \"Моя Оборона\" example: ООО \"Моя Оборона\"
BankCard:
type: object
required: [number, expiryYear, expiryMonth]
properties:
number:
type: string
example: "RUB"
description: Номер карты
expiryYear:
type: string
example: "21"
description: Год истечения срока карты
expiryMonth:
type: string
example: "05"
description: Месяц истечения срока карты
csc:
type: string
example: "05"
description: Код CVC2 или CVV2, 3 или 4 символа, печатается на обратной стороне карты
cardholder:
type: string
description: Имя владельца карты
example: "IVAN IVANOV"
Wallet: Wallet:
type: object type: object
required: [currency, cash, money, purchasesAmount, spent] required: [currency, cash, money, purchasesAmount, spent]