Browse Source

Remove assetProfileId and update symbol

pull/5165/head
Thomas Kaul 4 days ago
parent
commit
dc597cd0ac
  1. 7
      apps/api/src/app/export/export.service.ts
  2. 11
      libs/common/src/lib/interfaces/export.interface.ts

7
apps/api/src/app/export/export.service.ts

@ -226,7 +226,6 @@ export class ExportService {
unitPrice
}) => {
return {
assetProfileId: SymbolProfile.userId ? SymbolProfile.id : undefined,
accountId,
comment,
fee,
@ -237,11 +236,7 @@ export class ExportService {
currency: currency ?? SymbolProfile.currency,
dataSource: SymbolProfile.dataSource,
date: date.toISOString(),
symbol:
['FEE', 'INTEREST', 'LIABILITY'].includes(type) ||
(SymbolProfile.dataSource === 'MANUAL' && type === 'BUY')
? SymbolProfile.name
: SymbolProfile.symbol,
symbol: SymbolProfile.symbol,
tags: currentTags.map(({ id: tagId }) => {
return tagId;
})

11
libs/common/src/lib/interfaces/export.interface.ts

@ -1,4 +1,11 @@
import { Account, Order, Platform, SymbolProfile, Tag } from '@prisma/client';
import {
Account,
DataSource,
Order,
Platform,
SymbolProfile,
Tag
} from '@prisma/client';
import { AccountBalance } from './account-balance.interface';
@ -15,7 +22,7 @@ export interface Export {
| 'symbolProfileId'
| 'updatedAt'
| 'userId'
> & { assetProfileId?: string; date: string; symbol: string })[];
> & { dataSource: DataSource; date: string; symbol: string })[];
assetProfiles: (Omit<SymbolProfile, 'createdAt' | 'updatedAt' | 'userId'> & {
marketData: { date: string; marketPrice: number }[];
})[];

Loading…
Cancel
Save