Browse Source

Fix import of activity with type FEE

pull/4187/head
Thomas Kaul 7 months ago
parent
commit
df23b09303
  1. 5
      apps/api/src/app/import/import.service.ts

5
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 { DataSource, Prisma, SymbolProfile } from '@prisma/client';
import { Big } from 'big.js'; import { Big } from 'big.js';
import { endOfToday, format, isAfter, isSameSecond, parseISO } from 'date-fns'; import { endOfToday, format, isAfter, isSameSecond, parseISO } from 'date-fns';
import { uniqBy } from 'lodash'; import { isNumber, uniqBy } from 'lodash';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
@Injectable() @Injectable()
@ -328,8 +328,7 @@ export class ImportService {
date date
); );
// unitPrice can be 0 if it's a fee record if (!isNumber(unitPrice)) {
if (unitPrice === undefined) {
throw new Error( throw new Error(
`activities.${index} historical exchange rate at ${format( `activities.${index} historical exchange rate at ${format(
date, date,

Loading…
Cancel
Save