Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/exclude scraper configuration and symbol mapping from import and export functionality (#6415)

Thomas Kaul08c04e69cf74
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 667b25e5df..65d27e77a4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Excluded the scraper configuration from the import and export functionality
+- Excluded the symbol mapping from the import and export functionality
- Improved the language localization for Dutch (`nl`)
- Improved the language localization for Italian (`it`)
diff --git a/apps/api/src/app/export/export.service.ts b/apps/api/src/app/export/export.service.ts
index d07b199be9..55f8d7dc93 100644
--- a/apps/api/src/app/export/export.service.ts
+++ b/apps/api/src/app/export/export.service.ts
@@ -182,10 +182,8 @@ export class ExportService {
isActive,
isin,
name,
- scraperConfiguration,
sectors,
symbol,
- symbolMapping,
url
}) => {
return {
@@ -204,11 +202,8 @@ export class ExportService {
isin,
marketData: marketDataByAssetProfile[id],
name,
- scraperConfiguration:
- scraperConfiguration as unknown as Prisma.JsonArray,
sectors: sectors as unknown as Prisma.JsonArray,
symbol,
- symbolMapping,
url
};
}
diff --git a/apps/client/src/app/services/import-activities.service.ts b/apps/client/src/app/services/import-activities.service.ts
index 94d8470f79..55b5c44d56 100644
--- a/apps/client/src/app/services/import-activities.service.ts
+++ b/apps/client/src/app/services/import-activities.service.ts
@@ -97,9 +97,7 @@ export class ImportActivitiesService {
isin: null,
marketData: [],
name: symbol,
- scraperConfiguration: null,
sectors: [],
- symbolMapping: {},
url: null
});
}
diff --git a/libs/common/src/lib/dtos/create-asset-profile.dto.ts b/libs/common/src/lib/dtos/create-asset-profile.dto.ts
index 80d45ba421..85ad73cc0e 100644
--- a/libs/common/src/lib/dtos/create-asset-profile.dto.ts
+++ b/libs/common/src/lib/dtos/create-asset-profile.dto.ts
@@ -5,7 +5,6 @@ import {
IsArray,
IsBoolean,
IsEnum,
- IsObject,
IsOptional,
IsString,
IsUrl
@@ -66,10 +65,6 @@ export class CreateAssetProfileDto {
@IsString()
name?: string;
- @IsObject()
- @IsOptional()
- scraperConfiguration?: Prisma.InputJsonObject;
-
@IsArray()
@IsOptional()
sectors?: Prisma.InputJsonArray;
@@ -77,12 +72,6 @@ export class CreateAssetProfileDto {
@IsString()
symbol: string;
- @IsObject()
- @IsOptional()
- symbolMapping?: {
- [dataProvider: string]: string;
- };
-
@IsOptional()
@IsUrl({
protocols: ['https'],
diff --git a/libs/common/src/lib/interfaces/responses/export-response.interface.ts b/libs/common/src/lib/interfaces/responses/export-response.interface.ts
index 8b1697ca45..fa592faf27 100644
--- a/libs/common/src/lib/interfaces/responses/export-response.interface.ts
+++ b/libs/common/src/lib/interfaces/responses/export-response.interface.ts
@@ -27,7 +27,12 @@ export interface ExportResponse {
> & { dataSource: DataSource; date: string; symbol: string })[];
assetProfiles: (Omit<
SymbolProfile,
- 'createdAt' | 'id' | 'updatedAt' | 'userId'
+ | 'createdAt'
+ | 'id'
+ | 'scraperConfiguration'
+ | 'symbolMapping'
+ | 'updatedAt'
+ | 'userId'
> & {
marketData: MarketData[];
})[];
diff --git a/test/import/ok/penthouse-apartment.json b/test/import/ok/penthouse-apartment.json
index 0c35521e67..3b5e5420b9 100644
--- a/test/import/ok/penthouse-apartment.json
+++ b/test/import/ok/penthouse-apartment.json
@@ -21,10 +21,8 @@
"isin": null,
"marketData": [],
"name": "Penthouse Apartment",
- "scraperConfiguration": null,
"sectors": [],
"symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1",
- "symbolMapping": {},
"url": null
}
],
diff --git a/test/import/ok/sample.json b/test/import/ok/sample.json
index bc2798718e..be385812a2 100644
--- a/test/import/ok/sample.json
+++ b/test/import/ok/sample.json
@@ -41,10 +41,8 @@
"isin": null,
"marketData": [],
"name": "Account Opening Fee",
- "scraperConfiguration": null,
"sectors": [],
"symbol": "14a69cb9-1e31-43fa-b320-83703d8ed74b",
- "symbolMapping": {},
"url": null
},
{
@@ -63,10 +61,8 @@
"isin": null,
"marketData": [],
"name": "Penthouse Apartment",
- "scraperConfiguration": null,
"sectors": [],
"symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1",
- "symbolMapping": {},
"url": null
}
],