From dbc38e705e3474bb4e1617e438a87fdea8f472e3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 9 Aug 2022 19:29:26 +0200 Subject: [PATCH] Feature/add url to symbol profile overrides (#1132) * Add url to symbol profile overrides * Improve filter by asset class * Update changelog --- CHANGELOG.md | 9 +++++++++ apps/api/src/app/order/order.service.ts | 2 +- apps/api/src/services/symbol-profile.service.ts | 13 ++++++++++--- .../migration.sql | 2 ++ prisma/schema.prisma | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 32bce2498..90bb3a275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added `url` to the symbol profile overrides model for manual adjustments + ### Changed - Simplified the initialization of the exchange rate service +- Improved the orders query for `assetClass` with symbol profile overrides - Improved the styling of the benchmarks in the markets overview +### Todo + +- Apply data migration (`yarn database:migrate`) + ## 1.177.0 - 04.08.2022 ### Added diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index 6b12bd723..3f2a84200 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -231,7 +231,7 @@ export class OrderService { }, { SymbolProfileOverrides: { - is: null + assetClass: null } } ] diff --git a/apps/api/src/services/symbol-profile.service.ts b/apps/api/src/services/symbol-profile.service.ts index c91da6d61..1c8da554c 100644 --- a/apps/api/src/services/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile.service.ts @@ -115,9 +115,16 @@ export class SymbolProfileService { } item.name = item.SymbolProfileOverrides?.name ?? item.name; - item.sectors = - (item.SymbolProfileOverrides.sectors as unknown as Sector[]) ?? - item.sectors; + + if ( + (item.SymbolProfileOverrides.sectors as unknown as Sector[])?.length > + 0 + ) { + item.sectors = item.SymbolProfileOverrides + .sectors as unknown as Sector[]; + } + + item.url = item.SymbolProfileOverrides?.url ?? item.url; delete item.SymbolProfileOverrides; } diff --git a/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql b/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql new file mode 100644 index 000000000..288287406 --- /dev/null +++ b/prisma/migrations/20220808181846_added_url_to_symbol_profile_overrides/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "SymbolProfileOverrides" ADD COLUMN "url" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6eb2919ac..12eb5690d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -136,6 +136,7 @@ model SymbolProfileOverrides { countries Json? name String? sectors Json? + url String? symbolProfileId String @id updatedAt DateTime @updatedAt SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id])