Skip to content

[REFACTOR]: use NGNMarket ETF endpoint for ETF ticker resolution and validation#50

Merged
aybruhm merged 6 commits into
mainfrom
feat/ngnmarket-etf-endpoint
Jun 14, 2026
Merged

[REFACTOR]: use NGNMarket ETF endpoint for ETF ticker resolution and validation#50
aybruhm merged 6 commits into
mainfrom
feat/ngnmarket-etf-endpoint

Conversation

@aybruhm

@aybruhm aybruhm commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds get_etf_detail() to NgnMarketAdapter which calls GET /etfs/{symbol} — the correct endpoint for ETF assets on NGNMarket (previously the index endpoint was always used as a fallback, even for ETFs)
  • get_asset_metadata() now accepts an optional asset_class param; when "etf", it hits the ETF endpoint first and falls back to the index endpoint if the ETF endpoint returns nothing
  • Threads asset_class through CsvImportInteractor._get_asset_metadata() so CSV imports route to the right endpoint based on the row's asset class column
  • The GET /assets/validate endpoint now accepts an optional asset_class query param and forwards it to NGNMarket, so ticker validation also uses the correct endpoint
  • Frontend validateTicker() passes the trade form's asset_class field when calling the validate endpoint

Test plan

  • Import a CSV with NGNMarket ETF rows and confirm assets resolve correctly via /etfs/{symbol}
  • Validate an NGNMarket ETF ticker from the trade form and confirm it returns supported: true
  • Validate an NGNMarket non-ETF ticker (index) and confirm it still uses the index endpoint
  • All unit and mocking tests pass (pytest tests/unit/adapters/outbound/market_data/test_ngnmarket_adapter.py tests/mocking/application/csv_import/)

aybruhm added 6 commits June 14, 2026 21:06
Pass the asset_class parameter when fetching metadata from ngnmarket
to improve matching accuracy for assets in that market.
FakeNgnMarketAdapter.get_asset_metadata

Update mock and tests to pass the new asset_class parameter, ensuring the CSV
import interaction correctly forwards asset class information to the NGN market
adapter.
@aybruhm
aybruhm merged commit 226e692 into main Jun 14, 2026
4 checks passed
@aybruhm
aybruhm deleted the feat/ngnmarket-etf-endpoint branch June 14, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant