Browse Source
Merge branch 'main' into feature/add-cusip-to-asset-profile-model
pull/4347/head
Thomas Kaul
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with
22 additions and
4 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
-
apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts
-
apps/api/src/app/user/user.service.ts
-
libs/common/src/lib/interfaces/user.interface.ts
-
libs/common/src/lib/models/portfolio-snapshot.ts
-
libs/ui/src/lib/value/value.component.html
|
|
@ -10,12 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Added |
|
|
|
|
|
|
|
- Extended the export functionality by the tags |
|
|
|
- Extended the portfolio snapshot in the portfolio calculator by the activities count |
|
|
|
- Extended the user endpoint `GET api/v1/user` by the activities count |
|
|
|
- Added `cusip` to the asset profile model |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Upgraded `prettier` from version `3.4.2` to `3.5.1` |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Improved the numeric comparison of strings in the value component |
|
|
|
|
|
|
|
## 2.140.0 - 2025-02-20 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
@ -175,6 +175,7 @@ export abstract class PortfolioCalculator { |
|
|
|
|
|
|
|
if (!transactionPoints.length) { |
|
|
|
return { |
|
|
|
activitiesCount: 0, |
|
|
|
currentValueInBaseCurrency: new Big(0), |
|
|
|
errors: [], |
|
|
|
hasErrors: false, |
|
|
|
|
|
@ -101,6 +101,9 @@ export class TWRPortfolioCalculator extends PortfolioCalculator { |
|
|
|
totalInterestWithCurrencyEffect, |
|
|
|
totalInvestment, |
|
|
|
totalInvestmentWithCurrencyEffect, |
|
|
|
activitiesCount: this.activities.filter(({ type }) => { |
|
|
|
return ['BUY', 'SELL'].includes(type); |
|
|
|
}).length, |
|
|
|
errors: [], |
|
|
|
historicalData: [], |
|
|
|
totalLiabilitiesWithCurrencyEffect: new Big(0), |
|
|
|
|
|
@ -86,6 +86,9 @@ export class UserService { |
|
|
|
orderBy: { alias: 'asc' }, |
|
|
|
where: { GranteeUser: { id } } |
|
|
|
}), |
|
|
|
this.prismaService.order.count({ |
|
|
|
where: { userId: id } |
|
|
|
}), |
|
|
|
this.prismaService.order.findFirst({ |
|
|
|
orderBy: { |
|
|
|
date: 'asc' |
|
|
@ -96,8 +99,9 @@ export class UserService { |
|
|
|
]); |
|
|
|
|
|
|
|
const access = userData[0]; |
|
|
|
const firstActivity = userData[1]; |
|
|
|
let tags = userData[2]; |
|
|
|
const activitiesCount = userData[1]; |
|
|
|
const firstActivity = userData[2]; |
|
|
|
let tags = userData[3]; |
|
|
|
|
|
|
|
let systemMessage: SystemMessage; |
|
|
|
|
|
|
@ -117,6 +121,7 @@ export class UserService { |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
activitiesCount, |
|
|
|
id, |
|
|
|
permissions, |
|
|
|
subscription, |
|
|
|
|
|
@ -10,6 +10,7 @@ import { UserSettings } from './user-settings.interface'; |
|
|
|
export interface User { |
|
|
|
access: Pick<Access, 'alias' | 'id' | 'permissions'>[]; |
|
|
|
accounts: Account[]; |
|
|
|
activitiesCount: number; |
|
|
|
dateOfFirstActivity: Date; |
|
|
|
id: string; |
|
|
|
permissions: string[]; |
|
|
|
|
|
@ -9,6 +9,8 @@ import { Big } from 'big.js'; |
|
|
|
import { Transform, Type } from 'class-transformer'; |
|
|
|
|
|
|
|
export class PortfolioSnapshot { |
|
|
|
activitiesCount: number; |
|
|
|
|
|
|
|
@Transform(transformToBig, { toClassOnly: true }) |
|
|
|
@Type(() => Big) |
|
|
|
currentValueInBaseCurrency: Big; |
|
|
|
|
|
@ -10,8 +10,8 @@ |
|
|
|
> |
|
|
|
<ng-container *ngIf="isNumber || value === null"> |
|
|
|
<ng-container *ngIf="colorizeSign && !useAbsoluteValue"> |
|
|
|
<div *ngIf="value > 0" class="mr-1 text-success">+</div> |
|
|
|
<div *ngIf="value < 0" class="mr-1 text-danger">-</div> |
|
|
|
<div *ngIf="+value > 0" class="mr-1 text-success">+</div> |
|
|
|
<div *ngIf="+value < 0" class="mr-1 text-danger">-</div> |
|
|
|
</ng-container> |
|
|
|
<div |
|
|
|
*ngIf="isPercent" |
|
|
|