API Reference alternera_resources_finance v#0.9.0

Copy Markdown View Source

Modules

The finance reference data package: currencies, units of measure and VAT codes.

The units of measure's Convert: an amount in one unit, in another of the same base unit. It reads the two units in the caller's tenant, as the caller, and changes nothing.

A currency, identified by its ISO 4217 code.

An exchange rate on a day: one unit of the base currency is rate units of the quote currency. A record per pair and day, so the history stays: a new day's rates are new records.

The exchange rates' calculations, generic actions of Finance.ExchangeRate that read as the caller and change nothing. The REST API serves each as GET …/exchange_rate/<action>?… and MCP as the calculation of that name of finance.exchange_rate

ExchangeRate.record_rates: one day's rates against one base currency, each stored as the pair's record for the day (created, or updated when the day already has one), as the caller and in the caller's tenant.

A VAT code's Active column: a badge that says Active or Inactive in words.

The units of measure's By base unit view: a column per base unit, its multiples below it with what one makes in the base unit. Each unit's Convert opens the package's Unit converter in the Workbench on that unit (UI.open(ctx, {:workbench, :converter, code})), where it stays open beside whatever page the reader goes to next.

The VAT codes' By country view: a card per country, its codes inside from the highest rate down, each with its rate and whether it is offered. It shows the records the search matches (records), as every view does, and reads nothing of its own.

A unit of measure's Conversions panel: what one of the unit makes in every other unit of the same base unit, read with the viewer's context.

The exchange rates' Convert button: runs ExchangeRate.convert with the viewer's tenant and actor and says the result in words, with the rate and the day it is from.

The finance package's Unit converter, a Workbench item (workbench_item :converter in the domain's alternera_ui): an amount in one unit, shown in every other unit of the same base unit as the reader types. It stays open beside whatever page the reader is on.

The finance package's Overview page: how many records each resource holds, and the VAT codes of one country, chosen with buttons kept in the page's URL (put_params/2). Every read goes through Alternera.Resource.UI.Records with the viewer's context.

The exchange rates' History view: a card per currency pair with a line chart of its rate over the chosen period (30 days, 90 days, a year or everything kept), and beside it in words the newest rate, its day, the change over the period and the period's low and high.

The VAT codes' Rates view: a bar per code, its length the rate against the highest rate shown, highest first. Plain HTML: a chart needs no script when it is a list of bars, and every bar says its rate in words beside it.

A unit of measure, optionally defined as a multiple of a base unit.

A VAT code: a tax rate that applies in a country.