Skip to content

v2.0.0 — Stronger Stock Validation and Target Price Semantics

Choose a tag to compare

@programmishka programmishka released this 06 Sep 10:48
· 25 commits to main since this release

Version 2.0.0 improves the reliability of stock admission and Target Price calculations based on findings from real-world use of the production application.

Highlights

Canonical Stock Symbols

Stock-symbol input is now normalized before processing:

  • leading and trailing whitespace is removed;
  • symbols are automatically converted to uppercase;
  • common Yahoo-style symbols containing letters, numbers, dots, and hyphens are supported;
  • syntactically invalid symbols are rejected before contacting the market-data provider.

Examples:

aapl       → AAPL
sap.de     → SAP.DE
hexa-b.st  → HEXA-B.ST
0700.hk    → 0700.HK

Invalid syntax, unknown symbols, and market-data-provider failures are now represented as distinct error conditions.

Equity-Only Symbol Resolution

The Watchlist is intended for individually valued companies, so new symbols must now resolve to an equity before they can be added.

A new provider-neutral resolveSymbol() abstraction separates stock admission from ordinary market-data retrieval.

The current Yahoo Finance implementation accepts a symbol only when:

  • Yahoo resolves the exact normalized symbol; and
  • the instrument is classified as an equity.

Known non-equity instruments such as ETFs are therefore rejected even when Yahoo Finance recognizes their symbols.

The application remains independent of Yahoo-specific instrument metadata, allowing the provider implementation to evolve without changing the application layer.

Correct Handling of Unavailable Target Price Distance

Target Price distance now distinguishes between a real calculated zero and unavailable data.

Previously, missing or invalid market-price data could be represented as a numeric distance, including 0, and in one edge case could result in a misleading percentage being displayed.

The new semantics are:

Valid Price + Valid Target Price
→ calculated distance

Price == Target Price
→ 0%

Missing/invalid Price or Target Price
→ —

A stock whose distance cannot be calculated remains visible in the Watchlist but does not participate in savings allocation:

Distance to Target: —
Savings Amount:     €0

This preserves the existing investment-allocation behavior while making the displayed financial information semantically correct.

Quality

The V2 changes are covered across domain, application, API, client, and browser levels, including regression tests for the production issues that motivated the release.

The release retains the existing server-side financial calculations, Cloudflare deployment architecture, Yahoo Finance market-data integration, responsive SvelteKit UI, and permanent Playwright E2E suite.