Thomas Kaul 1 week ago
committed by GitHub
parent
commit
2187cd9e05
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 17
      apps/api/src/app/order/order.service.ts

4
CHANGELOG.md

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Deprecated `activities` in the endpoint `GET api/v1/portfolio/holding/:dataSource/:symbol` - Deprecated `activities` in the endpoint `GET api/v1/portfolio/holding/:dataSource/:symbol`
### Fixed
- Fixed the filtering by asset class in the endpoint `GET api/v1/portfolio/holdings`
## 2.228.0 - 2026-01-03 ## 2.228.0 - 2026-01-03
### Added ### Added

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

@ -335,14 +335,16 @@ export class OrderService {
*/ */
public async getCashOrders({ public async getCashOrders({
cashDetails, cashDetails,
filters = [],
userCurrency, userCurrency,
userId userId
}: { }: {
cashDetails: CashDetails; cashDetails: CashDetails;
filters?: Filter[];
userCurrency: string; userCurrency: string;
userId: string; userId: string;
}): Promise<ActivitiesResponse> { }): Promise<ActivitiesResponse> {
const activities: Activity[] = []; let activities: Activity[] = [];
for (const account of cashDetails.accounts) { for (const account of cashDetails.accounts) {
const { balances } = await this.accountBalanceService.getAccountBalances({ const { balances } = await this.accountBalanceService.getAccountBalances({
@ -422,6 +424,18 @@ export class OrderService {
} }
} }
activities = activities.filter(({ SymbolProfile }) => {
for (const { id, type } of filters) {
if (type === 'ASSET_CLASS') {
if (id !== SymbolProfile.assetClass) {
return false;
}
}
}
return true;
});
return { return {
activities, activities,
count: activities.length count: activities.length
@ -755,6 +769,7 @@ export class OrderService {
const cashOrders = await this.getCashOrders({ const cashOrders = await this.getCashOrders({
cashDetails, cashDetails,
filters,
userCurrency, userCurrency,
userId userId
}); });

Loading…
Cancel
Save