fix(investments): align roles and date contracts
Backend security / security (push) Successful in 9s
Backend verify / verify (push) Successful in 10m23s
Backend security / security (pull_request) Successful in 8s
Backend verify / verify (pull_request) Successful in 10m39s
Conventional commits / commits (pull_request) Successful in 29s

Identify income dependencies by role and document screen-specific dates.
Convert inclusive calendar days into half-open source ranges while
preserving operation timestamps and existing stored coverage.
This commit is contained in:
2026-09-27 11:38:13 +03:00
parent e4232138d0
commit 516e43203e
18 changed files with 500 additions and 74 deletions
+34
View File
@@ -497,4 +497,38 @@ describe('saved payout calendars and complete forecasts (SQLite HTTP)', () => {
await get(`brokerage-accounts/account/events?${query}`).expect(400);
expect(upstream.getDividends).not.toHaveBeenCalled();
});
it('uses UTC today for an end-only range and includes the entire leap day', async () => {
const today = new Date().toISOString().slice(0, 10);
await get('brokerage-accounts/account/events?to=2096-02-29').expect(200);
await settled();
expect(upstream.getDividends).toHaveBeenCalledWith(
'synthetic-owner',
shareUid,
today,
'2096-02-29',
);
upstream.getDividends.mockResolvedValue([
{
recordDate: {
seconds: String(Date.parse('2096-02-29T23:59:59Z') / 1000),
},
dividendNet: { units: '7', currency: 'rub' },
},
{
recordDate: time('2096-03-01'),
dividendNet: { units: '99', currency: 'rub' },
},
]);
const range = { from: '2096-02-29', to: '2096-02-29' };
await events(false, 'account', 'owner', range).expect(200);
await settled();
const result = (await events(true, 'account', 'owner', range).expect(200))
.body as UpcomingEventsResourceDto;
expect(result.data?.events).toHaveLength(1);
expect(result.data?.events[0]).toMatchObject({
date: '2096-02-29',
projectedAmount: { currency: 'RUB', value: '14' },
});
});
});