304 Commits

Author SHA1 Message Date
27fb6e77be refactor(frontend): polish dashboard tables per code review
- Drop unused `letterSpacing: 0.2` from TH_SX in both table cards
  (HTML mockup has no letter-spacing on headers)
- Move `eventStatusTone` from EventsCard to dashboardVisual.ts
  for symmetry with `eventTypeTone` (single source of tone semantics)
- Drop unused `columnWidths` prop and `widthsFor` override branch
  in BrokerDashboardTableSkeleton (no caller passes it)
- Drop redundant `role="presentation"` on skeleton wrapper
  (rows already carry `aria-hidden="true"`)
- Drop unused `TypeTone` import from EventsCard after moving
  eventStatusTone out
2026-06-27 13:39:23 +03:00
94f8bb876d fix(frontend): correct events amount sign for actual-negative rows
Spec review of Task 9 caught that the events amount prefix used '+'
unconditionally for any actual source, producing '+-87,00 ₽' on negative
actual amounts. Mirror the income card sign handling: '+' for positive,
Unicode '−' (U+2212) for negative, '~' for forecast (regardless of sign).

Extract a small eventAmountDisplay helper and tighten the corresponding
test assertion to require exact equality instead of substring match, so
this regression class is caught next time.
2026-06-27 13:35:48 +03:00
3bad694dce feat(frontend): align dashboard tables with HTML parity
- Add thead with semantic column headers to events and income tables
- Render instruments as main (ticker/ISIN) + subtitle (name) via instrumentDisplay
- Type column uses compact Chip with eventTypeTone/incomeTypeTone; DIV_EXT
  shows distinct label 'Дивиденд (внешний)'
- Amount column applies moneyTone (positive=green, negative=red, planned=neutral)
  via moneyToneToColor; sign prefixes (+/-/~) preserved per spec
- Status column: 'Поступило' (success) vs 'Ожидается' (neutral)
- Income sum semantics preserved (sum of current page rows)
- Skeleton: unified column-width and variant pattern for both tables
- Drop legacy DashboardIncomeRow.instrument alias (now uses instrumentMain/Subtitle)
- Extract moneyToneToColor helper from hero (single source of MUI color mapping)
- Dashboard tests cover thead, badges, subtitles, signed tones, and that
  tables show ₽ instead of RUB for RUB amounts
2026-06-27 13:33:02 +03:00
21df354df6 fix(frontend): align dashboard card heading hierarchy
BrokerDashboardCard previously rendered <Heading level={3} size="section">,
which produced an <h3> under the <h1> account name in BrokerAccountLayout,
skipping the <h2> level. Use level={2} so the semantic HTML is a proper
<h2> while keeping the compact "section" visual size.

Also extract the byte-identical toolbar wrapper (grid + chips + date filter
slot) shared by BrokerDashboardEventsCard and BrokerDashboardIncomeCard
into BrokerDashboardTableToolbar to remove duplicated sx config.
2026-06-27 13:21:15 +03:00
0a1ae0552c feat(frontend): apply hero, card and toolbar HTML parity 2026-06-27 13:07:06 +03:00
1a2937ad58 refactor(frontend): tighten dashboard visual helpers per code review 2026-06-27 12:57:03 +03:00
af0aaeda9d feat(frontend): add dashboard visual helpers for HTML parity
Introduce dashboardVisual.ts with moneyTone, formatDashboardCurrency,
eventTypeTone, incomeTypeTone, and instrumentDisplay helpers used by
the broker dashboard to match the HTML reference prototype.

Extend dashboardIncome.ts: typeLabel now distinguishes DIV_EXT
('Дивиденд (внешний)'), and rows expose instrumentMain/instrumentSubtitle
via instrumentDisplay while keeping instrument as a derived alias for
existing callers.

