Files

25 lines
4.6 KiB
Markdown
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.
## 1. Шов Authenticated Query
- [x] 1.1 Добавить focused failing frontend test для protected query gating в `frontend/src/shared/api`: protected query не вызывает MSW endpoint без configured session и загружается после `configureAuthClient` с access token; плановая проверка: `npm run test:run -- src/shared/api`.
- [x] 1.2 Реализовать минимальный shared authenticated-query seam в `frontend/src/shared/api`: subscribed auth snapshot конфигурируется существующим auth client setup, а `enabled` вычисляется как `hasSession && callerEnabled`; плановая проверка: `npm run test:run -- src/shared/api`.
- [x] 1.3 Проверить, что `frontend/src/shared/api/client.test.ts` по-прежнему доказывает bearer injection, refresh retry, clearing после failed refresh и исключение auth endpoints; плановая проверка: `npm run test:run -- src/shared/api/client.test.ts`.
## 2. Интерфейсы Entity Hooks
- [x] 2.1 Refactor `useBrokerageAccounts`: убрать `accessToken` argument, использовать shared authenticated-query seam и сохранить query key, `staleTime: 60_000`, `retry: false`; плановая проверка: `npm run typecheck`.
- [x] 2.2 Refactor `usePortfolio`: оставить только `accountId`, использовать authenticated query enablement вместе с `Boolean(accountId)`, сохранить path params, `staleTime: 30_000`, `retry: false`; плановая проверка: `npm run test:run -- src/entities/portfolio/api/usePortfolio.test.tsx`.
- [x] 2.3 Refactor `useBrokerageOperations`: оставить `accountId` и query object, сохранить `brokerageOperationsQueryParams`, sorted categories, path/query params, `staleTime: 30_000`, `retry: false`; плановая проверка: `npm run test:run -- src/entities/broker-operation/api/useBrokerageOperations.test.tsx`.
- [x] 2.4 Refactor `useBrokerageEvents`: оставить только `accountId`, использовать authenticated query enablement вместе с `Boolean(accountId)`, сохранить path params, `staleTime: 30_000`, `retry: false`; плановая проверка: добавить или обновить focused hook test и запустить `npm run test:run -- src/entities/brokerage-event`.
## 3. Call Sites И Существующие Tests
- [x] 3.1 Обновить accounts page ViewModel, account page ViewModel, account operations page, account events page и breadcrumbs на новые domain-shaped hooks; убрать `useAuth()` reads, которые существовали только для передачи `accessToken`; плановая проверка: из `frontend` команда `rg "useBrokerageAccounts\\(|usePortfolio\\(|useBrokerageOperations\\(|useBrokerageEvents\\(" src/pages src/app src/entities -n` показывает обновлённые call sites без token argument pattern.
- [x] 3.2 Обновить frontend tests и mocks, затронутые изменением hook interfaces, сохранив existing user-visible state expectations; плановая проверка: `npm run test:run -- src/pages/accounts src/pages/account src/pages/account-operations src/pages/account-events src/app/ui`.
- [x] 3.3 Подтвердить, что review item закрыт без расширения scope на `useTbankConnectionViewModel` или error-code consolidation; плановая проверка: из `frontend` команда `rg "usePortfolio\\([^\\n,]+,\\s*accessToken|useBrokerageAccounts\\(accessToken|useBrokerageOperations\\([^\\n]+accessToken|useBrokerageEvents\\([^\\n]+accessToken" src -n` не находит matches.
## 4. Verification
- [x] 4.1 Запустить frontend canonical gate после реализации; плановая проверка: `npm run verify` из `frontend`.
- [x] 4.2 Запустить OpenSpec structural validation для change; плановая проверка: `openspec validate remove-frontend-hook-token-params --type change --strict --store wealth-ledger-specs` из `specs`.
- [x] 4.3 Запустить workspace dispatcher для change и выполнить semantic verification против Proposal, Design и completed Tasks; плановая проверка: `bash specs/scripts/verify-workspace-change.sh remove-frontend-hook-token-params` из workspace root плюс recorded read-through, что user-visible behavior, backend contract и out-of-scope frontend architecture work не изменились.