fix: surface durable hourly attempt in accounts and income meta (WealthLedger/backend#58)
Backend verify / commits (push) Skipped
Backend verify / security (push) Successful in 17s
Backend verify / verify (push) Failing after 7m31s

This commit was merged in pull request #92.
This commit is contained in:
2026-10-14 18:00:20 +03:00
parent b90cedd580
commit 14bcb9da5f
6 changed files with 80 additions and 4 deletions
@@ -43,16 +43,17 @@ type HourlyAttempt = {
export function hourlyAttempt(
hourly: HourlyAttempt | null,
section: HourlySection['section'],
section: HourlySection['section'] | readonly HourlySection['section'][],
accountId?: string,
): InvestmentAttemptDto {
if (!hourly) {
return { state: 'none', startedAt: null, finishedAt: null, problems: [] };
}
const sections = Array.isArray(section) ? section : [section];
const problems = hourly.sections
.filter(
(entry) =>
entry.section === section &&
sections.includes(entry.section) &&
(accountId === undefined || entry.accountId === accountId),
)
.map((entry) => ({