Add resetDashboardFilters factory in dashboardFilters.ts so Task 3 can
wire the reset action without re-churning filter types.
2026-06-27 12:46:39 +03:00
ae207b0cb3 feat: improove design, add change spec 2026-06-27 12:33:58 +03:00
d4d1dd980e feat: replace native date inputs with single DateCalendar field in broker dashboard
- Replace two MUI DatePicker components with a single visual range field
- Click opens Popover with community DateCalendar (no DateRangePicker/pro)
- First click sets start, second sets end; if end < start, range resets
- Remove isOpen/onToggle props — Popover managed locally
- Add BrokerDashboardTableSkeleton for events/income loading
- Set default weekly range (today-7d / today) for both events and income
- Remove 'Фильтр' label, rename 'Показать' → 'Применить период'
- Install @mui/x-date-pickers@7
- Update tests for new UI and skeleton loading states
- Align spec.md, plan.md, tasks.md with implementation
2026-06-27 11:48:10 +03:00
0116c34a9f feat: improove design 2026-06-27 11:11:25 +03:00
d804d43616 docs: align broker dashboard redesign docs 2026-06-27 10:45:20 +03:00
8df94a51dd feat: broker dashboard redesign with top tabs, single-column layout, and clickable chip filters
- Move navigation from left sidebar to horizontal top tabs in BrokerAccountLayout
- Change dashboard blocks to single-column layout (Events, Income, Analytics, Allocation)
- Extend DS Chip with onClick/selected/disabled/aria-pressed
- Add clickable chip filters to Events and Income cards with immediate filtering
- Disable backend query when all types deselected (show validation message)
- Add useBrokerEvents/useBrokerOperations options.enabled param
- Update dashboard skeleton to single-column shape
- Add userEvent tests for chip filter interactions
2026-06-26 10:47:08 +03:00
c429d6a43a feat(frontend): redesign broker account overview as investment dashboard
Replace vertical overview with dashboard composition:
- BrokerDashboardHero with portfolio KPI, return, daily change, total income
- BrokerDashboardEventsCard with compact events table and local pagination
- BrokerDashboardIncomeCard with income operations table and cursor pagination
- BrokerDashboardAnalyticsCard with analytics Metric grid
- BrokerDashboardAllocationCard wrapping existing donut chart
- BrokerDashboardSkeleton matching dashboard shape
- BrokerDashboardCard local card pattern
- Pure lib helpers: dashboardIncome, dashboardFilters, dashboardFormatters
- Unit tests for income helpers (6) and dashboard composition (1)
2026-06-26 10:18:57 +03:00
49dac140ff docs: plan broker dashboard redesign 2026-06-26 09:45:04 +03:00
8dab915edd fix(backend): isolate health service unit test
All checks were successful
CI / ci (push) Successful in 15m16s
2026-06-26 07:58:31 +03:00
bbbdca30f6 docs: merge architecture backlog branch 2026-06-26 07:54:16 +03:00
99a917392a docs: publish architecture quality backlog 2026-06-26 07:50:04 +03:00
47e65c9b46 docs: add architecture quality backlog 2026-06-25 22:53:22 +03:00
7af8691e0c docs: clarify graphify usage for tracing 2026-06-25 22:53:06 +03:00
4cb0b8d450 docs: clarify graphify usage for tracing 2026-06-25 22:51:01 +03:00
293838ba68 docs: clarify graphify usage for tracing 2026-06-25 22:26:08 +03:00
b27d6ad836 chore: remove redundant express dependency and fix docs
Some checks failed
CI / ci (pull_request) Failing after 2m58s
CI / ci (push) Failing after 2m53s
2026-06-25 22:13:11 +03:00
53bab79c5f docs: mark all tasks complete in backend-architecture-refactor task list 2026-06-25 22:01:23 +03:00
0e7ecbb1ef docs: sync backend docs with refactored MOEX, health envelope, and operations/sync endpoint 2026-06-25 22:00:44 +03:00
b87ed761ed fix: preserve cachedAt metadata on cache hits 2026-06-25 21:58:05 +03:00
fe938b2706 refactor: localize T-Bank gRPC as any casts behind typed facade methods 2026-06-25 21:55:23 +03:00
af0c93fd34 fix: harden portfolio DTO validation for quantity and date fields 2026-06-25 21:51:08 +03:00
db28f46481 feat: add production config hardening for JWT secrets and CORS origins 2026-06-25 21:50:07 +03:00
0e8f65c457 fix: mask internal Error.message in unhandled 500 responses 2026-06-25 21:44:35 +03:00
120db3c2ab docs: add backend-architecture-refactor SDD artifacts and update epic/roadmap/inbox 2026-06-25 21:41:57 +03:00
58ddb10a92 docs: update inbox and roadmap with completed backend architecture improvements
Some checks failed
CI / ci (pull_request) Failing after 2m56s
CI / ci (push) Failing after 2m54s
2026-06-25 21:05:01 +03:00
4ed6e0ce20 docs: mark all tasks as completed in moex-client-split tasks.md 2026-06-25 20:54:06 +03:00
75fead68b8 refactor: split MoexClientService into domain-specific clients
- MoexHttpClient: infrastructure (axios, rate limiter, circuit breaker)
- MoexSecuritiesClient: search and security descriptions
- MoexMarketDataClient: share/bond market data and batch queries
- MoexCandlesClient: candle data
- MoexHistoryClient: share/bond history
- MoexDividendsClient: dividend data
- Removed @Global() from MoexClientModule
- Updated all 7 consumers with explicit DI
- All 141 tests passing
2026-06-25 20:49:17 +03:00
d2457d13af docs: add ADR-020 and feature docs for MoexClientService split 2026-06-25 20:42:28 +03:00
238836c850 refactor(backend): connect RequestLoggingMiddleware through DI
- AppModule implements NestModule with configure() for middleware
- Remove manual middleware instantiation from main.ts
- 120 tests pass, build succeeds
2026-06-25 20:37:10 +03:00
6e8efd2b80 feat(backend): improve health check with dependency probes 2026-06-25 20:34:37 +03:00
9f85dc5dde refactor(backend): introduce domain exception hierarchy
- Add DomainException base class extending HttpException
- Add EntityNotFoundException, PortfolioAccessDeniedException,
  MoexApiException, TBankApiException, TBankNotConfiguredException
