From df23b0930301c18511093006567956a6cc920712 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:22:10 +0100 Subject: [PATCH] Fix import of activity with type FEE --- apps/api/src/app/import/import.service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 813d7cfd8..eb1b841c4 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -30,7 +30,7 @@ import { Injectable } from '@nestjs/common'; import { DataSource, Prisma, SymbolProfile } from '@prisma/client'; import { Big } from 'big.js'; import { endOfToday, format, isAfter, isSameSecond, parseISO } from 'date-fns'; -import { uniqBy } from 'lodash'; +import { isNumber, uniqBy } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; @Injectable() @@ -328,8 +328,7 @@ export class ImportService { date ); - // unitPrice can be 0 if it's a fee record - if (unitPrice === undefined) { + if (!isNumber(unitPrice)) { throw new Error( `activities.${index} historical exchange rate at ${format( date,