refactor!: support RUB only (WealthLedger/main#55)
Filter non-RUB data at ingest and collapse per-currency collections into a single RUB Money. Drop currency from TbankPortfolioValuePoint, remove NON_RUB_ACTIVITY and the screener currency filter. BREAKING CHANGE: per-currency API fields replaced with single RUB Money.
This commit is contained in:
+3
-2
@@ -70,16 +70,17 @@ export function metrics(
|
||||
// eslint-disable-next-line security/detect-object-injection -- Keys come from the fixed metric selection declared above.
|
||||
const value = values[key];
|
||||
const currency = values.currency?.toUpperCase() || null;
|
||||
const rub = currency === 'RUB';
|
||||
return typeof value === 'number' &&
|
||||
Number.isFinite(value) &&
|
||||
(unit !== 'money' || currency)
|
||||
(unit !== 'money' || rub)
|
||||
? [
|
||||
{
|
||||
key,
|
||||
value,
|
||||
unit,
|
||||
period,
|
||||
currency: unit === 'money' ? currency : null,
|
||||
currency: unit === 'money' ? 'RUB' : null,
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
Reference in New Issue
Block a user