81 Commits

Author SHA1 Message Date
ff0e11b303 feat(tbank): add totalFees/totalTaxesPaid, portfolio history endpoint, and category filtering
- Add totalFees and totalTaxesPaid to BrokerAnalyticsDto and service
- Add GET /accounts/:accountId/portfolio/history endpoint with estimated v1 read-model
- Add categories query param to operations endpoint for filtering by category
- Update tests and module registration
2026-06-27 19:30:32 +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
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
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
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
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
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
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
3dfcf5aaa8 feat: complete broker account analytics with sync button, tests, and state filter
Some checks failed
CI / ci (pull_request) Failing after 3m39s
CI / ci (push) Failing after 3m10s
- Add state filter (EXECUTED/null) to analytics query (spec compliance)
- Add service unit tests (11 tests) and controller test
- Add sync button to operations page with mutation hook
- Regenerate frontend types via codegen
- Update tasks.md marking all items complete

Backend: 114 tests, Frontend: 116 tests — all pass
2026-06-24 11:29:09 +03:00
abf3676ba1 fix(backend): export BrokerAnalyticsService from TBankModule 2026-06-24 09:42:35 +03:00
5cd56b239a feat: wire up broker analytics endpoint, cache config, and module registration
- Add analytics cache key to TBANK_CACHE_KEYS
- Add tbankAnalyticsTtl to cache configuration
- Register and export BrokerAnalyticsService in TBankModule
- Add BrokerAnalyticsEnvelopeDto to broker envelope DTOs
- Add GET /accounts/:accountId/analytics endpoint to TBankController
- Fix TBankController spec to pass new constructor dependency
2026-06-24 09:41:57 +03:00
5184d34262 fix(backend): handle malformed payment JSON in analytics service 2026-06-24 09:40:41 +03:00
61e3398c71 feat(backend): add broker analytics DTO and service 2026-06-24 09:38:25 +03:00
063e80c375 feat(openapi): unify frontend types with codegen, fix backend nullable DTOs
- Fix ApiResponseMeta nullable property (add type: String) to prevent Record<string, never> in codegen
- Fix broker events DTO nullable fields with proper type annotations
- Regenerate frontend types.ts from updated Swagger schema
- Replace all hand-written types in responses.ts with codegen aliases
- Remove stale BrokerPortfolioEvent/BrokerEventsSummary/BrokerEventsData interfaces
- Fix codegen output path in frontend package.json
2026-06-23 19:58:23 +03:00
5b794c0419 feat: add Swagger response DTOs for all missing endpoints
- Shares: ShareEnvelopeDto, ShareMarketDataEnvelopeDto, DividendsEnvelopeDto,
  ShareHistoryEnvelopeDto, DividendItemDto, HistoryItemDto
- Bonds: BondEnvelopeDto, BondMarketDataEnvelopeDto, BondHistoryEnvelopeDto,
  BondHistoryItemDto
- Candles: CandleItemDto, CandleEnvelopeDto
- Securities: SearchResultItemDto, SearchEnvelopeDto
- Health: HealthResponseDto, HealthEnvelopeDto
- Add @ApiOkResponse decorators to all previously undocumented endpoints
- Reuse ApiResponseMeta from common for all envelope DTOs
2026-06-23 07:17:30 +03:00
f7dc338719 feat: add actual payouts and filter-as-draft UX to broker events calendar
Some checks failed
CI / ci (pull_request) Failing after 3m9s
CI / ci (push) Failing after 3m9s
- Backend: actual events from T-Bank operations, types filter, split forecast/actual summary
- Frontend: draft/applied filters with multi-select types, status column (Факт/Прогноз), green actual amounts
- Docs: update spec, plan, tasks
2026-06-22 21:48:03 +03:00
c71ba090ad test: remove unused test
Some checks failed
CI / ci (push) Failing after 3m15s
2026-06-22 20:21:20 +03:00
595d059151 feat: add broker events calendar and payout projections for T-Bank accounts
Some checks failed
CI / ci (push) Failing after 3m1s
2026-06-22 06:41:37 +03:00
a95308762f docs: improve AGENTS.md and README.md
All checks were successful
CI / ci (push) Successful in 3m20s
2026-06-19 13:32:49 +03:00
8aea56cbbf feat: expose broker position counts 2026-06-18 23:15:32 +03:00
feaff2103e perf(broker): parallel instrument name loading with per-service rate limit queues
- Split single p-queue (5 req/s) into 3 isolated queues:
  operations (5/s), instruments (20/s), users (5/s)
