refactor!: support RUB only (WealthLedger/main#55) (#204)
BREAKING CHANGE: per-currency API fields replaced with single RUB Money.
This commit was merged in pull request #204.
This commit is contained in:
@@ -157,9 +157,9 @@ export class MoexClient {
|
||||
for (const row of coupons) {
|
||||
const date = text(row.coupondate);
|
||||
const value = numberText(row.value);
|
||||
const currency = currencyText(row.faceunit);
|
||||
if (date && value && currency) {
|
||||
events.push({ type: 'coupon', date, value, currency });
|
||||
// RUB-only: coupons in other currencies are filtered out at this ingest boundary.
|
||||
if (date && value && currencyText(row.faceunit) === 'RUB') {
|
||||
events.push({ type: 'coupon', date, value, currency: 'RUB' });
|
||||
}
|
||||
}
|
||||
for (const row of offers) {
|
||||
@@ -171,9 +171,8 @@ export class MoexClient {
|
||||
);
|
||||
const date = values.get('MATDATE');
|
||||
const value = numberText(values.get('FACEVALUE'));
|
||||
const currency = currencyText(values.get('FACEUNIT'));
|
||||
if (date && value && currency) {
|
||||
events.push({ type: 'maturity', date, value, currency });
|
||||
if (date && value && currencyText(values.get('FACEUNIT')) === 'RUB') {
|
||||
events.push({ type: 'maturity', date, value, currency: 'RUB' });
|
||||
}
|
||||
return events;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user