|
|
@ -81,25 +81,34 @@ export class PublicService { |
|
|
}) |
|
|
}) |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
const { activities } = await this.activitiesService.getActivities({ |
|
|
|
|
|
filters, |
|
|
|
|
|
sortColumn: 'date', |
|
|
|
|
|
sortDirection: 'desc', |
|
|
|
|
|
take: 10, |
|
|
|
|
|
types: [ActivityType.BUY, ActivityType.SELL], |
|
|
|
|
|
userCurrency: user?.settings?.settings.baseCurrency ?? DEFAULT_CURRENCY, |
|
|
|
|
|
userId: user.id, |
|
|
|
|
|
withExcludedAccountsAndActivities: false |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Experimental
|
|
|
// Experimental
|
|
|
const latestActivities = this.configurationService.get( |
|
|
let latestActivities: PublicPortfolioResponse['latestActivities'] = []; |
|
|
'ENABLE_FEATURE_SUBSCRIPTION' |
|
|
|
|
|
) |
|
|
if (!this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { |
|
|
? [] |
|
|
const { activities } = await this.activitiesService.getActivities({ |
|
|
: activities.map( |
|
|
filters, |
|
|
({ |
|
|
sortColumn: 'date', |
|
|
assetProfile, |
|
|
sortDirection: 'desc', |
|
|
|
|
|
take: 10, |
|
|
|
|
|
types: [ActivityType.BUY, ActivityType.SELL], |
|
|
|
|
|
userCurrency: user?.settings?.settings.baseCurrency ?? DEFAULT_CURRENCY, |
|
|
|
|
|
userId: user.id, |
|
|
|
|
|
withExcludedAccountsAndActivities: false |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
latestActivities = activities.map( |
|
|
|
|
|
({ |
|
|
|
|
|
assetProfile, |
|
|
|
|
|
currency, |
|
|
|
|
|
date, |
|
|
|
|
|
fee, |
|
|
|
|
|
quantity, |
|
|
|
|
|
type, |
|
|
|
|
|
unitPrice, |
|
|
|
|
|
value, |
|
|
|
|
|
valueInBaseCurrency |
|
|
|
|
|
}) => { |
|
|
|
|
|
return { |
|
|
currency, |
|
|
currency, |
|
|
date, |
|
|
date, |
|
|
fee, |
|
|
fee, |
|
|
@ -107,26 +116,17 @@ export class PublicService { |
|
|
type, |
|
|
type, |
|
|
unitPrice, |
|
|
unitPrice, |
|
|
value, |
|
|
value, |
|
|
valueInBaseCurrency |
|
|
valueInBaseCurrency, |
|
|
}) => { |
|
|
assetProfile: { |
|
|
return { |
|
|
currency: assetProfile.currency, |
|
|
currency, |
|
|
dataSource: assetProfile.dataSource, |
|
|
date, |
|
|
name: assetProfile.name, |
|
|
fee, |
|
|
symbol: assetProfile.symbol |
|
|
quantity, |
|
|
} |
|
|
type, |
|
|
}; |
|
|
unitPrice, |
|
|
} |
|
|
value, |
|
|
); |
|
|
valueInBaseCurrency, |
|
|
} |
|
|
assetProfile: { |
|
|
|
|
|
currency: assetProfile.currency, |
|
|
|
|
|
dataSource: assetProfile.dataSource, |
|
|
|
|
|
name: assetProfile.name, |
|
|
|
|
|
symbol: assetProfile.symbol |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
Object.values(markets ?? {}).forEach((market) => { |
|
|
Object.values(markets ?? {}).forEach((market) => { |
|
|
delete market.valueInBaseCurrency; |
|
|
delete market.valueInBaseCurrency; |
|
|
|