feat(portfolio): store and publish instrument sector and issuer (WealthLedger/main#48) (#148)
This commit was merged in pull request #148.
This commit is contained in:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user