Browse Source
Merge branch 'main' into feature/upgrade-simplewebauthn-dependencies-to-version-9.0
pull/3130/head
Thomas Kaul
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with
39 additions and
27 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.controller.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts
-
apps/api/src/services/symbol-profile/symbol-profile.service.ts
-
apps/client/src/app/components/home-summary/home-summary.component.ts
-
apps/client/src/app/services/data.service.ts
-
apps/client/src/assets/oss-friends.json
-
package.json
-
yarn.lock
|
|
@ -14,10 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Changed |
|
|
|
|
|
|
|
- Upgraded `@simplewebauthn/browser` and `@simplewebauthn/server` from version `8.3` to `9.0` |
|
|
|
- Upgraded `countries-list` from version `2.6.1` to `3.1.0` |
|
|
|
- Upgraded `yahoo-finance2` from version `2.9.1` to `2.10.0` |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue in the performance calculation caused by multiple `SELL` activities on the same day |
|
|
|
- Fixed an issue in the calculation on the allocations page caused by liabilities |
|
|
|
|
|
|
|
## 2.62.0 - 2024-03-09 |
|
|
|
|
|
|
|
|
|
@ -76,8 +76,11 @@ export class PortfolioController { |
|
|
|
@Query('accounts') filterByAccounts?: string, |
|
|
|
@Query('assetClasses') filterByAssetClasses?: string, |
|
|
|
@Query('range') dateRange: DateRange = 'max', |
|
|
|
@Query('tags') filterByTags?: string |
|
|
|
@Query('tags') filterByTags?: string, |
|
|
|
@Query('withLiabilities') withLiabilitiesParam = 'false' |
|
|
|
): Promise<PortfolioDetails & { hasError: boolean }> { |
|
|
|
const withLiabilities = withLiabilitiesParam === 'true'; |
|
|
|
|
|
|
|
let hasDetails = true; |
|
|
|
let hasError = false; |
|
|
|
const hasReadRestrictedAccessPermission = |
|
|
@ -101,8 +104,8 @@ export class PortfolioController { |
|
|
|
dateRange, |
|
|
|
filters, |
|
|
|
impersonationId, |
|
|
|
withLiabilities, |
|
|
|
userId: this.request.user.id, |
|
|
|
withLiabilities: true, |
|
|
|
withSummary: true |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -146,8 +146,7 @@ export class PortfolioService { |
|
|
|
filters, |
|
|
|
withExcludedAccounts, |
|
|
|
impersonationId: userId, |
|
|
|
userId: this.request.user.id, |
|
|
|
withLiabilities: true |
|
|
|
userId: this.request.user.id |
|
|
|
}) |
|
|
|
]); |
|
|
|
|
|
|
@ -393,6 +392,7 @@ export class PortfolioService { |
|
|
|
}); |
|
|
|
|
|
|
|
const holdings: PortfolioDetails['holdings'] = {}; |
|
|
|
|
|
|
|
const totalValueInBaseCurrency = |
|
|
|
currentPositions.currentValueInBaseCurrency.plus( |
|
|
|
cashDetails.balanceInBaseCurrency |
|
|
|
|
|
@ -5,12 +5,12 @@ import { Sector } from '@ghostfolio/common/interfaces/sector.interface'; |
|
|
|
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
import { SymbolProfile } from '@prisma/client'; |
|
|
|
import { countries } from 'countries-list'; |
|
|
|
import got from 'got'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class TrackinsightDataEnhancerService implements DataEnhancerInterface { |
|
|
|
private static baseUrl = 'https://www.trackinsight.com/data-api'; |
|
|
|
private static countries = require('countries-list/dist/countries.json'); |
|
|
|
private static countriesMapping = { |
|
|
|
'Russian Federation': 'Russia' |
|
|
|
}; |
|
|
@ -131,20 +131,19 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { |
|
|
|
(response.countries as unknown as Country[]).length === 0 |
|
|
|
) { |
|
|
|
response.countries = []; |
|
|
|
|
|
|
|
for (const [name, value] of Object.entries<any>( |
|
|
|
holdings?.countries ?? {} |
|
|
|
)) { |
|
|
|
let countryCode: string; |
|
|
|
|
|
|
|
for (const [key, country] of Object.entries<any>( |
|
|
|
TrackinsightDataEnhancerService.countries |
|
|
|
)) { |
|
|
|
for (const [code, country] of Object.entries(countries)) { |
|
|
|
if ( |
|
|
|
country.name === name || |
|
|
|
country.name === |
|
|
|
TrackinsightDataEnhancerService.countriesMapping[name] |
|
|
|
) { |
|
|
|
countryCode = key; |
|
|
|
countryCode = code; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -189,9 +189,8 @@ export class SymbolProfileService { |
|
|
|
return { |
|
|
|
code, |
|
|
|
weight, |
|
|
|
continent: |
|
|
|
continents[countries[code as string]?.continent] ?? UNKNOWN_KEY, |
|
|
|
name: countries[code as string]?.name ?? UNKNOWN_KEY |
|
|
|
continent: continents[countries[code]?.continent] ?? UNKNOWN_KEY, |
|
|
|
name: countries[code]?.name ?? UNKNOWN_KEY |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
@ -102,7 +102,7 @@ export class HomeSummaryComponent implements OnDestroy, OnInit { |
|
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
this.dataService |
|
|
|
.fetchPortfolioDetails() |
|
|
|
.fetchPortfolioDetails({ withLiabilities: true }) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(({ summary }) => { |
|
|
|
this.summary = summary; |
|
|
|
|
|
@ -390,13 +390,21 @@ export class DataService { |
|
|
|
} |
|
|
|
|
|
|
|
public fetchPortfolioDetails({ |
|
|
|
filters |
|
|
|
filters, |
|
|
|
withLiabilities = false |
|
|
|
}: { |
|
|
|
filters?: Filter[]; |
|
|
|
withLiabilities?: boolean; |
|
|
|
} = {}): Observable<PortfolioDetails> { |
|
|
|
let params = this.buildFiltersAsQueryParams({ filters }); |
|
|
|
|
|
|
|
if (withLiabilities) { |
|
|
|
params = params.append('withLiabilities', withLiabilities); |
|
|
|
} |
|
|
|
|
|
|
|
return this.http |
|
|
|
.get<any>('/api/v1/portfolio/details', { |
|
|
|
params: this.buildFiltersAsQueryParams({ filters }) |
|
|
|
params |
|
|
|
}) |
|
|
|
.pipe( |
|
|
|
map((response) => { |
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
{ |
|
|
|
"createdAt": "2024-02-29T00:00:00.000Z", |
|
|
|
"createdAt": "2024-03-11T00:00:00.000Z", |
|
|
|
"data": [ |
|
|
|
{ |
|
|
|
"name": "Aptabase", |
|
|
@ -8,7 +8,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "Argos", |
|
|
|
"description": "Argos provides the developer tools to debug tests and detect visual regressions..", |
|
|
|
"description": "Argos provides the developer tools to debug tests and detect visual regressions.", |
|
|
|
"href": "https://argos-ci.com" |
|
|
|
}, |
|
|
|
{ |
|
|
|
|
|
@ -102,7 +102,7 @@ |
|
|
|
"class-validator": "0.14.0", |
|
|
|
"color": "4.2.3", |
|
|
|
"countries-and-timezones": "3.4.1", |
|
|
|
"countries-list": "2.6.1", |
|
|
|
"countries-list": "3.1.0", |
|
|
|
"countup.js": "2.3.2", |
|
|
|
"date-fns": "2.29.3", |
|
|
|
"envalid": "7.3.1", |
|
|
@ -131,7 +131,7 @@ |
|
|
|
"svgmap": "2.6.0", |
|
|
|
"twitter-api-v2": "1.14.2", |
|
|
|
"uuid": "9.0.1", |
|
|
|
"yahoo-finance2": "2.9.1", |
|
|
|
"yahoo-finance2": "2.10.0", |
|
|
|
"zone.js": "0.14.3" |
|
|
|
}, |
|
|
|
"devDependencies": { |
|
|
|
|
|
@ -9688,10 +9688,10 @@ countries-and-timezones@3.4.1: |
|
|
|
resolved "https://registry.yarnpkg.com/countries-and-timezones/-/countries-and-timezones-3.4.1.tgz#0ec2540f57e42f0f740eb2acaede786043347fe1" |
|
|
|
integrity sha512-INeHGCony4XUUR8iGL/lmt9s1Oi+n+gFHeJAMfbV5hJfYeDOB8JG1oxz5xFQu5oBZoRCJe/87k1Vzue9DoIauA== |
|
|
|
|
|
|
|
countries-list@2.6.1: |
|
|
|
version "2.6.1" |
|
|
|
resolved "https://registry.yarnpkg.com/countries-list/-/countries-list-2.6.1.tgz#d479757ac873b1e596ccea0a925962d20396c0cb" |
|
|
|
integrity sha512-jXM1Nv3U56dPQ1DsUSsEaGmLHburo4fnB7m+1yhWDUVvx5gXCd1ok/y3gXCjXzhqyawG+igcPYcAl4qjkvopaQ== |
|
|
|
countries-list@3.1.0: |
|
|
|
version "3.1.0" |
|
|
|
resolved "https://registry.yarnpkg.com/countries-list/-/countries-list-3.1.0.tgz#1cbe32f58659c7d6a1e744917689f24c84333ea8" |
|
|
|
integrity sha512-HpTBLZba1VPTZSjUnUwR7SykxV7Z/7/+ZM5x5wi5tO99Qvom6bE2SC+AQ18016ujg3jSlYBbMITrHNnPAHSM9Q== |
|
|
|
|
|
|
|
countup.js@2.3.2: |
|
|
|
version "2.3.2" |
|
|
@ -19186,10 +19186,10 @@ y18n@^5.0.5: |
|
|
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" |
|
|
|
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== |
|
|
|
|
|
|
|
yahoo-finance2@2.9.1: |
|
|
|
version "2.9.1" |
|
|
|
resolved "https://registry.yarnpkg.com/yahoo-finance2/-/yahoo-finance2-2.9.1.tgz#43e22465403f48c688ff8e762f3894aac8014d70" |
|
|
|
integrity sha512-s+i5arE6+zUwHRJnze4EsU5aCTmsMFKFeBc9sMzSceDOjH+BSeEZG9twMYtWlSCjKbWLCmUEUCxtH1fvcq+f6Q== |
|
|
|
yahoo-finance2@2.10.0: |
|
|
|
version "2.10.0" |
|
|
|
resolved "https://registry.yarnpkg.com/yahoo-finance2/-/yahoo-finance2-2.10.0.tgz#90a9d7984e3b35a11fff9850c55d1cd322ddbee3" |
|
|
|
integrity sha512-yKHjMEnFVkgIvgyxjsNAMLf4xGCKM+HzThorCNuCoE71yoie75lR+WTd0HshdCnb8tpsCclFaP045I+p6Mu6aA== |
|
|
|
dependencies: |
|
|
|
"@types/tough-cookie" "^4.0.2" |
|
|
|
ajv "8.10.0" |
|
|
|