Sergey Krylov 1774c7ffd6
Some checks failed
CI / ci (pull_request) Failing after 2m32s
CI / ci (push) Failing after 2m17s
refactor(frontend): bring FSD architecture into compliance
- 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.
2026-06-20 22:43:44 +03:00

2.1 KiB
Raw Permalink Blame History

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-8
    • entities/broker-position/index.ts — удалить BROKER_OPERATION_TYPE_OPTIONS, getBrokerOperationImpact, getBrokerOperationTypeLabel, isBrokerOperationType, BrokerOperationImpact
    • entities/broker-position/model/brokerDisplay.test.ts — перенести импорты broker-operation напрямую
  • Task 2: Дедуплицировать форматтеры
    • Создать shared/lib/formatters.ts с каноничными реализациями
    • entities/broker-account/model/brokerAccountsOverview.ts — перейти на импорт из shared
    • widgets/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/
  • Task 4: Очистить entities/stock/index.ts
    • Убрать getShare, getShareMarketData, getShareDividends, getShareHistory, getShareCandles
  • Проверка: lint + build + тесты
    • Build — OK
    • Tests — 23/23 files, 111/111 passed