Browse Source

code review changes

pull/5243/head
Attila Cseh 4 weeks ago
parent
commit
e863423a55
  1. 2
      CHANGELOG.md
  2. 16
      apps/api/src/app/import/import.service.ts
  3. 2
      apps/client/src/app/services/import-activities.service.ts
  4. 1
      package-lock.json
  5. 1
      package.json

2
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Extended the import functionality by custom asset profiles
- Refactored the toggle component to standalone
- Improved the language localization for Dutch (`nl`)
- Improved the language localization for Portuguese (`pt`)
@ -25,7 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `ngx-stripe` from version `19.7.0` to `20.7.0`
- Upgraded `Nx` from version `21.1.2` to `21.2.4`
- Upgraded `storybook` from version `8.6.12` to `9.0.17`
- Extended the import functionality by custom asset profiles
### Fixed

16
apps/api/src/app/import/import.service.ts

@ -236,11 +236,11 @@ export class ImportService {
}
}
if (!isDryRun && assetProfilesWithMarketDataDto) {
if (!isDryRun && assetProfilesWithMarketDataDto?.length) {
// Filter out not custom asset profiles
assetProfilesWithMarketDataDto = assetProfilesWithMarketDataDto.filter(
(assetProfile) => {
return assetProfile.dataSource === DataSource.MANUAL;
({ dataSource }) => {
return dataSource === DataSource.MANUAL;
}
);
@ -255,17 +255,15 @@ export class ImportService {
for (const assetProfileWithMarketData of assetProfilesWithMarketDataDto) {
// Check if there is any existing asset profile
const existingAssetProfile = existingAssetProfiles.find(
(existingAssetProfile) => {
({ dataSource, symbol }) => {
return (
existingAssetProfile.dataSource ===
assetProfileWithMarketData.dataSource &&
existingAssetProfile.symbol ===
assetProfileWithMarketData.symbol
dataSource === assetProfileWithMarketData.dataSource &&
symbol === assetProfileWithMarketData.symbol
);
}
);
// If there is no asset profile or if the asset profile belongs to a different user then create a new asset profile
// If there is no asset profile or if the asset profile belongs to a different user, then create a new asset profile
if (
!existingAssetProfile ||
existingAssetProfile.userId !== user.id

2
apps/client/src/app/services/import-activities.service.ts

@ -124,7 +124,7 @@ export class ImportActivitiesService {
importData.push(this.convertToCreateOrderDto(activity));
}
return this.importJson({ accounts, activities: importData, assetProfiles });
return this.importJson({ accounts, assetProfiles, activities: importData });
}
private convertToCreateOrderDto({

1
package-lock.json

@ -122,7 +122,6 @@
"@nx/node": "21.2.4",
"@nx/storybook": "21.2.4",
"@nx/web": "21.2.4",
"@nx/webpack": "21.2.4",
"@nx/workspace": "21.2.4",
"@schematics/angular": "20.0.6",
"@storybook/addon-docs": "9.0.17",

1
package.json

@ -168,7 +168,6 @@
"@nx/node": "21.2.4",
"@nx/storybook": "21.2.4",
"@nx/web": "21.2.4",
"@nx/webpack": "21.2.4",
"@nx/workspace": "21.2.4",
"@schematics/angular": "20.0.6",
"@storybook/addon-docs": "9.0.17",

Loading…
Cancel
Save