feat(portfolio): store and publish instrument sector and issuer (WealthLedger/main#48) (#148)
Backend verify / commits (push) Skipped
Backend verify / security (push) Successful in 1m4s
Backend verify / verify (push) Failing after 7m15s

This commit was merged in pull request #148.
This commit is contained in:
2026-11-01 19:13:32 +03:00
parent 5e84e1e5f1
commit 17432dfee3
16 changed files with 529 additions and 11 deletions
@@ -132,6 +132,7 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
// upstream call inside one. The attempt outcome is derived from durable
// step rows by the repository, never from walk-local state.
private async walk(attempt: TbankSyncAttempt) {
const walkStartedAt = new Date();
this.active.add(attempt.attemptId);
try {
const { userId, revision } = attempt;
@@ -155,6 +156,7 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
accounts,
dispatch,
dispatchProblems,
walkStartedAt,
);
await this.waitWorks(userId, children.map((child) => child.id));
for (const account of accounts) {
@@ -239,6 +241,7 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
accounts: Accounts,
dispatch: DispatchStep,
dispatchProblems: HourlySection[],
walkStartedAt: Date,
) {
for (const account of accounts) {
await this.dispatchPortfolio(
@@ -247,6 +250,7 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
account.accountId,
dispatch,
dispatchProblems,
walkStartedAt,
);
}
for (const account of accounts) {
@@ -274,10 +278,11 @@ export class TbankHourlyScheduler implements OnModuleDestroy, OnModuleInit {
accountId: string,
dispatch: DispatchStep,
dispatchProblems: HourlySection[],
walkStartedAt: Date,
) {
try {
const work = await this.withBound(
this.portfolio.request(userId, revision, accountId, true),
this.portfolio.request(userId, revision, accountId, true, walkStartedAt),
);
if (work && work !== BOUND_EXPIRED) {
await dispatch({ accountId, id: work.id, section: 'portfolio' });