Skip to content

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

Feature/add url to symbol profile overrides (#1132)

Thomas Kauldbc38e705e34
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32bce24986..90bb3a2756 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 6b12bd723a..3f2a842004 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 c91da6d610..1c8da554c0 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 0000000000..288287406f
--- /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 6eb2919ac8..12eb5690d1 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])