Browse Source

Remove assetProfileId and update symbol

pull/5165/head
Thomas Kaul 5 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 unitPrice
}) => { }) => {
return { return {
assetProfileId: SymbolProfile.userId ? SymbolProfile.id : undefined,
accountId, accountId,
comment, comment,
fee, fee,
@ -237,11 +236,7 @@ export class ExportService {
currency: currency ?? SymbolProfile.currency, currency: currency ?? SymbolProfile.currency,
dataSource: SymbolProfile.dataSource, dataSource: SymbolProfile.dataSource,
date: date.toISOString(), date: date.toISOString(),
symbol: symbol: SymbolProfile.symbol,
['FEE', 'INTEREST', 'LIABILITY'].includes(type) ||
(SymbolProfile.dataSource === 'MANUAL' && type === 'BUY')
? SymbolProfile.name
: SymbolProfile.symbol,
tags: currentTags.map(({ id: tagId }) => { tags: currentTags.map(({ id: tagId }) => {
return 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'; import { AccountBalance } from './account-balance.interface';
@ -15,7 +22,7 @@ export interface Export {
| 'symbolProfileId' | 'symbolProfileId'
| 'updatedAt' | 'updatedAt'
| 'userId' | 'userId'
> & { assetProfileId?: string; date: string; symbol: string })[]; > & { dataSource: DataSource; date: string; symbol: string })[];
assetProfiles: (Omit<SymbolProfile, 'createdAt' | 'updatedAt' | 'userId'> & { assetProfiles: (Omit<SymbolProfile, 'createdAt' | 'updatedAt' | 'userId'> & {
marketData: { date: string; marketPrice: number }[]; marketData: { date: string; marketPrice: number }[];
})[]; })[];

Loading…
Cancel
Save