Skip to content

feat(studio): name the deflation basis of a constant-price unit - #134

Open
jm-rivera wants to merge 1 commit into
devfrom
feat/unit-deflation-basis
Open

jm-rivera wants to merge 1 commit into
devfrom
feat/unit-deflation-basis

Conversation

@jm-rivera

Copy link
Copy Markdown
Contributor

Studio names whose prices deflated a constant-price amount, so a DAC and an IDS amount in one currency and base year read as different measures. A unit without deflation_basis renders as before, so this merges safely before or after the dfo-apis change that adds the member.

Part of DevelopmentFinanceObservatory/apis#43

Changes

  • studio/payload.ts and studio/description.ts: a structured unit carries an optional deflation_basis (donor, recipient or national), read on plain units and on each side of a composed unit.
  • studio/statFace.ts: the stat caption reads "constant 2024 prices, donor prices", the wording dfo-apis' analysis engine uses.
  • studio/widgets.ts: table rows and the chart unit read "NGN (constant 2024, donor prices)".
  • studio/descriptionBlocks.ts: the More Info unit row names the basis, and a donor-price amount over a recipient-price amount in one currency reads as two units, where it read as a ratio.

Notes for reviewers

The Search unit picker and token notes read UnitConversion from the vendored client (vendor/developmentfinance-client-0.1.0.tgz, built from spec-kit 4ad7739), which has no deflation_basis. They show the basis once the client is rebuilt from the spec-kit release that recaptures dfo-apis' served contract. Axis titles and chips show no price basis today, so they show no deflation basis either.

Testing: pnpm typecheck, eslint on the touched files, and node --test over src/lib/studio and src/lib/search (1,740 passed).

A converted constant-price unit may carry deflation_basis (donor,
recipient or national). Studio reads it on plain and composed units and
shows it in the stat caption, table and chart unit text, and More Info.

This branch has not been deployed

No deployments
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