- Removed dead instruments param from mapBrokerPortfolio
- portfolio/positions endpoints share raw GetPortfolio cache
- Docs: T_BANK_INSTRUMENTS_RATE_LIMIT, CACHE_TBANK_POSITIONS_TTL,
  rate limiting section in tbank-invest.md
2026-06-18 06:34:55 +03:00
49ee364856 feat(broker): per-type positions pagination with independent tables
All checks were successful
CI / lint (pull_request) Successful in 2m9s
CI / test (pull_request) Successful in 1m56s
CI / build (pull_request) Successful in 2m6s
CI / lint (push) Successful in 1m56s
CI / test (push) Successful in 1m55s
CI / build (push) Successful in 2m19s
- Add type query param to GET /accounts/:accountId/positions endpoint
- Backend filters T-Bank portfolio positions by instrument type before pagination
- Each instrument type (share, bond, etf, fund) has its own frontend table with
  independent cursor-based pagination and skeleton loading
- Groups with no positions are automatically hidden
- Cache key includes type for correct per-type caching
- Remove centralized positions pagination state from BrokerAccountDetailPage
- 94 backend tests / 112 frontend tests pass
2026-06-18 06:02:54 +03:00
4b87eccba4 test(tbank): update portfolio tests, add getPositions tests, fix operation fixture name 2026-06-17 14:41:32 +03:00
8b202ef7d3 feat(tbank): add GET /positions endpoint with cursor pagination 2026-06-17 14:39:30 +03:00
6b3bdd2aec fix(tbank): include cursor/limit in positions cache key, add tbankPositionsTtl config 2026-06-17 14:38:51 +03:00
bb7fef8deb feat(tbank): add getPositions() method to BrokerPortfolioService 2026-06-17 14:36:32 +03:00
05f1e792c5 feat(tbank): extract mapBrokerPosition, add mapBrokerPositionsPage, add name to operation 2026-06-17 14:34:02 +03:00
953c7c29a6 feat(tbank): add positions page types/DTOs and operation name field 2026-06-17 14:30:48 +03:00
a8715258ca fix: avoid stale tbank grpc deadlines
All checks were successful
CI / lint (pull_request) Successful in 2m15s
CI / test (pull_request) Successful in 2m2s
CI / build (pull_request) Successful in 2m7s
CI / lint (push) Successful in 2m2s
CI / test (push) Successful in 2m10s
CI / build (push) Successful in 2m7s
2026-06-17 12:08:48 +03:00
8c2a6c9e3c fix: trust tbank grpc root certificate
All checks were successful
CI / lint (pull_request) Successful in 2m11s
CI / test (pull_request) Successful in 1m58s
CI / build (pull_request) Successful in 2m3s
CI / lint (push) Successful in 1m57s
CI / test (push) Successful in 2m4s
CI / build (push) Successful in 2m8s
2026-06-17 07:39:37 +03:00
ea916dfec9 fix: restrict and expose tbank broker sync 2026-06-17 06:57:49 +03:00
3fe4e7a4ec fix: harden tbank operation sync 2026-06-17 06:47:18 +03:00
6e30177294 feat: persist tbank broker operations 2026-06-17 06:44:45 +03:00
b848d256d1 fix: load tbank proto contracts at runtime 2026-06-16 22:54:21 +03:00
d01d2b9f7f feat: expose tbank broker operations 2026-06-16 22:46:19 +03:00
bd6b2589c0 feat: expose tbank broker portfolio 2026-06-16 22:43:40 +03:00
ddeab01b9e feat: expose tbank broker accounts 2026-06-16 22:34:12 +03:00
4ef2f8d05e feat: add tbank grpc client service 2026-06-16 22:23:33 +03:00
825095106c feat: add tbank domain mappers 2026-06-16 22:20:01 +03:00
7a8bc7c90a feat: configure tbank integration 2026-06-16 22:15:31 +03:00