Browse Source

Fee and unit price in base currency removed from activity

pull/4486/head
csehatt741 7 days ago
committed by Attila Cseh
parent
commit
34e24eba9a
  1. 14
      apps/api/src/app/import/import.service.ts
  2. 2
      apps/api/src/app/order/interfaces/activities.interface.ts
  3. 14
      apps/api/src/app/order/order.service.ts

14
apps/api/src/app/import/import.service.ts

@ -121,7 +121,6 @@ export class ImportService {
currency: undefined,
createdAt: undefined,
fee: 0,
feeInBaseCurrency: 0,
feeInSymbolCurrency: 0,
id: assetProfile.id,
isDraft: false,
@ -129,13 +128,6 @@ export class ImportService {
symbolProfileId: assetProfile.id,
type: 'DIVIDEND',
unitPrice: marketPrice,
unitPriceInBaseCurrency:
await this.exchangeRateDataService.toCurrencyAtDate(
marketPrice,
assetProfile.currency,
userCurrency,
date
),
unitPriceInSymbolCurrency: marketPrice,
updatedAt: undefined,
userId: Account?.userId,
@ -448,12 +440,6 @@ export class ImportService {
...order,
error,
value,
feeInBaseCurrency: await this.exchangeRateDataService.toCurrencyAtDate(
fee,
assetProfile.currency,
userCurrency,
date
),
// @ts-ignore
SymbolProfile: assetProfile,
valueInBaseCurrency:

2
apps/api/src/app/order/interfaces/activities.interface.ts

@ -11,11 +11,9 @@ export interface Activities {
export interface Activity extends Order {
Account?: AccountWithPlatform;
error?: ActivityError;
feeInBaseCurrency: number;
feeInSymbolCurrency: number;
SymbolProfile?: EnhancedSymbolProfile;
tags?: Tag[];
unitPriceInBaseCurrency: number;
unitPriceInSymbolCurrency: number;
updateAccountBalance?: boolean;
value: number;

14
apps/api/src/app/order/order.service.ts

@ -534,13 +534,6 @@ export class OrderService {
return {
...order,
value,
feeInBaseCurrency:
await this.exchangeRateDataService.toCurrencyAtDate(
order.fee,
order.currency ?? order.SymbolProfile.currency,
userCurrency,
order.date
),
feeInSymbolCurrency:
await this.exchangeRateDataService.toCurrencyAtDate(
order.fee,
@ -549,13 +542,6 @@ export class OrderService {
order.date
),
SymbolProfile: assetProfile,
unitPriceInBaseCurrency:
await this.exchangeRateDataService.toCurrencyAtDate(
order.unitPrice,
order.currency ?? order.SymbolProfile.currency,
userCurrency,
order.date
),
unitPriceInSymbolCurrency:
await this.exchangeRateDataService.toCurrencyAtDate(
order.unitPrice,

Loading…
Cancel
Save