Skip to content

Commit

Permalink
Fix the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dickwolff committed Jan 19, 2025
1 parent 9d5b38f commit 33fc9ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/converters/revolutConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class RevolutConverter extends AbstractConverter {
try {
security = await this.securityService.getSecurity(
null,
record.ticker,
record.ticker ?? `${record.symbol}-${record.currency}`,
null,
record.currency,
this.progress);
Expand All @@ -188,19 +188,19 @@ export class RevolutConverter extends AbstractConverter {

// Log whenever there was no match found.
if (!security) {
this.progress.log(`[i] No result found for ${record.type} action for ${record.ticker} with currency ${record.currency}! Please add this manually..\n`);
this.progress.log(`[i] No result found for ${record.type} action for ${record.ticker ?? record.symbol} with currency ${record.currency}! Please add this manually..\n`);
bar1.increment();
continue;
}

let quantity, unitPrice;

if (record.type === "dividend") {
quantity = 1;
unitPrice = Math.abs(record.totalAmount);
quantity = record.quantity ?? 1;
unitPrice = Math.abs(record.totalAmount ?? 1);
} else {
quantity = record.quantity;
unitPrice = record.pricePerShare;
unitPrice = record.pricePerShare ?? record.price;
}

// Add record to export.
Expand Down Expand Up @@ -243,4 +243,4 @@ export class RevolutConverter extends AbstractConverter {
return "EUR";
}
}
}
}
2 changes: 1 addition & 1 deletion src/testing/data/yahooFinanceQuoteSummaryResults.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/testing/data/yahooFinanceSearchResults.json

Large diffs are not rendered by default.

0 comments on commit 33fc9ad

Please sign in to comment.