Browse Source

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

* Exclude scraper configuration and symbol mapping from import and export

* Update changelog
pull/6418/head
Thomas Kaul 12 hours ago
committed by GitHub
parent
commit
08c04e69cf
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 5
      apps/api/src/app/export/export.service.ts
  3. 2
      apps/client/src/app/services/import-activities.service.ts
  4. 11
      libs/common/src/lib/dtos/create-asset-profile.dto.ts
  5. 7
      libs/common/src/lib/interfaces/responses/export-response.interface.ts
  6. 2
      test/import/ok/penthouse-apartment.json
  7. 4
      test/import/ok/sample.json

2
CHANGELOG.md

@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### 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 Dutch (`nl`)
- Improved the language localization for Italian (`it`) - Improved the language localization for Italian (`it`)

5
apps/api/src/app/export/export.service.ts

@ -182,10 +182,8 @@ export class ExportService {
isActive, isActive,
isin, isin,
name, name,
scraperConfiguration,
sectors, sectors,
symbol, symbol,
symbolMapping,
url url
}) => { }) => {
return { return {
@ -204,11 +202,8 @@ export class ExportService {
isin, isin,
marketData: marketDataByAssetProfile[id], marketData: marketDataByAssetProfile[id],
name, name,
scraperConfiguration:
scraperConfiguration as unknown as Prisma.JsonArray,
sectors: sectors as unknown as Prisma.JsonArray, sectors: sectors as unknown as Prisma.JsonArray,
symbol, symbol,
symbolMapping,
url url
}; };
} }

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

@ -97,9 +97,7 @@ export class ImportActivitiesService {
isin: null, isin: null,
marketData: [], marketData: [],
name: symbol, name: symbol,
scraperConfiguration: null,
sectors: [], sectors: [],
symbolMapping: {},
url: null url: null
}); });
} }

11
libs/common/src/lib/dtos/create-asset-profile.dto.ts

@ -5,7 +5,6 @@ import {
IsArray, IsArray,
IsBoolean, IsBoolean,
IsEnum, IsEnum,
IsObject,
IsOptional, IsOptional,
IsString, IsString,
IsUrl IsUrl
@ -66,10 +65,6 @@ export class CreateAssetProfileDto {
@IsString() @IsString()
name?: string; name?: string;
@IsObject()
@IsOptional()
scraperConfiguration?: Prisma.InputJsonObject;
@IsArray() @IsArray()
@IsOptional() @IsOptional()
sectors?: Prisma.InputJsonArray; sectors?: Prisma.InputJsonArray;
@ -77,12 +72,6 @@ export class CreateAssetProfileDto {
@IsString() @IsString()
symbol: string; symbol: string;
@IsObject()
@IsOptional()
symbolMapping?: {
[dataProvider: string]: string;
};
@IsOptional() @IsOptional()
@IsUrl({ @IsUrl({
protocols: ['https'], protocols: ['https'],

7
libs/common/src/lib/interfaces/responses/export-response.interface.ts

@ -27,7 +27,12 @@ export interface ExportResponse {
> & { dataSource: DataSource; date: string; symbol: string })[]; > & { dataSource: DataSource; date: string; symbol: string })[];
assetProfiles: (Omit< assetProfiles: (Omit<
SymbolProfile, SymbolProfile,
'createdAt' | 'id' | 'updatedAt' | 'userId' | 'createdAt'
| 'id'
| 'scraperConfiguration'
| 'symbolMapping'
| 'updatedAt'
| 'userId'
> & { > & {
marketData: MarketData[]; marketData: MarketData[];
})[]; })[];

2
test/import/ok/penthouse-apartment.json

@ -21,10 +21,8 @@
"isin": null, "isin": null,
"marketData": [], "marketData": [],
"name": "Penthouse Apartment", "name": "Penthouse Apartment",
"scraperConfiguration": null,
"sectors": [], "sectors": [],
"symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1", "symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1",
"symbolMapping": {},
"url": null "url": null
} }
], ],

4
test/import/ok/sample.json

@ -41,10 +41,8 @@
"isin": null, "isin": null,
"marketData": [], "marketData": [],
"name": "Account Opening Fee", "name": "Account Opening Fee",
"scraperConfiguration": null,
"sectors": [], "sectors": [],
"symbol": "14a69cb9-1e31-43fa-b320-83703d8ed74b", "symbol": "14a69cb9-1e31-43fa-b320-83703d8ed74b",
"symbolMapping": {},
"url": null "url": null
}, },
{ {
@ -63,10 +61,8 @@
"isin": null, "isin": null,
"marketData": [], "marketData": [],
"name": "Penthouse Apartment", "name": "Penthouse Apartment",
"scraperConfiguration": null,
"sectors": [], "sectors": [],
"symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1", "symbol": "7e91b7d4-1430-4212-8380-289a06c9bbc1",
"symbolMapping": {},
"url": null "url": null
} }
], ],

Loading…
Cancel
Save