Browse Source
Bugfix/fix activities import with account balances (#4446)
* Fix import with account balances
* Update changelog
pull/4455/merge
Thomas Kaul
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
27 additions and
4 deletions
-
CHANGELOG.md
-
apps/api/src/app/import/create-account-with-balances.dto.ts
-
apps/api/src/app/import/import-data.dto.ts
-
libs/common/src/lib/interfaces/account-balance.interface.ts
-
libs/common/src/lib/interfaces/export.interface.ts
-
libs/common/src/lib/interfaces/index.ts
|
|
@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
- Improved the symbol validation in the _Yahoo Finance_ service (get asset profiles) |
|
|
|
- Refreshed the cryptocurrencies list |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue in the activities import functionality related to the account balances |
|
|
|
|
|
|
|
## 2.146.0 - 2025-03-15 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
@ -0,0 +1,10 @@ |
|
|
|
import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; |
|
|
|
import { AccountBalance } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
|
|
import { IsArray, IsOptional } from 'class-validator'; |
|
|
|
|
|
|
|
export class CreateAccountWithBalancesDto extends CreateAccountDto { |
|
|
|
@IsArray() |
|
|
|
@IsOptional() |
|
|
|
balances?: AccountBalance; |
|
|
|
} |
|
|
@ -1,15 +1,16 @@ |
|
|
|
import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto'; |
|
|
|
import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto'; |
|
|
|
|
|
|
|
import { Type } from 'class-transformer'; |
|
|
|
import { IsArray, IsOptional, ValidateNested } from 'class-validator'; |
|
|
|
|
|
|
|
import { CreateAccountWithBalancesDto } from './create-account-with-balances.dto'; |
|
|
|
|
|
|
|
export class ImportDataDto { |
|
|
|
@IsOptional() |
|
|
|
@IsArray() |
|
|
|
@Type(() => CreateAccountDto) |
|
|
|
@Type(() => CreateAccountWithBalancesDto) |
|
|
|
@ValidateNested({ each: true }) |
|
|
|
accounts: CreateAccountDto[]; |
|
|
|
accounts: CreateAccountWithBalancesDto[]; |
|
|
|
|
|
|
|
@IsArray() |
|
|
|
@Type(() => CreateOrderDto) |
|
|
|
|
|
@ -0,0 +1,4 @@ |
|
|
|
export interface AccountBalance { |
|
|
|
date: string; |
|
|
|
value: number; |
|
|
|
} |
|
|
@ -1,8 +1,10 @@ |
|
|
|
import { Account, Order, Platform, Tag } from '@prisma/client'; |
|
|
|
|
|
|
|
import { AccountBalance } from './account-balance.interface'; |
|
|
|
|
|
|
|
export interface Export { |
|
|
|
accounts: (Omit<Account, 'createdAt' | 'updatedAt' | 'userId'> & { |
|
|
|
balances: { date: string; value: number }[]; |
|
|
|
balances: AccountBalance[]; |
|
|
|
})[]; |
|
|
|
activities: (Omit< |
|
|
|
Order, |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import type { Access } from './access.interface'; |
|
|
|
import type { AccountBalance } from './account-balance.interface'; |
|
|
|
import type { Accounts } from './accounts.interface'; |
|
|
|
import type { AdminData } from './admin-data.interface'; |
|
|
|
import type { AdminJobs } from './admin-jobs.interface'; |
|
|
@ -68,6 +69,7 @@ import type { XRayRulesSettings } from './x-ray-rules-settings.interface'; |
|
|
|
|
|
|
|
export { |
|
|
|
Access, |
|
|
|
AccountBalance, |
|
|
|
AccountBalancesResponse, |
|
|
|
Accounts, |
|
|
|
AdminData, |
|
|
|