Browse Source

Improve type safety

pull/8467/head
Thomas Kaul 3 days ago
parent
commit
2b2533e63f
  1. 9
      apps/api/src/services/import/import.service.ts

9
apps/api/src/services/import/import.service.ts

@ -194,7 +194,7 @@ export class ImportService {
feeInBaseCurrency: 0, feeInBaseCurrency: 0,
id: assetProfile.id, id: assetProfile.id,
symbolProfileId: assetProfile.id, symbolProfileId: assetProfile.id,
type: 'DIVIDEND' as ActivityType, type: 'DIVIDEND',
unitPrice: marketPrice, unitPrice: marketPrice,
unitPriceInAssetProfileCurrency: marketPrice, unitPriceInAssetProfileCurrency: marketPrice,
updatedAt: new Date(), updatedAt: new Date(),
@ -830,7 +830,7 @@ export class ImportService {
} }
) )
.forEach(({ id, name }) => { .forEach(({ id, name }) => {
accounts.push({ id, name: name ?? '' }); accounts.push({ id, name });
}); });
} }
@ -866,7 +866,7 @@ export class ImportService {
); );
}) })
.forEach(({ id, name }) => { .forEach(({ id, name }) => {
tags.push({ id, name: name ?? '' }); tags.push({ id, name });
}); });
} }
@ -1165,6 +1165,9 @@ export class ImportService {
type, type,
unitPrice, unitPrice,
assetProfile: { assetProfile: {
// The data source of each activity is already set in import(). The
// fallback only satisfies the type, since MANUAL is not the default
// data source of investment activities.
dataSource: dataSource ?? DataSource.MANUAL, dataSource: dataSource ?? DataSource.MANUAL,
symbol symbol
}, },

Loading…
Cancel
Save