From 2260bf10664338f40b3174018f7a7099634b9881 Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 22 May 2026 12:04:09 +0300 Subject: [PATCH] =?UTF-8?q?H-3656:=20=D1=83=D1=82=D0=BE=D1=87=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=20Wallet=20admin=20API=20=D0=B2=20v2=20swagger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /admin/wallet-transaction: добавил недостающие фильтры (sender_wallet_id, recipient_wallet_id, sender_user_list_key, recipient_user_list_key, wallet_user_list_key, department_id, entity_id, reference_id) + описания. - sort: перечислил реальные сортируемые атрибуты для wallet/wallet-transaction. - reg_status_id / created_at / user_list_key: уточнил формат и поведение. - WalletTransaction + WalletTransactionFormBody + параметры фильтра: заменил инлайн enum [1,2] на $ref walletTransactionType / walletOperationType. - walletOperationType: добавил отсутствующее значение 9 (Отмена покупки), чтобы соответствовать app\models\wallet\enum\WalletOperationType. Co-Authored-By: Claude Opus 4.7 (1M context) --- v2/swagger.yaml | 88 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 72d501f..163908a 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -6915,8 +6915,11 @@ paths: schema: { type: integer, minimum: 1, maximum: 100, default: 20 } - name: sort in: query - schema: { type: string } - description: Префикс "-" для DESC. Пример "-balance". + schema: + type: string + enum: [created_at, "-created_at", status_id, "-status_id", balance, "-balance", name, "-name"] + description: | + Префикс `-` для DESC. По умолчанию `-created_at`. - name: user_id in: query schema: { type: string, format: uuid } @@ -6930,13 +6933,17 @@ paths: - name: user_list_key in: query schema: { type: string, format: uuid } + description: Ключ закэшированной выборки сотрудников (создаётся через core user-list-cache). - name: reg_status_id in: query schema: { type: string } + description: | + Comma-separated значения `RegStatus` (статус участия). Без параметра — + показываются все валидные для отображения статусы. - name: created_at in: query schema: { type: string } - description: Диапазон, формат "from|to" (ISO). + description: 'Диапазон в формате `from|to` (ISO дата/время).' responses: 200: description: Список кошельков @@ -6992,6 +6999,9 @@ paths: get: tags: [admin-wallet-transaction] summary: Список транзакций (admin-вид — видны транзакции всех юзеров) + description: | + Под `wallets-transactions` отдаёт все транзакции тенанта (учётная админ-выборка). + Без права — только транзакции по своему кошельку. operationId: adminWalletTransactionIndex parameters: - name: page @@ -7002,26 +7012,71 @@ paths: schema: { type: integer, minimum: 1, maximum: 100, default: 20 } - name: sort in: query - schema: { type: string } + schema: + type: string + enum: + - created_at + - "-created_at" + - wallet_transaction_type + - "-wallet_transaction_type" + - wallet_operation_type + - "-wallet_operation_type" + - amount + - "-amount" + description: | + Префикс `-` для DESC. По умолчанию `-created_at`. - name: wallet_id in: query schema: { type: string, format: uuid } + description: Транзакции конкретного кошелька (отправитель ИЛИ получатель). + - name: sender_wallet_id + in: query + schema: { type: string, format: uuid } + - name: recipient_wallet_id + in: query + schema: { type: string, format: uuid } - name: sender_user_id in: query schema: { type: string, format: uuid } + description: Транзакции, где этот юзер — отправитель ИЛИ администратор начисления. - name: recipient_user_id in: query schema: { type: string, format: uuid } + - name: sender_user_list_key + in: query + schema: { type: string, format: uuid } + description: Выборка сотрудников-отправителей (см. core user-list-cache). + - name: recipient_user_list_key + in: query + schema: { type: string, format: uuid } + - name: wallet_user_list_key + in: query + schema: { type: string, format: uuid } + description: | + Выборка сотрудников: транзакция учитывается, если кто-то из них — + отправитель, получатель ИЛИ администратор начисления. Полезно для поиска + операций, где одна из сторон NULL (покупка в магазине, авто-начисления). + - name: department_id + in: query + schema: { type: string, format: uuid } - name: wallet_transaction_type in: query - schema: { type: integer, enum: [1, 2] } - description: 1=Credit, 2=Debit + schema: + $ref: '#/components/schemas/walletTransactionType' - name: wallet_operation_type + in: query + schema: + $ref: '#/components/schemas/walletOperationType' + - name: entity_id in: query schema: { type: integer } + - name: reference_id + in: query + schema: { type: string, format: uuid } - name: created_at in: query schema: { type: string } + description: 'Диапазон в формате `from|to` (ISO дата/время).' responses: 200: description: Список транзакций @@ -11731,7 +11786,8 @@ components: * `6` - Автоматическое начисление валюты * `7` - Подарок (автоматическое начисление) * `8` - Подарок (процент от баланса) - enum: [1, 2, 3, 4, 5, 6, 7, 8] + * `9` - Отмена покупки + enum: [1, 2, 3, 4, 5, 6, 7, 8, 9] example: 3 walletTransaction: @@ -12037,24 +12093,21 @@ components: id: { type: string, format: uuid } created_at: { type: string } wallet_transaction_type: - type: integer - enum: [1, 2] - description: 1=Credit, 2=Debit + $ref: '#/components/schemas/walletTransactionType' wallet_operation_type: - type: integer - description: Подтип операции (Credit, Debit, AutoCredit, BalancePercentGift, Gift и т.д.) + $ref: '#/components/schemas/walletOperationType' sender_wallet_id: { type: string, format: uuid, nullable: true } recipient_wallet_id: { type: string, format: uuid, nullable: true } amount: { type: integer } entity_id: { type: integer, nullable: true } reference_id: { type: string, format: uuid, nullable: true } comment: { type: string, nullable: true } - createdAt: { type: string } + createdAt: { type: string, description: 'Локализованная дата для отображения.' } senderUserId: { type: string, format: uuid, nullable: true } senderName: { type: string, nullable: true } recipientUserId: { type: string, format: uuid, nullable: true } recipientName: { type: string, nullable: true } - walletOperationTypeName: { type: string } + walletOperationTypeName: { type: string, description: 'Человекочитаемое название операции.' } WalletTransactionList: type: object @@ -12077,14 +12130,13 @@ components: usersListKey: type: string format: uuid - description: Ключ выборки сотрудников (создаётся через `POST /core/user-list-cache/set-user-list`) + description: Ключ выборки сотрудников (создаётся через core user-list-cache). wallet_transaction_type: - type: integer - enum: [1, 2] - description: 1=Credit (начисление), 2=Debit (списание) + $ref: '#/components/schemas/walletTransactionType' amount: type: integer minimum: 1 + description: Сумма в единицах корп. валюты. На каждого сотрудника выборки. comment: type: string maxLength: 400