You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(web): stop reporting unreported CafeF ratio periods as zero
VCB and MBB showed EPS, BVPS, ROE and ROA as 0 on the stock page, and their
Financials tab charted a plunge to zero for those years.
The cause is in the source: CafeF returns a bucket for every period but fills
unreported ones with zeros across every ratio. VCB's 2025 and 2023 buckets carry
EPS, BVPS, ROE, ROA *and* P/E at 0 — impossible for a company with a share price.
We read only the newest bucket and passed its zeros straight through, and zero is
not null, so the `?? null` fallbacks never fired.
A bucket whose ratios are all zero is now treated as "not reported". The stats
grid asks for four buckets and uses the newest one CafeF actually filled in, and
labels it with that year (`EPS ’22`) so a lagging figure is not read as current.
The Financials tab drops those periods rather than charting them.
The test is per bucket rather than per metric on purpose: a genuine zero, such as
a debt-free company's Debt/Assets, still comes through.
Verified against the raw source — VCB's 2025 and 2023 buckets are 0/8 non-zero
and are the only ones dropped; FPT's every bucket is 8/8 non-zero and nothing is
dropped (its missing 2022 is absent from CafeF's response to begin with). VCB now
reads EPS 5,820 ₫, BVPS 28,660 ₫, ROE 22.04%, ROA 1.65% for 2022, and its annual
series runs 2017–2022 with no zero columns.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|`GET /api/financials/:ticker?period=annual`| Annual key metrics (EPS, BVPS, ROE, ROA, margins, P/E) from CafeF. Periods CafeF hasn't reported are omitted, not charted as zero|
0 commit comments