refactor!: support RUB only (WealthLedger/main#55)
Filter non-RUB data at ingest, collapse per-currency collections into single RUB Money, drop currency from TbankPortfolioValuePoint, remove NON_RUB_ACTIVITY and screener currency filter. BREAKING CHANGE: per-currency API fields replaced with single RUB Money; stock screener currency param removed.
This commit is contained in:
@@ -30,12 +30,20 @@ describe('performance cash flows', () => {
|
||||
expect(result.flows).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('detects non-RUB operations and unvalued securities transfers', () => {
|
||||
it('detects unvalued securities transfers', () => {
|
||||
const result = readPerformanceOperations([
|
||||
op('A', 'OPERATION_TYPE_INPUT', '2025-01-01T15:00:00Z', '10', 'usd'),
|
||||
op('B', 'OPERATION_TYPE_INPUT_SECURITIES', '2025-01-01T15:00:00Z', '0'),
|
||||
]);
|
||||
expect([...result.nonRubAccounts]).toEqual(['A']);
|
||||
expect([...result.unvaluedAccounts]).toEqual(['B']);
|
||||
});
|
||||
|
||||
it('skips non-RUB cash movements read back from persisted payloads', () => {
|
||||
const result = readPerformanceOperations([
|
||||
op('A', 'OPERATION_TYPE_INPUT', '2025-01-01T15:00:00Z', '100'),
|
||||
op('A', 'OPERATION_TYPE_INPUT', '2025-02-01T15:00:00Z', '21', 'usd'),
|
||||
]);
|
||||
expect(result.flows).toHaveLength(1);
|
||||
expect(formatDecimal(sumFlows(result.flows))).toBe('100');
|
||||
expect([...result.missingAmountAccounts]).toEqual(['A']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user