fix: surface durable hourly attempt in accounts and income meta (WealthLedger/backend#58)
This commit was merged in pull request #92.
This commit is contained in:
@@ -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) => ({
|
||||
|
||||
Reference in New Issue
Block a user