- Update HttpExceptionFilter with unhandled error logging
- Replace generic NestJS exceptions in services with domain exceptions
- Update all affected tests
- 117 tests pass, build succeeds
2026-06-25 20:30:45 +03:00
3b919ecdc6 perf(backend): add dedicated screenerTtl config for screener caching
- Add CACHE_SCREENER_TTL env var (default 900s) to configuration
- Move screener from marketDataTtl to dedicated screenerTtl
- Add test verifying cache key prefix, parts, and TTL config key
- 117 tests pass, build succeeds
2026-06-25 20:25:53 +03:00
ccb1082535 refactor(backend): unify envelope DTOs and fix shares/bonds inconsistency
- Replace 4 duplicate meta DTOs (AuthResponseMetaDto, PortfolioResponseMetaDto,
  BrokerResponseMetaDto, ScreenerResponseMetaDto) with shared ApiResponseMeta
- Wrap shares getShare() in ApiEnvelopePayload (was raw object, unlike bonds)
- Remove unnecessary CacheModule import from securities module
- Update portfolio controller nullDataEnvelopeSchema to use shared ApiResponseMeta
- All 116 tests pass
2026-06-25 20:20:59 +03:00
8d6410b37b docs: mark pagination-loading-overlay and broker-account-analytics as implemented
All checks were successful
CI / ci (push) Successful in 13m33s
2026-06-25 06:44:31 +03:00
1fc7386568 Merge branch 'codex/api-envelope-contract'
All checks were successful
CI / ci (push) Successful in 13m12s
2026-06-25 06:15:38 +03:00
e69f183372 feat: finalize api-envelope-contract — tests, frontend simplify, contract tests, docs 2026-06-25 06:15:26 +03:00
b092caf8d6 feat: migrate services to ApiEnvelopePayload, controllers to plain returns 2026-06-24 19:39:30 +03:00
3a89cef76c feat: add ApiEnvelopePayload carrier, update TransformInterceptor to handle it 2026-06-24 19:36:28 +03:00
659be4636c docs: mark portfolio-analytics and quality-gate-contract-docs as completed in spec/plan
All checks were successful
CI / ci (pull_request) Successful in 12m44s
CI / ci (push) Successful in 14m21s
2026-06-24 19:06:24 +03:00
de776f477c docs: update roadmap — mark portfolio-analytics and quality-gate-contract-docs as completed 2026-06-24 19:04:28 +03:00
194a8be3e4 fix: remove invalid vitest workspace config, fix test:storybook script
vitest v4 removed defineWorkspace API, causing CI failure.
No .stories.test.* files exist, so test:storybook is a no-op.
2026-06-24 19:00:37 +03:00
95e9e7f71f feat: complete portfolio analytics Phases 2-3 and sync OpenAPI artifacts
- Phase 2: dividend income — batch MOEX dividend fetching with buyDate filtering, UI cards
- Phase 3: target allocation — backend targets parsing + deviation calc, frontend inputs + display
- Add openapi-artifacts.spec.ts for checked-in contract verification
- Regenerate frontend types from Swagger (auth/screener/portfolio paths)
2026-06-24 18:53:46 +03:00
ba0a4cbfef docs: mark broker-operations-ui-improvements and broker-positions-pagination as completed
Some checks failed
CI / ci (pull_request) Failing after 13m15s
CI / ci (push) Failing after 12m58s
2026-06-24 17:55:22 +03:00
f2fe6a4829 chore: untrack graphify-out generated artifacts
Some checks failed
CI / ci (push) Has been cancelled
CI / ci (pull_request) Failing after 14m29s
2026-06-24 17:49:40 +03:00