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 10 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
- 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`)

5
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
};
}

2
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
});
}

11
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'],

7
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[];
})[];

2
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
}
],

4
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
}
],

Loading…
Cancel
Save