H-3656/H-3657: правки после smoke-теста на denis.hrbox.io

- Listing-схемы (Wallet/WalletTransaction/FileProcessing/UserApiToken{,Admin}):
  добавил optional поле `_links` — оно реально возвращается Yii Pagination
  на index-эндпоинтах и без него клиент-генератор не видит поле.
- FileProcessing: дополнил схему полями, которые реально приходят в
  ответе без `?expand=`:
  * `file` — объект с метаданными файла-источника (name, ext, url, ...)
  * `created`/`started`/`finished` — локализованные строки для отображения
  Уточнил `arguments` и `result` (oneOf object/array).

Все остальные эндпоинты (admin/wallet[/view], admin/wallet-transaction[/view],
admin/wallet-transaction/{create,create-from-excel,excel-processing},
file-processing[/view], user-api-token, admin/user-api-token) после
прогона smoke-теста соответствуют документации:
- response shape ↔ schema
- 400 на not-uuid id
- 404 на несуществующий id
- per-page>100 clamps к 100
- 200 с {success:false, errors:[...]} на пустой POST
- 200 с {success:false, message:{type:warning, text:"Обработка файла не найдена"}}
  на несуществующий file_processing_id
- 403 на /user-api-token и /admin/user-api-token под Bearer

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Denis
2026-05-22 13:46:56 +03:00
co-authored by Claude Opus 4.7
parent 5173f32b0f
commit 4c74aa22f5
+39 -3
View File
@@ -12379,6 +12379,8 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/Wallet' $ref: '#/components/schemas/Wallet'
_links:
$ref: '#/components/schemas/_links'
_meta: _meta:
$ref: '#/components/schemas/_meta' $ref: '#/components/schemas/_meta'
@@ -12411,6 +12413,8 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/WalletTransaction' $ref: '#/components/schemas/WalletTransaction'
_links:
$ref: '#/components/schemas/_links'
_meta: _meta:
$ref: '#/components/schemas/_meta' $ref: '#/components/schemas/_meta'
@@ -12490,10 +12494,13 @@ components:
1 — NEW, 2 — QUEUED, 3 — STARTED, 4 — FINISHED, 5 — ERROR, 6 — FATAL 1 — NEW, 2 — QUEUED, 3 — STARTED, 4 — FINISHED, 5 — ERROR, 6 — FATAL
arguments: arguments:
type: array type: array
result:
type: object
description: | description: |
Результат. Для wallet-excel содержит: Аргументы воркера. Для wallet-excel: `[WalletExcelProcessor::class, mappings]`.
Для excel-экспорта: `[ReportClass::class, params]`.
items: {}
result:
description: |
Результат. Для wallet-excel:
``` ```
{ {
"summary": { "totalRows": 4, "validCount": 1, "invalidCount": 3 }, "summary": { "totalRows": 4, "validCount": 1, "invalidCount": 3 },
@@ -12501,9 +12508,32 @@ components:
"invalidRows": [{ "row": 2, "errors": {...} }, ...] "invalidRows": [{ "row": 2, "errors": {...} }, ...]
} }
``` ```
Для незавершённой обработки или экспорта — пустой массив `[]`.
oneOf:
- type: object
- type: array
items: {}
created_at: { type: string } created_at: { type: string }
started_at: { type: string, nullable: true } started_at: { type: string, nullable: true }
finished_at: { type: string, nullable: true } finished_at: { type: string, nullable: true }
file:
type: object
nullable: true
description: |
Метаданные файла-источника. Возвращается всегда (не нужно `?expand=`).
Содержит `id, name, ext, fid, url, file_type, mime_type, size,
file_status_id, user_id, created_at` и др.
created:
type: string
description: 'Локализованная `created_at` (например `04.05.2026 at 13:56`).'
started:
type: string
nullable: true
description: Локализованная `started_at`.
finished:
type: string
nullable: true
description: Локализованная `finished_at`.
FileProcessingList: FileProcessingList:
type: object type: object
@@ -12512,6 +12542,8 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/FileProcessing' $ref: '#/components/schemas/FileProcessing'
_links:
$ref: '#/components/schemas/_links'
_meta: _meta:
$ref: '#/components/schemas/_meta' $ref: '#/components/schemas/_meta'
@@ -12567,6 +12599,8 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/UserApiToken' $ref: '#/components/schemas/UserApiToken'
_links:
$ref: '#/components/schemas/_links'
_meta: _meta:
$ref: '#/components/schemas/_meta' $ref: '#/components/schemas/_meta'
@@ -12634,6 +12668,8 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/UserApiTokenAdmin' $ref: '#/components/schemas/UserApiTokenAdmin'
_links:
$ref: '#/components/schemas/_links'
_meta: _meta:
$ref: '#/components/schemas/_meta' $ref: '#/components/schemas/_meta'