Files

36 lines
8.2 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. Backend contract и money mapping
- [x] 1.1 Обновить `backend/src/tbank/upcoming-events.dto.ts`: заменить отдельные nullable `currency` и `amount` у Future Cash Event на одно nullable Money-поле прогнозной суммы, переиспользуя существующий Money DTO shape `{ currency, value }`; verification: `npm test -- tbank/upcoming-events.service.spec.ts --runInBand` в `backend` видит новый contract shape в expected events.
- [x] 1.2 Обновить `backend/src/tbank/upcoming-events.service.ts`: coupon, dividend и maturity должны возвращать прогнозную сумму как Money в исходной валюте, offer и неизвестные денежные условия — `null`, без изменения периода, сортировки, `calculatedAt`, event types и source failure behavior; verification: `npm test -- tbank/upcoming-events.service.spec.ts --runInBand` в `backend`.
- [x] 1.3 Расширить backend tests в `backend/src/tbank/upcoming-events.service.spec.ts` для нового Money contract: coupon/dividend/maturity содержат `{ currency, value }`, offer содержит `null`, отменённый dividend по-прежнему исключается, partial result при source failure не возвращается; verification: `npm test -- tbank/upcoming-events.service.spec.ts --runInBand` в `backend`.
- [x] 1.4 Проверить, что account-scoped access semantics не изменились для Upcoming Events: недоступный, закрытый, неподдерживаемый или отсутствующий в текущем T-Bank connection Brokerage Account продолжает давать существующий недоступный-account response без раскрытия событий; verification: focused existing/new test в `backend/src/tbank/upcoming-events.service.spec.ts` и `npm test -- tbank/upcoming-events.service.spec.ts --runInBand` в `backend`.
- [x] 1.5 Запустить backend contract и quality checks после DTO/service правок; verification: `npm run lint && npm run typecheck:app && npm run typecheck:test && npm test -- --runInBand` в `backend`.
## 2. Runtime OpenAPI и frontend generated contract
- [x] 2.1 Запустить штатную синхронизацию frontend OpenAPI artifacts после backend contract change; verification: `npm run openapi:sync` в `frontend` обновляет только `frontend/src/shared/api/spec/openapi.json` и `frontend/src/shared/api/generated/schema.d.ts` без ручной правки generated файла.
- [x] 2.2 Проверить generated contract локально после sync; verification: `npm run openapi:check && npm run typecheck` в `frontend`.
- [x] 2.3 Выполнить обязательный runtime contract gate для обеих сторон API; verification: `bash specs/scripts/verify-runtime-openapi.sh` из workspace root проходит после backend runtime schema и frontend committed snapshot sync.
## 3. Frontend consumers и пользовательское отображение событий
- [x] 3.1 Обновить event fixtures и tests в `frontend/src/entities/brokerage-event/api/useBrokerageEvents.test.tsx`, `frontend/src/pages/account-events/ui/AccountEventsPage.test.tsx`, `frontend/src/pages/account/ui/AccountPage.vm.test.tsx` и related MSW fixtures так, чтобы Future Cash Event использовал nullable Money-поле вместо `amount`/`currency`; verification: `npm run test:run -- brokerage-event AccountEventsPage AccountPage.vm` в `frontend`.
- [x] 3.2 Обновить full events page в `frontend/src/pages/account-events/ui/AccountEventsPage.tsx`: known projected amount рендерится через существующий `formatMoney`, `null` сохраняет текущую copy без суммы, дата/type/instrument/error/empty states не меняются; verification: `npm run test:run -- AccountEventsPage` в `frontend`.
- [x] 3.3 Обновить account overview recent events presentation в `frontend/src/pages/account/ui/components/RecentEvents.view.tsx` и view-model mapping в `frontend/src/pages/account/ui/AccountPage.vm.ts`, если generated type требует mapping change: known projected amount рендерится через `formatMoney`, `null` остаётся без суммы, limit/sorting берутся из существующего response без нового client-side поведения; verification: `npm run test:run -- AccountPage.vm AccountPage` в `frontend`.
- [x] 3.4 Проверить, что frontend больше не обращается к removed `amount`/`currency` fields Future Cash Event вне generated snapshot diff; verification: `rg -n "\\b(amount|currency)\\b" frontend/src/entities/brokerage-event frontend/src/pages/account-events frontend/src/pages/account/ui -g "*.ts" -g "*.tsx"` reviewed manually for no legacy event-money access, затем `npm run typecheck` в `frontend`.
- [x] 3.5 Запустить frontend canonical gate после consumer и generated правок; verification: `npm run verify` в `frontend`.
## 4. Docs и as-built domain language
- [x] 4.1 Обновить `docs/architecture/domain-glossary.md`: закрепить Brokerage Account как доступный через текущее T-Bank connection, Money как единый `{ currency, value }`, Portfolio Snapshot, Currency Instrument Position, Cash Balance, Instrument для Portfolio и Future Cash Event, а runtime/cache terms отделить от доменных терминов; verification: scoped markdown review плюс `npm run verify` в `docs`.
- [x] 4.2 Обновить affected feature/system docs (`docs/features/brokerage-accounts.md`, `docs/features/portfolio-view.md`, `docs/features/brokerage-account-upcoming-events.md`, `docs/architecture/system-overview.md` при необходимости) до фактического поведения: Upcoming Events показывают nullable Money прогнозной суммы, Brokerage Account описан как current-connection доступность, Portfolio Snapshot и Cash Balance/валютная позиция различаются; verification: scoped link/review check и `npm run verify` в `docs`.
- [x] 4.3 Проверить, что docs не стали параллельным SDD artifact и не описывают planned behavior до реализации; verification: review affected docs на отсутствие пересказа Proposal/Design/Tasks и `npm run verify` в `docs`.
## 5. Specs, semantic verification и archive readiness
- [x] 5.1 Проверить OpenSpec change structurally после всех planning artifacts и перед implementation handoff; verification: `openspec validate align-domain-model-and-money-contract --type change --strict --store wealth-ledger-specs` из `specs`.
- [x] 5.2 После реализации выполнить semantic verification против Proposal, Delta Specs и Design: подтвердить, что changed public contract реализован только для Future Cash Event projected amount, account access остаётся current-connection based, Portfolio Snapshot/Cash Balance/Currency Instrument Position semantics не сломаны, routes/storage/cache/upstream policies не изменены; verification: зафиксировать checked areas и conclusion в implementation summary перед archive.
- [x] 5.3 Выполнить affected repository gates под Node 22: backend `npm run verify`, frontend `npm run verify`, docs `npm run verify`, specs strict validation; verification: все commands завершаются успешно без auto-fix как completion evidence candidates.
- [x] 5.4 Выполнить workspace dispatcher как pre-archive gate; verification: `bash specs/scripts/verify-workspace-change.sh align-domain-model-and-money-contract` из workspace root.
- [x] 5.5 Провести independent read-only review generated-contract diff, backend money mapping, frontend rendering, docs terminology и OpenSpec deltas; verification: отсутствие Critical/Important findings до archive.