Skip to content

feat: funds resource #12

Merged
MarketDataDev03 merged 6 commits into
mainfrom
12_funds_resource
Jun 18, 2026
Merged

feat: funds resource #12
MarketDataDev03 merged 6 commits into
mainfrom
12_funds_resource

Conversation

@MarketDataDev03

Copy link
Copy Markdown
Collaborator

feat: funds resource (client.funds())

Branch 12_funds_resource11_stocks_resource · 1 commit · 20 files

Adds the funds resource on the resource-architecture the options and stocks PRs established. This is the smallest PR of the series: funds expose a single endpointGET /v1/funds/candles/{resolution}/{symbol}/ — and no shared layer changed at all (transport, retry, rate-limit parsing, ParallelArrays, JsonResponseParser, MarketDataDates, RequestConfig are reused untouched).

Reviewer entry point: docs/FUNDS_REVIEW_GUIDE.md (~10 minutes, organized by flow). If you reviewed the stocks PR, the only genuinely new content is what funds deliberately don't have (below) and the parameter-surface choices.

What's included

  • Resource façade (FundsResource, reached via client.funds()): candles / candlesAsync (ADR-006 sync+async parity), universal-param setters (dateFormat/mode/limit/offset/columns) returning configured copies, asCsv() facet carrying the config, package-private asHtml() (built, hidden until the backend serves HTML). Package-private constructor (ADR-007).
  • Request types (com.marketdata.sdk.funds, @NullMarked): Builder-based FundCandlesRequest — window is date XOR from/to/countback (countback pairs with to, positive), plus exchange, country, adjustsplits, adjustdividends. FundResolution is a value type modeling daily-and-up only: DAILY/WEEKLY/MONTHLY/YEARLY constants, days/weeks/months/years(n) factories, of(String) passthrough.
  • Response model: FundCandlesResponse (thin AbstractMarketDataResponse<List<FundCandle>>); FundCandle is OHLC-only with @Nullable fields; wire columns t,o,h,l,c all required under the Option A contract (a requested column the API omits → ParseError, never a silent null); "s":"no_data" → empty values(); per-response rateLimit() (§8.2) for free from the base.
  • Wire decoding: per-resource SimpleModule (marketdata-funds) registered programmatically; t decodes through the tolerant parseDateOrTimestampField (date-only daily bars under dateformat=timestamp lift to America/New_York midnight).

Tests & demos

  • Unit: FundsResourceTest — 22 tests (750 total on the branch, all green): endpoint routing + every param translated, OHLC decoding with market-zone timestamps, date-only t tolerance, no_data/error envelopes, columns projection + both Option A failure modes, strict-by-default missing column, CSV/HTML facets, per-response rate-limit snapshot, request/resolution validation, and the no-chunking proof.
  • Integration: FundsIntegrationTest (VFINX, shape assertions; from/to window + to+countback), gated by MARKETDATA_RUN_INTEGRATION_TESTS=true.
  • Demo: FundsApp (make demo-funds / ./gradlew runFunds) scripts the mock server through every scenario — run green end-to-end. QuickstartApp gains its funds section (the // add when client.funds() lands placeholder is now live).

Docs

  • docs/FUNDS_REVIEW_GUIDE.md — the review walkthrough.
  • CHANGELOG.md — funds entry under Unreleased/Added.
  • CLAUDE.md — funds moved from "deliberately deferred" to wired; only markets remains.

Known tracked debt (do not review as accidental)

The universal-param fluent setters and the rowsDeserializer/validateRequestedColumns pair are copied per resource by design for now; the agreed self-typed abstract-base dedup refactor is scheduled before v1, after markets lands.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

The author of this PR, MarketDataDev03, is not an activated member of this organization on Codecov.
Please activate this user on Codecov to display this PR comment.
Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.
Please don't hesitate to email us at support@codecov.io with any questions.

@MarketDataDev03 MarketDataDev03 self-assigned this Jun 11, 2026
@MarketDataDev03 MarketDataDev03 marked this pull request as ready for review June 11, 2026 11:53

@MarketDataDev01 MarketDataDev01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove exchange, country, adjustsplits, adjustdividends. They are not handled by the api

@MarketDataDev03 MarketDataDev03 merged commit 4e31afb into main Jun 18, 2026
5 checks passed
@MarketDataDev03 MarketDataDev03 deleted the 12_funds_resource branch June 18, 2026 14:51
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.

2 participants