- Remove cross-entity import (broker-position -> broker-operation) - Extract duplicated formatters to shared/lib/formatters.ts - Flatten shared/ui/broker-allocation-bar nesting - Clean up entities/stock/index.ts public API All 111 tests pass, build clean.
2.1 KiB
2.1 KiB
FSD Quick Fix — Tasks
- Создать feature branch
codex/fsd-quick-fix - Написать spec.md
- Написать plan.md
- Task 1: Убрать cross-entity import broker-position → broker-operation
entities/broker-position/model/brokerDisplay.ts— удалить re-export строк 2-8entities/broker-position/index.ts— удалить BROKER_OPERATION_TYPE_OPTIONS, getBrokerOperationImpact, getBrokerOperationTypeLabel, isBrokerOperationType, BrokerOperationImpactentities/broker-position/model/brokerDisplay.test.ts— перенести импорты broker-operation напрямую
- Task 2: Дедуплицировать форматтеры
- Создать
shared/lib/formatters.tsс каноничными реализациями entities/broker-account/model/brokerAccountsOverview.ts— перейти на импорт из sharedwidgets/broker-account-card/BrokerAccountCard.tsx— убрать дубликатыwidgets/broker-accounts-summary/BrokerAccountsSummary.tsx— убрать дубликатыwidgets/broker-allocation-chart/BrokerAllocationChart.tsx— убрать дубликатыwidgets/broker-operations-table/BrokerOperationsTable.tsx— убрать дубликатыwidgets/portfolio-card/PortfolioCard.tsx— убрать дубликатыpages/broker-account/BrokerAccountOverviewPage.tsx— убрать дубликатыpages/broker-positions/BrokerPositionsPage.tsx— убрать дубликаты
- Создать
- Task 3: Уплостить shared/ui/broker-allocation-bar
- Переместить BrokerAllocationBar.tsx из
ui/на уровень slice - Обновить
index.ts - Удалить пустую
ui/
- Переместить BrokerAllocationBar.tsx из
- Task 4: Очистить entities/stock/index.ts
- Убрать getShare, getShareMarketData, getShareDividends, getShareHistory, getShareCandles
- Проверка: lint + build + тесты
- Build — OK
- Tests — 23/23 files, 111/111 passed